maniyakhan/todo-stack
0
Todo Full-Stack Web Application
A secure, multi-user todo management application built with Next.js, FastAPI, and Neon PostgreSQL.
Features
- User registration and authentication with JWT tokens
- Secure todo management with user isolation
- Responsive web interface
- RESTful API endpoints
- Modern tech stack with Next.js 16+ and FastAPI
Tech Stack
- Frontend: Next.js 16+ with App Router
- Backend: Python FastAPI
- Database: Neon Serverless PostgreSQL
- ORM: SQLModel
- Authentication: Better Auth with JWT
Prerequisites
- Node.js 18+
- Python 3.11+
- PostgreSQL (or use Docker Compose)
Setup
- Clone the repository
- Install dependencies:
cd backend
pip install -r requirements.txt
cd ../frontend
npm install- Set up environment variables (copy
.env.exampleto.env) - Start the development servers:
# Terminal 1: Start backend
cd backend
uvicorn src.main:app --reload
# Terminal 2: Start frontend
cd frontend
npm run devAPI Endpoints
Authentication
POST /api/auth/signup- Register new userPOST /api/auth/signin- Login userPOST /api/auth/signout- Logout user
Todo Management
GET /api/todos- Get all user's todosPOST /api/todos- Create new todoGET /api/todos/{id}- Get specific todoPUT /api/todos/{id}- Update todoPATCH /api/todos/{id}/complete- Toggle completionDELETE /api/todos/{id}- Delete todo
Environment Variables
DATABASE_URL: PostgreSQL connection stringSECRET_KEY: Secret key for JWT signingBETTER_AUTH_SECRET: Secret for Better AuthNEXT_PUBLIC_API_URL: Frontend API URL
Running with Docker
docker-compose up --buildThe application will be available at:
- Frontend: http://localhost:3000
- Backend: http://localhost:8001
- Health check: http://localhost:8000/health
