This directory is the runtime entrypoint for the bookings monolith.
- Application bootstrap (
main.go) - Runtime wiring (
run()) - HTTP router and route map (
routes.go) - Middleware stack (
middleware.go) - Mail listener/SMTP send worker (
send-mail.go)
main()callsrun().run():
- registers session-serializable types with
gob - reads runtime flags
- configures logs and SCS session manager
- connects to PostgreSQL
- builds template cache
- wires repository into handlers
- wires renderer/helpers with app config
main()starts mail listener goroutine.- HTTP server starts on
:8080withroutes(&app).
Configured in this order:
Recoverer(Chi)NoSurf(global CSRF protection)SessionLoad(load/save session per request)
Admin routes add:
Authmiddleware, requiringuser_idin session.
/,/about,/contact/generals-quarters,/majors-suite/search-availability(GET/POST)/search-availability-json(POST)/choose-room/{id},/book-room/make-reservation(GET/POST)/reservation-summary
/user/login(GET/POST)/user/logout
- dashboard
- new/all reservations lists
- reservation show/edit
- reservation process/delete actions
- reservation calendar and block management
- A goroutine continuously reads
app.MailChan. - Messages are sent via local SMTP (
localhost:1025) usinggo-simple-mail. - If
Templateis set, email body is rendered fromemail-templates/<template>and injected with content.
-db-nameand-db-userare required.-cachecontrols template-cache usage.-productiontoggles secure cookies and related runtime behavior.- Build script example exists in project root
run.sh.