How fnuritdinov/namaztime works
nTime is a prayer-times and Islamic-calendar service, with city lookup, official timetable support, Hijri month and Ramadan data, and device registration/push preferences. The main request flow is an API request routed through Gin to handlers; prayer-time requests are resolved by the schedule service using city, official timetable, and Aladhan sources. Separate commands import or fetch official data. The README is empty, and several handler and server-wiring files were not sampled, so some likely links are marked unverified rather than asserted.
Main entry points: api.gen.go API operations · schedule/service.go Schedule service · hijrimonth/service.go Hijri month service · repository.go City lookup
Components 28
HTTP API
- HTTP server
cmd/server/server.go - Gin routes
cmd/server/routes.go - API operations
internal/handler/api.gen.go - Prayer handler
internal/handler/prayer_times.go - City handler
internal/handler/cities.go - Hijri handler
internal/handler/hijri.go - Device handler
internal/handler/device.go - Config handler
internal/handler/config.go
Prayer Schedules
- Schedule service
internal/schedule/service.go - City lookup
internal/city/repository.go - Official timetable
internal/official/repository.go - Aladhan client
internal/aladhan/client.go - Aladhan cache
internal/aladhan/cache.go - Prayer calculations
internal/prayertime/calc.go
Calendar Data
- Hijri calendar
internal/hijri/hijri.go - Hijri month service
internal/hijrimonth/service.go - Month records
internal/hijrimonth/repository.go
Device Management
- Device service
internal/device/service.go - Device records
internal/device/repository.go
Official Data Ingestion
- CSV import
cmd/import-timetable/main.go - Month import
cmd/hijri-month/main.go - Sync command
cmd/shuro-sync/main.go - Shuro client
internal/shuro/client.go - Shuro store
internal/shuro/store.go - Sync worker
internal/shuro/worker.go
Other components
- API client
- Postgres
- Shuro website
Connections 33
- API client → HTTP server: requests
- HTTP server → Gin routes: serves
- Gin routes → API operations: registers
cmd/server/routes.go - API operations → Prayer handler: dispatches
- API operations → City handler: dispatches
- API operations → Hijri handler: dispatches
- API operations → Device handler: dispatches
- API operations → Config handler: dispatches
- Prayer handler → Schedule service: requests schedule
- City handler → City lookup: searches cities
- Schedule service → City lookup: loads city
- Schedule service → Official timetable: loads timetable
- Schedule service → Aladhan cache: gets monthly times
- Aladhan cache → Aladhan client: fetches month
- Schedule service → Month records: loads month starts
- Schedule service → Postgres: reads
- City lookup → Postgres: queries
internal/city/repository.go - Official timetable → Postgres: queries
internal/official/repository.go - Hijri handler → Hijri month service: requests calendar data
- Hijri month service → Month records: loads months
- Hijri month service → Hijri calendar: calculates dates
- Month records → Postgres: reads
- Device handler → Device service: manages device
- Device service → Device records: stores device
- Device records → Postgres: reads and writes
- CSV import → Postgres: imports rows
- Month import → Postgres: saves month
cmd/hijri-month/main.go - Sync command → Shuro client: fetches month
cmd/shuro-sync/main.go - Sync command → Shuro store: saves month
cmd/shuro-sync/main.go - Shuro client → Shuro website: fetches timetable
internal/shuro/client.go - Shuro store → Postgres: writes
- Sync worker → Shuro client: syncs month
- Sync worker → Shuro store: stores results