How alan-00280/eventseat-pbl-uas works
EventSeat is a Go/Fiber REST backend whose implemented workflow is account registration and JWT-based authentication: API routes invoke auth services, which validate credentials and use repositories for user and refresh-token state in PostgreSQL. Middleware handles request policy and access-token checks; helpers provide validation, hashing, JWT, and response support. The README also describes event registration, ticketing, notifications, and feedback as product goals, but the available source excerpts show no corresponding runtime modules, so those subsystems are not represented as implemented. MongoDB and Redis/Asynq are documented or configured but not connected to a demonstrated product workflow.
Main entry points: auth_service.go Auth service · app.go Fiber server · main.go Application startup · postgres.go PostgreSQL pool
Components 25
HTTP API
- Fiber server
config/app.go - API routes
routes/routes.go - Request middleware
middleware/middleware.go - Auth middleware
middleware/auth.go
Identity workflow
- Auth service
app/service/auth_service.go - Auth models
app/model/auth.go - User model
app/model/user.go - Auth helpers
helper/security.go - JWT manager
helper/jwt.go - Request validation
helper/validator.go - Auth context
helper/context.go
Persistence
- User repository
app/repository/user_repo.go - Token repository
app/repository/token_repo.go - PostgreSQL pool
database/postgres.go - PostgreSQL
- MongoDB connection
database/mongo.go - MongoDB
Platform support
- Runtime config
config/env.go - Application startup
main.go - HTTP error models
app/model/errors.go - HTTP response models
app/model/http.go - Authorization rules
helper/authz.go - Redis task client
config/app.go - Redis
Other components
- API client
Connections 28
- API client → Fiber server: sends requests
README.md - Fiber server → Request middleware: registers middleware
config/app.go - Fiber server → API routes: registers routes
config/app.go - API routes → Auth service: dispatches auth
routes/routes.go - API routes → Auth middleware: guards routes
routes/routes.go - Auth middleware → JWT manager: parses token
middleware/auth.go - Auth middleware → Auth context: stores identity
middleware/auth.go - Auth service → User repository: reads and creates users
app/service/auth_service.go - Auth service → Token repository: rotates token state
app/service/auth_service.go - Auth service → JWT manager: issues access token
app/service/auth_service.go - Auth service → Request validation: validates input
app/service/auth_service.go - Auth service → Auth helpers: hashes credentials
app/service/auth_service.go - Auth service → Auth context: reads identity
app/service/auth_service.go - User repository → PostgreSQL pool: queries users
app/repository/user_repo.go - Token repository → PostgreSQL pool: stores refresh tokens
- PostgreSQL pool → PostgreSQL: connects pool
database/postgres.go - Application startup → Runtime config: loads settings
main.go - Application startup → PostgreSQL pool: creates pool
main.go - Application startup → Auth service: wires dependencies
main.go - Application startup → Fiber server: starts server
main.go - MongoDB connection → MongoDB: connects client
database/mongo.go - Application startup → MongoDB connection: initializes optional store
- Redis task client → Redis: configures client
config/app.go - Auth service → Auth models: parses auth requests
app/service/auth_service.go - Auth service → User model: uses user records
app/service/auth_service.go - Fiber server → HTTP error models: normalizes errors
config/app.go - Fiber server → HTTP response models: returns responses
config/app.go - Authorization rules → User model: checks actor identity
helper/authz.go