Commit Graph

30 Commits

Author SHA1 Message Date
Anas Rashid
e409adc668 Accounts: email and password sign-up, sign-in/out, change password, delete account (#18)
- API (api/src/auth.ts): scrypt password hashes; random session tokens stored only as SHA-256;
  30-day sliding sessions; rate limits on sign-in (per IP and per email) and sign-up; changing the
  password signs out other devices; deleting the account removes its data.
- Site: /signup, /signin (returns to the page the reader came from), /account; header link; plain
  forms, no JavaScript needed. Session in an HTTP-only, SameSite=Lax cookie (Secure over HTTPS).
- CSRF: Astro's origin check, with the site's hostnames listed (SITE_HOSTS) so its own form posts
  pass and other sites' are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 22:53:51 +02:00
Anas Rashid
7fcc0ee7fa Word dictionary: full Wiktionary data for Urdu, Persian and Arabic in PostgreSQL, kept in sync
- en.wiktionary entries via kaikki.org (meanings, IPA, transliteration, audio, etymology, synonyms)
- ur./fa./ar.wiktionary dumps for meanings in each language (incl. more Urdu entry formats)
- English->Urdu pivot table from Urdu entries' glosses and ur.wiktionary's English entries
- dict-sync.ts: re-imports sources when upstream publishes new files, applies daily recent changes;
  run from deploy/sync.sh
- lookups now read the database (2-7 ms) instead of calling Wikimedia live

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:48:56 +02:00
Anas Rashid
ef618094d5 Word sidebar: select a word for its meanings and pronunciation from Wiktionary
Urdu, Persian and Arabic Wiktionaries in that order, each labelled; English meanings, IPA,
transliteration and audio from en.wiktionary; Urdu equivalents pivoted through English when Urdu
Wiktionary has no entry. Cached in PostgreSQL for 30 days. Left panel on wide screens, bottom
sheet on phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:38:10 +02:00
Anas Rashid
efb7aacde3 Search: highlighted matches, matching couplet or prose excerpt, exact phrase first; opened pages keep the highlight (?hl=)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:30:42 +02:00
Anas Rashid
13610569cc deploy/sync.sh: daily Wikisource -> divan-data -> PostgreSQL sync for the server
- updates a divan-data checkout, fetches new/edited works (incremental), rebuilds, upserts
  into Postgres; optional commit/push of data (DIVAN_DATA_PUSH=1); flock against overlap
- import prints progress only on a terminal
Validated locally: full run 1m46s, 382 poets / 11,087 poems imported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:00:15 +02:00
Anas Rashid
2f4344dcdf Remove the .NET stack; Divan is now Node.js + TypeScript + PostgreSQL
- delete RMuseum (API), DivanRazor (site), solution, Dockerfile/compose, SQL Server
  deploy/backup scripts, run-local.sh, archived upstream docs
- the .NET code stays available at tag dotnet-final
- README rewritten for v2; .gitignore for Node

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 20:30:03 +02:00
Anas Rashid
60f0791405 Divan v2: Astro site with Divan's own design (proof of concept)
- web/: server-rendered Astro over the Node API: home (poets by Hijri century), poet
  (intro + sections), category (numbered contents), poem (couplets, prev/next, source),
  search (paged); Naskh default with Nastaliq toggle, light/dark, Urdu digits, RTL, mobile
- api: section counts include nested categories
- README: how to run v2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 20:26:54 +02:00
Anas Rashid
3df43e4979 Backups, restore and rollback runbook (#10, #12)
- deploy/backup.sh / deploy/restore.sh (compose service or local container; side-by-side test restore)
- restore: chown copied backup for sqlservr, fail loudly on unreadable file list
- README: update, backup, test-restore and rollback steps

Validated locally: backup 194 MB, restored into a test DB with identical counts, test DB dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 00:27:31 +02:00
Anas Rashid
e78fc9bd99 Security pass (#11): no default JWT secret, CORS allow-list, Divan system emails
- appsettings: drop upstream's public JWT secret; API refuses to start outside Development without one
- Cors:AllowedOrigins (compose: https://SITE_DOMAIN); unset = any origin for local dev
- default admin/system/bot emails @divan.local instead of @ganjoor.net

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 00:26:01 +02:00
Anas Rashid
9bd445614e Urdu-aware search without SQL Server full-text (#3)
- MakeTextSearchable: Urdu letter variants, Urdu full stop, Urdu diacritics, zwj/marks
- SearchLikePatterns: phrase or per-word LIKE patterns (escaped), normalised like stored text
- poem, similar-poem and comment search use LIKE (Linux SQL Server image has no full-text)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 00:09:09 +02:00
Anas Rashid
90f07bf10e run-local.sh: one-command local stack (SQL Server container, API, site, optional import)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:57:40 +02:00
Anas Rashid
0ce63b2bc6 Static reader: single-file browser reader over the divan-data static API
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:53:00 +02:00
Anas Rashid
532d005cdb Rename Ganjoor -> Divan throughout the code
Projects (GanjooRazor -> DivanRazor, GanjoorService.sln -> DivanService.sln), files,
folders, classes, namespaces, settings, API routes (/api/divan) and DB tables (Divan*).
External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed
consistently (no pending model changes); requires a fresh database.
Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:49:01 +02:00
Anas Rashid
ecad9e9311 Remove Tajik: TajikGanjoor site, API, services, export, transliteration
- delete TajikGanjoor project (removed from solution)
- drop Tajik endpoints/services/DTOs/entities; migration DivanRemoveTajik drops their tables
- remove Tajik admin buttons/handlers and appsettings sections
- README is now Divan's; upstream README kept in docs/GANJOOR-README.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:37:39 +02:00
Anas Rashid
1811572d9e Divan: Urdu classical poetry fork of GanjoorService
- Rebrand گنجور -> دیوان across GanjooRazor; lang=ur; Urdu home page and footer
- Hijri century groups with Urdu names
- Noto Nastaliq Urdu (default) / Noto Naskh Arabic switch
- Remove footer links to Ganjoor-only services; link Wikisource, data and code
- Linux deployment: Dockerfile, docker-compose (SQL Server 2022, API, site, Caddy)
- DIVAN.md: changes and deploy guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:14:25 +02:00
Hamid Reza Mohammadi
1351679a21 ganjoor software changelog 2026-09-27 18:06:03 +03:30
Hamid Reza Mohammadi
e679ee8caa semantic search dev guide 2026-09-11 08:33:31 +03:30
Hamid Reza Mohammadi
25d36034d3 documents 2026-08-14 18:46:17 +03:30
Hamid Reza Mohammadi
f8a26835c0 improve UI/UX of the User Area
#496
2026-08-05 16:00:36 +03:30
Hamid Reza Mohammadi
ada2dc5028 improve UI/UX of the User Area
#496
2026-08-05 13:23:37 +03:30
Hamid Reza Mohammadi
575fe75fc5
Update README.md 2022-01-06 08:56:51 +03:30
Hamid Reza Mohammadi
335b03336b
Update README.md 2022-01-06 08:56:03 +03:30
Hamid Reza Mohammadi
c4620f5f85
Update README.md 2021-12-11 17:37:18 +03:30
Hamid Reza Mohammadi
7111fb2d89
Update README.md 2021-12-11 17:36:50 +03:30
Hamid Reza Mohammadi
ddbd43625a
Update README.md 2020-09-02 21:29:49 +04:30
Hamid Reza Mohammadi
9ca2d599ff
Update README.md 2020-09-02 21:25:26 +04:30
Hamid Reza Mohammadi
2c72ba7186
Update README.md 2020-08-30 11:20:42 +04:30
Hamid Reza Mohammadi
1b290e8562
Update README.md 2020-08-30 10:21:17 +04:30
Hamid Reza Mohammadi
7ea2cce28a
Update README.md 2020-08-14 21:28:03 +04:30
Hamid Reza Mohammadi
21a0d67c41
Create README.md 2020-08-14 21:24:25 +04:30