CoolFace
Apppublic

Muniza-Nabeel/full-stack-todo-app

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
App README

๐Ÿ“ Todo Full-Stack Web Application - Backend API

A RESTful API for multi-user task management with JWT authentication.

๐Ÿš€ Features

  • โ€”โœ… User authentication (register, login, logout)
  • โ€”โœ… JWT-based authorization (7-day expiry)
  • โ€”โœ… CRUD operations for tasks
  • โ€”โœ… User-scoped task isolation
  • โ€”โœ… PostgreSQL database with migrations
  • โ€”โœ… FastAPI with automatic OpenAPI docs

๐Ÿ› ๏ธ Tech Stack

  • โ€”Framework: FastAPI 0.109.0
  • โ€”ORM: SQLModel 0.0.14
  • โ€”Database: PostgreSQL (Neon Serverless)
  • โ€”Authentication: JWT (python-jose)
  • โ€”Migration: Alembic 1.13.1

๐Ÿ“ก API Endpoints

Authentication

  • โ€”POST /api/auth/register - Register new user
  • โ€”POST /api/auth/login - Login user
  • โ€”POST /api/auth/logout - Logout user
  • โ€”GET /api/auth/me - Get current user

Tasks

  • โ€”GET /api/{user_id}/tasks - List user tasks
  • โ€”POST /api/{user_id}/tasks - Create task
  • โ€”GET /api/{user_id}/tasks/{task_id} - Get task
  • โ€”PUT /api/{user_id}/tasks/{task_id} - Update task
  • โ€”DELETE /api/{user_id}/tasks/{task_id} - Delete task
  • โ€”PATCH /api/{user_id}/tasks/{task_id}/complete - Toggle complete

๐Ÿ”ง Environment Variables

Required environment variables (set in Hugging Face Space settings):

env
DATABASE_URL=postgresql+asyncpg://user:password@host/db?sslmode=require
BETTER_AUTH_SECRET=your-secret-key-min-32-characters
ALLOWED_ORIGINS=https://your-frontend.vercel.app,http://localhost:3000
DEBUG=false

๐Ÿ“š API Documentation

Once deployed, visit:

  • โ€”Swagger UI: https://your-space.hf.space/docs
  • โ€”ReDoc: https://your-space.hf.space/redoc

๐Ÿฅ Health Check

GET /health - Returns {"status": "healthy"}

๐Ÿ”— Frontend Integration

This backend is designed to work with the Next.js 14+ frontend.

Update your frontend environment variable:

env
NEXT_PUBLIC_API_URL=https://your-space.hf.space

๐Ÿ“ License

MIT License

๐Ÿ‘จโ€๐Ÿ’ป Developer

Built with FastAPI and deployed on Hugging Face Spaces ๐Ÿค—