714 B
714 B
Tasks: foundation-auth
1. Backend skeleton
- Cargo workspace, vmall-api crate (axum, sqlx, redis, tower-http)
- Config from env (DATABASE_URL, REDIS_URL, JWT_SECRET, PORT)
- Health + readiness endpoints (db/redis checked)
- sqlx migrate on boot; 0001_init migration
2. Identity schema
- Migration: users, shops tables; role enum
- Seed platform admin (admin@vmall.local / admin1234)
3. Auth API
- POST /api/auth/register (customer role)
- POST /api/auth/login → JWT + user
- GET /api/auth/me (Bearer)
- Auth extractor + require_role guard
4. Tests
- cargo test: register/login/me happy path, wrong password, role guard denies customer on admin route