chore: update project files

This commit is contained in:
2026-02-13 23:23:36 +08:00
parent 66e438978e
commit 6a2d2c9724
1361 changed files with 4298 additions and 5117 deletions

View File

@@ -1,29 +1,38 @@
# Simple Todo API (Demo) # Simple Todo API (Monolith)
This is a minimal, runnable RESTful API aligned with the plan. It uses Gin and an in-memory store. 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 ## Run
```bash ```bash
go run ./main.go go run ./cmd/server
``` ```
The server listens on `:8080`. The server listens on `:8080`.
## Frontend ## Frontend
The UI is served from local files under `test/web` at `/`:
```bash ```bash
open http://localhost:8080/api cd vue
npm install
npm run dev
``` ```
The Vue app calls `http://localhost:8080/api/v1` by default.
## Quick Demo ## Quick Demo
```bash ```bash
curl http://localhost:8080/api/health curl http://localhost:8080/api/health
curl -X POST http://localhost:8080/api/v1/auth/login 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 \ curl -X POST http://localhost:8080/api/v1/tasks \
-H 'Authorization: Bearer demo' \ -H 'Authorization: Bearer demo' \
@@ -35,5 +44,7 @@ curl http://localhost:8080/api/v1/tasks \
``` ```
## Notes ## Notes
- Data is in-memory only; restart will clear it. - Tasks and users are stored in PostgreSQL.
- Auth is a placeholder; any non-empty `Authorization` header is accepted. - Auth uses HMAC-signed bearer tokens with TTL (default 24h).
- Redis token cache is optional (`REDIS_ADDR` not set means disabled).
- Kafka task event emit is optional (`KAFKA_BROKERS` not set means disabled).

View File

@@ -0,0 +1 @@
18

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

View File

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

View File

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Some files were not shown because too many files have changed in this diff Show More