How anthony20602/mokhtar_forms_app works
Mokhtar Forms is a local-network registry and certificate-issuing web app for a mukhtar’s office. Staff search and maintain villagers, optionally import people from Excel, then create, save, reopen, and print one of 15 forms; documents receive yearly serial numbers. The map follows the browser/API/service/database boundaries and highlights import, form definitions, settings, and printing. README capability descriptions and the source index support some unsampled route links; those links are marked dashed where implementation details were not excerpted.
Main entry points: api API routes · client.ts API client · db.ts PostgreSQL access · documents.ts Saved documents
Components 24
Browser experience
- Office pages
src/app/(app) - People screens
src/frontend/components/persons - Document editor
src/frontend/components/documents/DocumentEditor.tsx - Excel import UI
src/frontend/components/persons/PersonImport.tsx - Settings form
src/frontend/components/settings/SettingsForm.tsx - API client
src/frontend/api/client.ts
API and access
- API routes
src/app/api - HTTP errors
src/backend/api/http.ts - Input validation
src/backend/api/validation.ts - Password sessions
src/backend/auth/auth.ts
Registry and documents
- People registry
src/backend/services/persons.ts - Excel import
src/backend/services/personImport.ts - Import rules
src/backend/services/personImportRules.ts - Saved documents
src/backend/services/documents.ts - Office settings
src/backend/services/settings.ts - Arabic normalization
src/shared/arabic.ts
Forms and printing
- Form catalog
src/shared/forms/registry.ts - Certificate letters
src/shared/forms/letter.ts - Residence template
src/shared/forms/residence.ts - Print controls
src/frontend/components/documents/PrintToolbar.tsx - PDF and printers
src/backend/services/printing.ts
Persistence
- PostgreSQL access
src/backend/database/db.ts
Other components
- Office staff
- PostgreSQL
Connections 32
- Office staff → Office pages: uses
README.md - Office pages → People screens: opens
src/app/(app)/page.tsx - Office pages → Document editor: opens
- People screens → API client: requests
src/frontend/components/persons/PersonSearch.tsx - Document editor → API client: requests
src/frontend/components/documents/DocumentEditor.tsx - Excel import UI → API client: uploads
- Settings form → API client: requests
src/frontend/components/settings/SettingsForm.tsx - API client → API routes: fetches
src/frontend/api/client.ts - API routes → HTTP errors: wraps handlers
src/app/api/documents/route.ts - API routes → Input validation: validates input
src/app/api/documents/route.ts - API routes → Saved documents: calls
src/app/api/documents/route.ts - API routes → People registry: calls
src/app/api/persons/route.ts - API routes → Excel import: calls
src/app/api/persons/import/preview/route.ts - API routes → Office settings: calls
src/app/api/settings/route.ts - API routes → Password sessions: checks credentials
src/app/api/auth/login/route.ts - Excel import → Import rules: uses rules
src/backend/services/personImport.ts - People registry → Arabic normalization: normalizes names
src/backend/services/persons.ts - Saved documents → Arabic normalization: normalizes search
src/backend/services/documents.ts - API routes → PDF and printers: requests print or PDF
src/app/api/documents/[id]/pdf/route.ts - API routes → Saved documents: loads print document
src/app/api/documents/[id]/pdf/route.ts - Print controls → API routes: requests print
- Form catalog → Certificate letters: defines letters
src/shared/forms/registry.ts - Form catalog → Residence template: defines template
src/shared/forms/registry.ts - Document editor → Form catalog: selects form
src/frontend/components/documents/DocumentEditor.tsx - PDF and printers → Password sessions: creates print token
src/backend/services/printing.ts - People registry → PostgreSQL access: queries
src/backend/services/persons.ts - Saved documents → PostgreSQL access: queries and writes
src/backend/services/documents.ts - Excel import → PostgreSQL access: reads and imports
src/backend/services/personImport.ts - Office settings → PostgreSQL access: queries
src/backend/services/settings.ts - PostgreSQL access → PostgreSQL: connects
src/backend/database/db.ts - Office staff → Excel import UI: imports workbook
README.md - Office staff → Print controls: prints or downloads
README.md