Full-stack multi-user task management system with JWT authentication, built following Spec-Driven Development methodology.
hackathon-full-stack-template/
├── backend/ # FastAPI Python backend
│ ├── app/ # Application code
│ ├── alembic/ # Database migrations
│ ├── tests/ # Test suite
│ └── README.md # Backend setup guide
├── frontend/ # Next.js React frontend
│ ├── app/ # Next.js 16 App Router pages
│ ├── components/ # Reusable React components
│ ├── lib/ # Utilities (API client, auth)
│ ├── types/ # TypeScript interfaces
│ └── README.md # Frontend setup guide
├── specs/ # Feature specifications
│ └── 001-user-auth/ # Authentication feature spec
│ ├── spec.md # Requirements and user stories
│ ├── plan.md # Implementation plan
│ ├── tasks.md # Task breakdown
│ └── contracts/ # API contracts
├── .specify/ # SpecKit Plus templates
└── history/ # Prompt History Records (PHR)
- Framework: FastAPI 0.115+
- Database: Neon Serverless PostgreSQL
- ORM: SQLModel 0.0.22
- Migrations: Alembic 1.13+
- Auth: JWT (PyJWT 2.10+)
- Password: bcrypt 4.2+
- Python: 3.13+
- Framework: Next.js 16.0+ (App Router)
- UI: React 19
- Language: TypeScript (strict)
- Styling: Tailwind CSS v4
- Font: Inter (Google Fonts)
- Node: 20+
- Python 3.13+
- Node.js 20+
- UV package manager (
pip install uv) - Neon account (https://neon.tech)
# Clone repository
git clone <repo-url>
cd hackathon-full-stack-template
# Backend setup
cd backend
uv sync
cp .env.example .env
# Edit .env with your Neon DATABASE_URL and BETTER_AUTH_SECRET
# Frontend setup
cd ../frontend
npm install
cp .env.local.example .env.local
# Edit .env.local with matching BETTER_AUTH_SECRET
# Run migrations
cd ../backend
.venv/Scripts/alembic.exe upgrade headTerminal 1 - Backend:
cd backend
.venv/Scripts/uvicorn.exe app.main:app --reload --port 8001Terminal 2 - Frontend:
cd frontend
npm run dev- Frontend: http://localhost:3000
- Backend API Docs: http://localhost:8001/docs
- Health Check: http://localhost:8001/health
- ✅ User signup with email/password
- ✅ User signin with JWT token generation
- ✅ Session persistence (localStorage)
- ✅ Protected routes
- ✅ Secure signout
- ✅ Create tasks (title + description)
- ✅ View all tasks (user-scoped)
- ✅ Edit task details
- ✅ Toggle completion status
- ✅ Delete tasks
- ✅ User data isolation (strict security)
- ✅ View all users (admin only)
- ✅ Database statistics
- ✅ Delete users (admin only)
- ✅ Responsive design (mobile-first)
- ✅ Dark mode support
- ✅ Loading states
- ✅ Error handling
- ✅ Accessible (WCAG AA)
- ✅ Keyboard navigation
- JWT-based authentication
- Password hashing with bcrypt
- User data isolation (Constitutional Principle VIII)
- Generic error messages (prevent enumeration)
- CORS configured
- Admin role-based access
- Quick Start:
specs/001-user-auth/quickstart.md - Specification:
specs/001-user-auth/spec.md - Implementation Plan:
specs/001-user-auth/plan.md - Tasks:
specs/001-user-auth/tasks.md - Backend Setup:
backend/README.md - Frontend Setup:
frontend/README.md - Constitution:
.specify/memory/constitution.md
- Signup: Create account at
/auth/signup - Dashboard: View tasks (empty state initially)
- Add Task: Create first task
- CRUD: Edit, complete, delete tasks
- Signout: Logout
- Signin: Login again
- Verify: Tasks persisted
Use FastAPI interactive docs:
http://localhost:8001/docs
- Create 2+ accounts
- Verify data isolation
- Test cross-user access prevention (403 errors)
This project follows Spec-Driven Development (SDD):
- Constitution → Define project principles
- Specification → Define requirements (what to build)
- Plan → Design implementation (how to build)
- Tasks → Break down into actionable items
- Implement → Execute tasks
- Test → Verify against spec
- Document → Create PHR and ADR
/sp.constitution- Update project principles/sp.specify- Create feature specification/sp.plan- Generate implementation plan/sp.tasks- Generate task breakdown/sp.implement- Execute implementation/sp.phr- Create Prompt History Record/sp.adr- Document architectural decisions
Phase: Phase II (Full-Stack Web Application) Feature: 001-user-auth (Multi-User Authentication) Status: ✅ Implementation Complete (117/117 tasks)
- ✅ Phase 1: Setup (T001-T009)
- ✅ Phase 2: Foundational (T010-T020)
- ✅ Phase 3: User Story 1 - Signup (T021-T042)
- ✅ Phase 4: User Story 2 - Signin (T043-T061)
- ✅ Phase 5: User Story 5 - Isolation (T062-T079)
- ✅ Phase 6: User Story 3 - Signout (T080-T090)
- ✅ Phase 7: User Story 4 - Persistence (T091-T101)
- ✅ Phase 8: Dashboard (T102-T106)
- ✅ Phase 9: Polish (T107-T117)
- Database connection failed: Check DATABASE_URL, remove query params
- Import errors: Run
uv syncto reinstall dependencies - Migration errors: Verify alembic/env.py configuration
- Connection refused: Verify backend port matches NEXT_PUBLIC_API_URL
- Auth failed: Check BETTER_AUTH_SECRET matches backend
- Env not loading: Restart dev server after .env.local changes
See specs/001-user-auth/quickstart.md Section 15 for production deployment:
- Frontend: Vercel
- Backend: Render
- Database: Neon (already cloud-hosted)
Hackathon Project - Internal Use
Follow constitutional principles in .specify/memory/constitution.md
For detailed setup instructions, see:
- Backend:
backend/README.md - Frontend:
frontend/README.md - Quick Start:
specs/001-user-auth/quickstart.md