A full-stack web application with authentication and task management capabilities built using Next.js, FastAPI, and BetterAuth.
- User Authentication: Secure user registration and login with BetterAuth
- Task Management: Create, read, update, delete, and toggle completion of tasks
- User Isolation: Users can only access their own tasks
- Soft Deletion: Tasks are marked as deleted but retained for 30 days
- Responsive UI: Mobile-friendly interface built with Tailwind CSS
- JWT Authentication: Secure API access with JWT tokens
- RFC 7807 Error Handling: Standardized error responses
- Frontend: Next.js 16+, TypeScript, Tailwind CSS
- Backend: FastAPI, SQLModel, Python
- Database: PostgreSQL (via Neon)
- Authentication: BetterAuth with JWT tokens
- Styling: Tailwind CSS
/pages: Next.js pages router (auth pages, dashboard)/components: Reusable UI components (auth forms, task components)/services: Business logic (auth service, API client)/types: TypeScript type definitions
/api: API routes and middleware/models: Database models (User, Task)/services: Business logic (user service, task service, auth service)/database: Database session management
Create .env files in both frontend and backend:
Frontend (.env.local):
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:8000Backend (.env):
DATABASE_URL=postgresql://user:password@localhost/dbname
BETTER_AUTH_SECRET=your_secret_key
JWT_SECRET=your_jwt_secret-
Backend:
cd backend pip install -r requirements.txt uvicorn src.main:app --reload --port 8000 -
Frontend:
cd frontend npm install npm run dev
POST /api/users/register- Register new userPOST /api/users/login- Login user
GET /api/{user_id}/tasks- Get user's tasksPOST /api/{user_id}/tasks- Create new taskPUT /api/{user_id}/tasks/{task_id}- Update taskDELETE /api/{user_id}/tasks/{task_id}- Soft delete taskPATCH /api/{user_id}/tasks/{task_id}/toggle- Toggle task completionGET /api/{user_id}/tasks/deleted- Get soft-deleted tasks
- JWT token validation with required claims (sub, email, exp, iat)
- User isolation - users can only access their own resources
- Input validation and sanitization
- RFC 7807 Problem Details for error responses
- Rate limiting (planned)
The application follows RFC 7807 for error responses with standardized error formats:
{
"title": "Bad Request",
"status": 400,
"detail": "Task title exceeds maximum length of 255 characters"
}The project follows a spec-driven development approach with implementation tasks tracked in the specs directory. All components are tested for integration and functionality.
To run tests (when implemented):
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT