How aamirnawaz/go_authentication_app works
This is a small Go/Fiber authentication API. Requests enter through Fiber routes and reach handlers for registration, login, logout, user lookup, or a placeholder user endpoint; authentication handlers use the MySQL-backed GORM store and the User model. The README identifies JWT authentication as the product capability, and the sampled controller shows cookie-based token issuance and lookup. MongoDB code is present but its connection is not invoked by the application startup, and the Mongo user route is only a placeholder. The graph reflects sampled code; no Mongo request-to-store flow is shown.
Main entry points: routes.go Route setup · authController.go Auth handlers · Connection.go GORM connection · main.go Application startup
Components 12
HTTP API
- Application startup
main.go - Route setup
routes/routes.go - User placeholder
controllers/authController.go - Mongo placeholder
controllers/m_authController.go
Authentication
- Auth handlers
controllers/authController.go - User model
models/user.go
MySQL persistence
- GORM connection
db/Connection.go - MySQL database
MongoDB integration
- Mongo connection
db/MongodbConnection.go - Mongo user model
models/m_user.go - MongoDB database
Other components
- HTTP client
Connections 11
- HTTP client → Route setup: sends requests
routes/routes.go - Application startup → GORM connection: connects
main.go - Application startup → Route setup: sets up
main.go - Route setup → User placeholder: routes to
routes/routes.go - Route setup → Auth handlers: routes to
routes/routes.go - Route setup → Mongo placeholder: routes to
routes/routes.go - Auth handlers → GORM connection: queries
controllers/authController.go - Auth handlers → User model: uses
controllers/authController.go - GORM connection → MySQL database: opens
db/Connection.go - Mongo connection → MongoDB database: connects
db/MongodbConnection.go - Mongo connection → Mongo user model: stores records