How abuba111/openwatermap works
OpenWaterMap is a water-quality mapping and community reporting service. Users browse approved water points and their measurements; authenticated contributors submit or update points, while trusted reviewers verify pending submissions. The backend also supports account and role management, comments, and photo/certificate uploads. The graph follows the HTTP routes and calls shown in the sampled entrypoint and handlers. Some handler/database operations are omitted from excerpts, so their connections are not inferred; the README supplied no capability details.
Main entry points: main.go HTTP routing · sqlite.go PostgreSQL access · auth.go Account endpoints · media.go Comments and uploads
Components 15
API runtime
- HTTP routing
openwatermap/backend/main.go - Health check
openwatermap/backend/handlers/health.go - Runtime config
openwatermap/backend/config/config.go
Water reporting
- Point endpoints
openwatermap/backend/handlers/water.go - Water rules
openwatermap/backend/models/water.go
Identity and access
- Account endpoints
openwatermap/backend/handlers/auth.go - JWT and roles
openwatermap/backend/handlers/auth_middleware.go - User and roles
openwatermap/backend/models/user.go
Community media
- Comments and uploads
openwatermap/backend/handlers/media.go - Comment and photo data
openwatermap/backend/models/comment.go
Persistence
- PostgreSQL access
openwatermap/backend/database/sqlite.go - User records
openwatermap/backend/database/users.go - Comments and photo records
openwatermap/backend/database/comments.go - Schema migrations
openwatermap/backend/database/migrate.go
Other components
- Map users
Connections 19
- Map users → HTTP routing: calls API
openwatermap/backend/main.go - HTTP routing → Runtime config: loads settings
openwatermap/backend/main.go - HTTP routing → PostgreSQL access: opens database
openwatermap/backend/main.go - HTTP routing → Point endpoints: routes points
openwatermap/backend/main.go - HTTP routing → Account endpoints: routes auth
openwatermap/backend/main.go - HTTP routing → Comments and uploads: routes media
openwatermap/backend/main.go - HTTP routing → Health check: routes health
openwatermap/backend/main.go - HTTP routing → JWT and roles: applies guards
openwatermap/backend/main.go - Point endpoints → PostgreSQL access: reads and writes
openwatermap/backend/handlers/water.go - Point endpoints → Water rules: validates points
openwatermap/backend/handlers/water.go - Account endpoints → PostgreSQL access: reads and writes
openwatermap/backend/handlers/auth.go - Account endpoints → JWT and roles: issues tokens
openwatermap/backend/handlers/auth.go - Account endpoints → User and roles: uses account types
openwatermap/backend/handlers/auth.go - JWT and roles → User and roles: checks roles
openwatermap/backend/handlers/auth_middleware.go - Comments and uploads → Comments and photo records: reads and writes
openwatermap/backend/handlers/media.go - Comments and uploads → Comment and photo data: validates payloads
openwatermap/backend/handlers/media.go - Comments and uploads → Map users: serves uploaded files
- PostgreSQL access → Schema migrations: runs migrations
- User records → PostgreSQL access: uses database connection