Initial commit

This commit is contained in:
diyaa
2026-11-11 20:25:21 +01:00
commit 311f19f9d2
48 changed files with 1391 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
# Tasks
One file per task. Status values: `todo`, `in progress`, `done`. Mark `done` only when verified. Update the task file and this index together.
## Phase 0: Verification and decisions
| ID | Title | Status |
| --- | --- | --- |
| [T-001](T-001-verify-server-state.md) | Verify the server and DNS | in progress |
| [T-002](T-002-research-open-sources.md) | Research openly licensed Quran sources | in progress |
| [T-003](T-003-choose-data-sources.md) | Choose translations and reciters | todo |
| [T-004](T-004-api-design.md) | Design the public API | todo |
| [T-005](T-005-decide-open-questions.md) | Decide the open product questions | todo |
## Phase 1: Foundation
| ID | Title | Status |
| --- | --- | --- |
| [T-006](T-006-scaffold-repo.md) | Create the web and api projects | todo |
| [T-007](T-007-compose-and-traefik.md) | Docker Compose and Traefik files | todo |
| [T-008](T-008-database-schema.md) | Database schema and migrations | todo |
| [T-009](T-009-open-data-import.md) | Import the open-source data | todo |
| [T-010](T-010-qf-content-sync.md) | Quran Foundation Content Sync (internal zone) | todo |
## Phase 2: Reading
| ID | Title | Status |
| --- | --- | --- |
| [T-011](T-011-surah-list.md) | Surah list page | todo |
| [T-012](T-012-reader.md) | Verse-by-verse reader | todo |
| [T-013](T-013-translation-selection.md) | Translation selection and author display | todo |
| [T-014](T-014-tafsir-panel.md) | Tafsir panel | todo |
| [T-015](T-015-search.md) | Search | todo |
| [T-016](T-016-i18n-rtl.md) | Localization and right-to-left | todo |
| [T-017](T-017-audio-player.md) | Audio player | todo |
| [T-018](T-018-local-library.md) | Favorites, bookmarks and notes in the browser | todo |
| [T-019](T-019-daily-reminder.md) | Daily reminder (decide and build if possible) | todo |
## Phase 3: Public API
| ID | Title | Status |
| --- | --- | --- |
| [T-020](T-020-api-keys.md) | API keys | todo |
| [T-021](T-021-rate-limits.md) | Rate limits and usage counters | todo |
| [T-022](T-022-public-endpoints.md) | Public API endpoints | todo |
| [T-023](T-023-openapi-docs.md) | OpenAPI document and developer page | todo |
| [T-024](T-024-usage-logging.md) | Minimal logging and abuse monitoring | todo |
## Phase 4: Release
| ID | Title | Status |
| --- | --- | --- |
| [T-025](T-025-security-pass.md) | Security pass | todo |
| [T-026](T-026-accessibility-performance.md) | Accessibility and performance pass | todo |
| [T-027](T-027-backups.md) | Backups and restore test | todo |
| [T-028](T-028-deploy-and-verify.md) | Deploy to quran.diyaa.de and verify | todo |
| [T-029](T-029-launch-checklist.md) | Launch checklist | todo |
| [T-030](T-030-legal-revisit.md) | Reopen the legal question before opening the API to others | todo |
+21
View File
@@ -0,0 +1,21 @@
# T-001: Verify the server and DNS
| Field | Value |
| --- | --- |
| Status | in progress |
| Phase | Phase 0: Verification and decisions |
| Depends on | - |
## Description
Check the facts in docs/architecture.md (Server) on the real server: DNS for quran.diyaa.de, Traefik version, network traefik-net, entrypoints, certificate resolver, firewall, free disk and memory. The server may have been rebuilt since August 2026.
## Done when
Results with the date written in docs/architecture.md; every difference listed and the owner told.
## Notes
Commands are listed in docs/architecture.md. Also check the provider's own firewall.
2026-11-11: DNS and host checks are recorded in `docs/architecture.md`. The provider firewall remains unverified because access to the provider account was not available. Do not mark this task done until it has been checked.
+21
View File
@@ -0,0 +1,21 @@
# T-002: Research openly licensed Quran sources
| Field | Value |
| --- | --- |
| Status | in progress |
| Phase | Phase 0: Verification and decisions |
| Depends on | - |
## Description
Find sources for the Arabic text, translations (de, en, es, ar, tr), tafsir and audio whose license allows redistribution through an API. For each: license text, redistribution and attribution rules, format, completeness, who maintains it. Also verify against the Quran Foundation Content API what is available per language (tafsir, audio, timings, file sizes) and whether showing that content on the website is covered by its terms.
## Done when
docs/decisions.md Sources table filled with license, link, date checked and attribution text; gaps per language listed.
## Notes
Do not rely on memory for licenses; read the live pages and record the date. Public Quran.com findings are not verified against the Content API.
2026-11-11: Initial source research and unresolved coverage are recorded in `docs/decisions.md` and `docs/source-research.md`. Production Content API catalogs, actual audio coverage and provider-specific permissions remain unverified. Finish those checks and close the listed source gaps before marking this task done.
+19
View File
@@ -0,0 +1,19 @@
# T-003: Choose translations and reciters
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 0: Verification and decisions |
| Depends on | T-002 |
## Description
Pick one well-known translation per language (de, en, es, ar, tr) and the first reciters. Decide per item whether it lives in the qf or the open zone.
## Done when
Translations and Reciters tables in docs/decisions.md filled with resource, author, zone and reason.
## Notes
No AI translation. The owner can change defaults later.
+19
View File
@@ -0,0 +1,19 @@
# T-004: Design the public API
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 0: Verification and decisions |
| Depends on | T-002 |
## Description
Turn the proposed API in docs/architecture.md into a final design: endpoints, response shapes, paging, error format, versioning, key format and header, rate-limit headers, CORS.
## Done when
Final API design in docs/architecture.md and an OpenAPI skeleton agreed with the owner.
## Notes
Every translation or tafsir response carries author, source and license.
+19
View File
@@ -0,0 +1,19 @@
# T-005: Decide the open product questions
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 0: Verification and decisions |
| Depends on | - |
## Description
Close the open questions in docs/decisions.md: package manager, developer signup, rate limits, reminder scope, design feel, riwaya, donations, Arabic folding, stored developer data, deadline.
## Done when
Each question is answered and moved into the Decided table with a reason.
## Notes
Discuss with the owner one question at a time.
+19
View File
@@ -0,0 +1,19 @@
# T-006: Create the web and api projects
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 1: Foundation |
| Depends on | T-005 |
## Description
Create web/ (Next.js, TypeScript) and api/ (NestJS, TypeScript) with lockfiles and the npm scripts build, lint, typecheck and test. Set the global API prefix /api and a health endpoint.
## Done when
make build PACKAGE_ONLY=1 and make test pass on a clean checkout.
## Notes
Package manager from T-005. Placeholders in COMMANDS_AGENT.md replaced.
+19
View File
@@ -0,0 +1,19 @@
# T-007: Docker Compose and Traefik files
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 1: Foundation |
| Depends on | T-001, T-006 |
## Description
Create deploy/docker-compose.yml with quran-web, quran-api and quran-db following docs/architecture.md, Dockerfiles for web and api, and deploy/.env.example. No ports: on any service.
## Done when
Compose file validates (docker compose config); invariant check passes; labels match the template.
## Notes
Router and service names must be unique on the server. Do not deploy here (T-028).
+19
View File
@@ -0,0 +1,19 @@
# T-008: Database schema and migrations
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 1: Foundation |
| Depends on | T-006, T-003 |
## Description
Create the qf_ and open_ content tables, the API tables and indexes with migrations. Separate import code per zone.
## Done when
Migrations run on a fresh database; tests cover creation and the zone separation.
## Notes
Follow docs/architecture.md data model.
+19
View File
@@ -0,0 +1,19 @@
# T-009: Import the open-source data
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 1: Foundation |
| Depends on | T-008, T-003 |
## Description
Write the import for the chosen open sources into open_ tables with author, source and license stored. Verify the Arabic text: 114 chapters and 6,236 verses, no changes to the text.
## Done when
Import is repeatable; counts and checksums verified; a sample of verses compared by a person.
## Notes
The Quran text is never altered; normalization only in the search column.
+19
View File
@@ -0,0 +1,19 @@
# T-010: Quran Foundation Content Sync (internal zone)
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 1: Foundation |
| Depends on | T-008, T-002 |
## Description
Implement bootstrap, snapshots, incremental sync, token handling and a scheduled sync at least every 7 days into qf_ tables. Keep prelive and production tokens and caches separate. Show the last sync time in an internal status endpoint.
## Done when
First sync fills qf_ tables; a second sync applies only changes; tests cover the mutation types; an alert exists when the last sync is older than 7 days.
## Notes
Credentials only from the server env. Never print token or secret values.
+19
View File
@@ -0,0 +1,19 @@
# T-011: Surah list page
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-009 |
## Description
Home page and surah list with names in the five languages.
## Done when
All 114 chapters listed, links work, layout correct in right-to-left and left-to-right.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-012: Verse-by-verse reader
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-009, T-011 |
## Description
Reader page /surah/{n}: each verse with the exact Arabic text and one translation underneath. Right-to-left Arabic with left-to-right translation on the same page.
## Done when
All surahs render from the database; Arabic text matches the source exactly; keyboard and screen-reader checked.
## Notes
Never alter the Quran text.
+19
View File
@@ -0,0 +1,19 @@
# T-013: Translation selection and author display
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-012, T-003 |
## Description
Let the reader pick a translation per language and always show the author and source.
## Done when
Choice persists in the browser; author visible on every page that shows a translation.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-014: Tafsir panel
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-012, T-002 |
## Description
Show the tafsir for the current verse in a side or bottom panel. Handle ranges (one entry can cover several verses). Languages without tafsir show a clear message or hide the button.
## Done when
Works with real data; empty states shown correctly.
## Notes
Depends on which languages have tafsir (T-002).
+19
View File
@@ -0,0 +1,19 @@
# T-015: Search
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-009 |
## Description
Search over the normalized Arabic column and the selected translation with PostgreSQL full-text search, plus surah names in several languages and spellings.
## Done when
Tests with real Arabic, German, Spanish and Turkish examples; results open the verse in the reader.
## Notes
Normalization is only for searching. Not in v1: tafsir search, verse-number search.
+19
View File
@@ -0,0 +1,19 @@
# T-016: Localization and right-to-left
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-012 |
## Description
Interface strings for German, English, Spanish, Arabic and Turkish; language switcher; right-to-left layout; a language registry so a sixth language needs data and strings only.
## Done when
Site runs in all five languages; layout checked in each; adding a test language needs no code change.
## Notes
Check fonts and text segmentation for non-Latin scripts later.
+19
View File
@@ -0,0 +1,19 @@
# T-017: Audio player
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-009, T-003 |
## Description
Web player with the reciter chosen by the reader, surah selection, next surah, repeat of a verse or range and a sleep timer. Media Session controls for lock screen and keys.
## Done when
Plays a surah with a chosen reciter on desktop and phone browsers; repeat and timer verified.
## Notes
Not in v1: verse highlighting, playback speed, offline download.
+19
View File
@@ -0,0 +1,19 @@
# T-018: Favorites, bookmarks and notes in the browser
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-012 |
## Description
Favorites (surahs, reciters, translations, tafsirs), several bookmarks with optional names, an automatic last-read position, plain-text notes on a verse and one-level folders. Store in IndexedDB with UUID and updatedAt per record. Provide export and import of this data as a file.
## Done when
Data persists across reloads; export and import round-trip; clear message that data lives only in this browser.
## Notes
No login. Records keep UUID and updatedAt so a later account sync is possible.
+19
View File
@@ -0,0 +1,19 @@
# T-019: Daily reminder (decide and build if possible)
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 2: Reading |
| Depends on | T-005 |
## Description
Decide whether a web reminder is feasible without an account (web push with a service worker and permission, or an installable page). Build it only if the decision says yes.
## Done when
Decision recorded in docs/decisions.md; if built, the notification arrives on a real browser and the permission is asked only when the reader turns it on.
## Notes
Do not promise reliable delivery.
+19
View File
@@ -0,0 +1,19 @@
# T-020: API keys
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 3: Public API |
| Depends on | T-004, T-008 |
## Description
Create, show once, hash (with a server pepper), rotate and revoke API keys. Signup flow decided in T-005.
## Done when
A key works until revoked; only the hash is stored; tests cover creation, use, rotation, revocation.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-021: Rate limits and usage counters
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 3: Public API |
| Depends on | T-020 |
## Description
Per-key limits per minute and per day, usage counters, rate-limit headers and clear error responses.
## Done when
Limits enforced and tested; headers present; counters visible to the owner.
## Notes
Values from T-005.
+19
View File
@@ -0,0 +1,19 @@
# T-022: Public API endpoints
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 3: Public API |
| Depends on | T-004, T-009, T-020 |
## Description
Implement the endpoints in docs/architecture.md under api/src/public/, reading only open_ tables. Attribution fields on every response.
## Done when
All endpoints return correct data; tests prove no qf_ data is reachable; invariant check passes.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-023: OpenAPI document and developer page
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 3: Public API |
| Depends on | T-022 |
## Description
Generate the OpenAPI document and build the /developers page with examples, limits, attribution requirements and how to get a key.
## Done when
A developer can follow the page and make a successful request.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-024: Minimal logging and abuse monitoring
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 3: Public API |
| Depends on | T-021 |
## Description
Log only what is needed to run and defend the API (key id, route, status, time). No reader activity, no IP storage beyond what rate limiting needs. Basic alerts for spikes and errors.
## Done when
Logs reviewed for secrets and personal data; alert fires in a test.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-025: Security pass
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 4: Release |
| Depends on | T-022 |
## Description
Security headers, strict Content Security Policy, CORS, request limits, dependency audit, secrets scan, error pages that leak nothing.
## Done when
Checklist run with the date and results; no secrets in git history.
## Notes
None yet.
@@ -0,0 +1,19 @@
# T-026: Accessibility and performance pass
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 4: Release |
| Depends on | T-018, T-017 |
## Description
Screen reader, keyboard, contrast, Dynamic text size, dark mode, right-to-left; Lighthouse and real-phone checks; caching of static data.
## Done when
Written results with devices and browsers; issues fixed or listed.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-027: Backups and restore test
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 4: Release |
| Depends on | T-007 |
## Description
Scheduled PostgreSQL backups stored off the server and a tested restore.
## Done when
A restore on a clean database succeeds and is recorded with the date.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-028: Deploy to quran.diyaa.de and verify
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 4: Release |
| Depends on | T-025, T-027 |
## Description
Only when the owner asks. Deploy the compose stack to /opt/quran-web, wait for the certificate, check the site and the API.
## Done when
curl -I https://quran.diyaa.de returns 200 or 302; GET /api/health works; the certificate is valid; results recorded.
## Notes
A 404 with a valid certificate means Traefik works and the app lacks the route.
+19
View File
@@ -0,0 +1,19 @@
# T-029: Launch checklist
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 4: Release |
| Depends on | T-028 |
## Description
Check sources and attributions on /about, the license table, the sync job, backups, monitoring, and that the public API serves no qf_ data in production.
## Done when
Checklist filled with the date; owner confirms launch.
## Notes
None yet.
+19
View File
@@ -0,0 +1,19 @@
# T-030: Reopen the legal question before opening the API to others
| Field | Value |
| --- | --- |
| Status | todo |
| Phase | Phase 4: Release |
| Depends on | - |
## Description
Only if the owner decides to give API keys to other people or publish widely: reopen docs/legal.md.
## Done when
The owner has decided what to do. Until then nothing is done and the task stays open.
## Notes
Owner decision of 2026-11-05: legal topics are not handled in this project.