Skip to content

Rebuild website with Astro, derive everything from arabterm.db#10

Merged
forzagreen merged 5 commits into
mainfrom
refactor/website-astro
May 13, 2026
Merged

Rebuild website with Astro, derive everything from arabterm.db#10
forzagreen merged 5 commits into
mainfrom
refactor/website-astro

Conversation

@forzagreen
Copy link
Copy Markdown
Owner

@forzagreen forzagreen commented May 13, 2026

Summary

Replaces the Angular SPA + 42 committed JSON dictionary files at website/ with a small Astro static site that reads arabterm.db directly at build time via better-sqlite3. The site is purely a static index + paginated term tables + per-dictionary JSON downloads; live search is delegated to wikitermbase ("مسرد الويكي").

  • All 53 dictionaries are now rendered (previously only 39 arabterm_*).
  • Big dictionaries paginated at 1000 terms / page — unified_medical_dictionary builds 133 pages, al_mawrid_al_hadeeth 63, etc. Total ~492 static pages built in ~21 s.
  • Per-dictionary JSON downloads generated into dist/ at build time. No JSON committed.
  • Legacy URLs preserved — the 39 unprefixed slugs from the original Angular site (e.g. /water_engineering/) are emitted as static meta-refresh redirects to the canonical /arabterm_water_engineering/. List lives in LEGACY_SLUGS in website/src/lib/db.ts.
  • GH Pages workflow simplifiednpm run build, upload website/dist/, no more 404.html SPA shim.

Cleanup

  • Deleted /data/ (42 MB of unused CSVs from the original 2022 scrape).
  • Removed /exports/ (was already gitignored).
  • arabterm.db is now the single source of truth for everything the site renders.

Test plan

  • CI: gh-pages.yml workflow builds and deploys successfully on this branch
  • Visit deploy preview, confirm home lists 53 dictionaries in one combined table
  • Open /arabterm_water_engineering/, click through pages 2/9
  • Open /unified_medical_dictionary/page/133/ (last page of the big one)
  • Open /water_engineering/ directly — must redirect to /arabterm_water_engineering/
  • Click "تنزيل JSON" — downloads the dictionary's terms.json
  • Click "بحث في مسرد الويكي" — opens wikitermbase
  • Verify RTL + Noto Naskh Arabic rendering on Chrome and Safari

🤖 Generated with Claude Code

Replaces the Angular SPA + 42 committed JSON files with an Astro static
site that reads arabterm.db at build time via better-sqlite3.

Highlights:
- All 53 dictionaries are now rendered (previously only 39 arabterm_*).
- Big dictionaries are paginated (1000 terms / page) — unified_medical
  builds 133 pages, etc. Total ~492 static pages.
- Per-dictionary JSON download endpoints, no JSON checked into the repo.
- Legacy unprefixed URLs (e.g. /water_engineering/) are preserved as
  static meta-refresh redirects to the canonical /arabterm_water_engineering/.
  Legacy slug list lives in website/src/lib/db.ts (LEGACY_SLUGS).
- Live search delegated to wikitermbase (مسرد الويكي) via header link.
- GH Pages workflow simplified: npm run build, upload website/dist/,
  no more 404.html SPA shim.

Cleanup:
- Deleted /data/ (42MB of unused CSVs) and /exports/ (gitignored, removed
  from disk). arabterm.db is the single source of truth.
- Removed old Angular tree, hardcoded dictionaries.ts, assets/*.json.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
actions/configure-pages v5 → v6
actions/upload-pages-artifact v3 → v5
actions/deploy-pages v4 → v5

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move the JSON endpoint from /<name_tech>/terms.json to /<name_tech>.json
so that browsers save the file as e.g. unified_medical_dictionary.json
instead of terms.json. content-disposition headers aren't honored by
GitHub Pages, so the URL is the only reliable way to set the filename.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@forzagreen forzagreen merged commit 94767e0 into main May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant