Go backend for the ONDC developer guide app. Built with Fiber, MongoDB, JWT auth, and OAuth2.
- Go 1.25+
- MongoDB (local or remote)
- OAuth2 client credentials for Github login
-
Clone and enter the repo
cd developer-guide -
Configure environment
Copy
.env.exampleto.env(or create.env) and set:Variable Description Default (dev) ENVdevelopmentorproductiondevelopmentPORTHTTP server port 8080MONGO_URIMongoDB connection string mongodb://localhost:27017DB_NAMEMongoDB database name developer_guide_dbJWT_SECRETSecret for signing JWTs — CLIENT_URLAllowed CORS origin (frontend) http://localhost:5173OAuth2 vars Client ID,Secret and Redirect URL — -
Run the server
go run main.go
Server listens at
http://localhost:8080(or the port you set inPORT).
main.go– Entry point, Fiber app, CORS, route setupsrc/config/– Config loading (e.g. from.env)src/database/– MongoDB connectionsrc/handlers/– Auth, notes, comments handlerssrc/middleware/– Auth middlewaresrc/models/– User, note, comment modelssrc/routes/– Route registrationsrc/utils/– JWT and helpers
See repository license.