6a2d2c9724ae9cc85894abf12c434411f65f4f11
Simple Todo API (Monolith)
This project is a single backend service built with Gin.
The iam/ directory is kept as a separate scaffold module and is not part of the monolith build.
Run
go run ./cmd/server
The server listens on :8080.
Frontend
cd vue
npm install
npm run dev
The Vue app calls http://localhost:8080/api/v1 by default.
Quick Demo
curl http://localhost:8080/api/health
curl -X POST http://localhost:8080/api/v1/auth/register \
-H 'Content-Type: application/json' \
-d '{"email":"demo@example.com","password":"secret123"}'
curl -X POST http://localhost:8080/api/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"demo@example.com","password":"secret123"}'
curl -X POST http://localhost:8080/api/v1/tasks \
-H 'Authorization: Bearer demo' \
-H 'Content-Type: application/json' \
-d '{"title":"Learn Gin","priority":1,"tags":["demo"]}'
curl http://localhost:8080/api/v1/tasks \
-H 'Authorization: Bearer demo'
Notes
- Tasks and users are stored in PostgreSQL.
- Auth uses HMAC-signed bearer tokens with TTL (default 24h).
- Redis token cache is optional (
REDIS_ADDRnot set means disabled). - Kafka task event emit is optional (
KAFKA_BROKERSnot set means disabled).
Description
Languages
Go
35.2%
Vue
31.2%
TypeScript
21.1%
CSS
12%
HTML
0.5%