How morozkoart/codecollab works
CodeCollab is presented as a collaborative-code-editor API, but the sampled runtime implements user registration, login, JWT authentication, and health checks; protected collaboration routes are explicitly TODO. The main workflow is an HTTP auth request through routing and validation to the auth service, then user persistence or credential verification and a token response. The graph covers the evidenced startup and auth layers; database repository internals and other unsampled features are not expanded into assumed flows.
Main entry points: services/auth.go Auth service · main.go Server startup · router.go V1 router · v1/auth.go Auth handlers
Components 14
HTTP runtime
- Server startup
backend/cmd/server/main.go - HTTP app
backend/internal/app/app.go - V1 router
backend/internal/api/http/v1/router.go - JSON responses
backend/pkg/response/response.go - Configuration
backend/internal/config/config.go
Authentication
- Auth handlers
backend/internal/api/http/v1/auth.go - JWT middleware
backend/internal/api/http/middleware/auth.go - Auth service
backend/internal/services/auth.go - JWT service
backend/pkg/jwt/jwt.go - Password checks
backend/pkg/password/password.go
User data
- User models
backend/internal/domain/user.go - User repository
backend/internal/repository/user.go - PostgreSQL
Other components
- API client
Connections 16
- API client → HTTP app: HTTP requests
- HTTP app → V1 router: dispatches
- V1 router → Auth handlers: routes auth
- V1 router → JWT middleware: protects routes
- Auth handlers → Auth service: calls
- Auth handlers → JSON responses: writes responses
- Auth service → User repository: reads and writes users
- Auth service → Password checks: checks password
- Auth service → JWT service: generates token
- JWT middleware → JWT service: validates token
- Server startup → Configuration: loads settings
- Server startup → PostgreSQL: connects
- Server startup → User repository: constructs
- Server startup → Auth service: constructs
- Server startup → HTTP app: starts and stops
- Auth service → User models: uses user models