How jungo-dev/jungo works
Jungo is a Go web-application skeleton with a Gin API, Fx dependency wiring, sample authentication and user features, and a CLI for operating and extending the application. The main user workflow is an HTTP request routed through global middleware to feature endpoints; authentication issues and validates tokens, while protected user endpoints support user management. The README also documents console commands and feature/command scaffolding. Some feature wiring and optional integrations are unsampled, so uncertain relationships are omitted rather than inferred.
Main entry points: router.go HTTP router · kernel.go Console runtime · user_service.go User service · app.go API server
Components 27
Application runtime
- API server
internal/app/app.go - Fx assembly
internal/app/fx.go - HTTP router
internal/router/router.go - Application config
internal/config/config.go
Authentication
- Auth routes
internal/features/auth/router/v1/auth_router.go - Internal auth routes
internal/features/auth/router/private/auth_router.go - Auth HTTP handler
internal/features/auth/handler/v1/auth_handler.go - Auth service
internal/features/auth/service/auth_service.go - Auth domain
internal/features/auth/domain/auth.go - Auth repository
internal/features/auth/repository/auth_repository.go - Auth SQL queries
internal/database/sqlc/auth.sql.go - Session cache
internal/features/auth/infrastructure/session_cache.go - Login guard
internal/features/auth/infrastructure/login_guard.go
User management
- User routes
internal/features/user/router/v1/user_router.go - User HTTP handler
internal/features/user/handler/v1/user_handler.go - User service
internal/features/user/service/user_service.go - User domain
internal/features/user/domain/user.go - User repository
internal/features/user/repository/user_repository.go - User SQL queries
internal/database/sqlc/user.sql.go
Console and scaffolding
- Console runtime
internal/console/kernel.go - Health command
internal/console/commands/health_check_command.go - Create user command
internal/features/user/command/create_user_command.go - Token cleanup command
internal/features/auth/command/cleanup_tokens_command.go - Scaffold CLI
cmd/scaffold/main.go - Scaffold templates
cmd/scaffold/templates.go
Other components
- API client
- PostgreSQL
Connections 23
- API client → API server: sends request
- Fx assembly → HTTP router: registers routing
internal/app/fx.go - Fx assembly → API server: provides server
internal/app/fx.go - API server → HTTP router: serves through
internal/app/app.go - HTTP router → Auth routes: registers routes
internal/router/router.go - HTTP router → Internal auth routes: registers routes
internal/router/router.go - HTTP router → User routes: registers routes
internal/router/router.go - Auth routes → Auth HTTP handler: dispatches requests
internal/features/auth/router/v1/auth_router.go - Internal auth routes → Auth HTTP handler: dispatches requests
internal/features/auth/router/private/auth_router.go - Auth HTTP handler → Auth service: calls service
internal/features/auth/handler/v1/auth_handler.go - Auth service → Auth repository: uses repository
internal/features/auth/service/auth_service.go - Auth repository → Auth SQL queries: executes queries
internal/features/auth/repository/auth_repository.go - Auth SQL queries → PostgreSQL: queries
- User service → User repository: calls repository
internal/features/user/service/user_service.go - User service → Session cache: revokes sessions
internal/features/user/service/user_service.go - User routes → User HTTP handler: dispatches requests
- User HTTP handler → User service: calls service
- User repository → User SQL queries: executes queries
- User SQL queries → PostgreSQL: queries
- Console runtime → Health command: runs command
- Console runtime → Create user command: runs command
- Console runtime → Token cleanup command: runs command
- Scaffold CLI → Scaffold templates: renders templates
cmd/scaffold/templates.go