How sulte4/course-registration-platform works
This is a course-registration HTTP service with course and class management, user registration, class enrollment, and WebSocket class updates. The main workflow routes requests to handlers, which validate and delegate domain rules to the service layer; the repository persists records in PostgreSQL, and enrollment updates can be broadcast to connected clients. The graph also includes startup migrations and request identity handling. Source excerpts establish the main calls, but README documentation is absent and some repository code is only partially shown.
Main entry points: main.go Server startup · service.go Registration service · handlers.go HTTP handlers · db.go SQL repository
Components 11
HTTP API
- Server startup
main.go - HTTP handlers
handlers.go - Request identity
middleware.go
Domain Services
- Registration service
service.go - Domain models
models.go
Persistence
- SQL repository
db.go - PostgreSQL
- Schema migrations
migrations
Realtime Updates
- Realtime service
realtime_service.go - WebSocket hub
ws_hub.go
Other components
- API client
Connections 15
- API client → Server startup: sends requests
main.go - Server startup → HTTP handlers: routes requests
main.go - Server startup → Request identity: wraps stream
main.go - HTTP handlers → Registration service: calls
handlers.go - Registration service → SQL repository: reads and writes
service.go - SQL repository → PostgreSQL: queries
db.go - Server startup → Schema migrations: runs migrations
main.go - Registration service → Domain models: creates models
service.go - SQL repository → Domain models: scans records
db.go - HTTP handlers → Realtime service: wires connections
handlers.go - HTTP handlers → Registration service: streams classes
handlers.go - Registration service → Realtime service: publishes updates
service.go - Realtime service → WebSocket hub: registers and broadcasts
realtime_service.go - Server startup → WebSocket hub: starts hub
main.go - WebSocket hub → API client: sends WebSocket messages
ws_hub.go