
This commit includes: - Project structure and configuration - Database models for tasks, users, and categories - Authentication system with JWT - CRUD endpoints for tasks and categories - Search, filter, and sorting functionality - Health check endpoint - Alembic migration setup - Documentation
3.2 KiB
3.2 KiB
Task Management Tool
A robust task management application built with FastAPI and SQLite. The application allows users to create, organize, and track tasks with categories, priorities, and due dates.
Features
- 🔐 User authentication (register, login)
- ✅ Task management (create, read, update, delete)
- 🏷️ Categories for organizing tasks
- 🔍 Search, filter, and sorting functionality
- 🎯 Priority levels for tasks
- 📅 Due dates for tasks
- 🔄 Task completion status tracking
Technology Stack
- Backend: FastAPI
- Database: SQLite with SQLAlchemy ORM
- Authentication: JWT with OAuth2
- Migration: Alembic
- Validation: Pydantic
- Code Quality: Ruff
Getting Started
Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
Installation
- Clone the repository:
git clone <repository-url>
cd taskmanagementtool
- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a .env file based on .env.example:
cp .env.example .env
- Run database migrations:
alembic upgrade head
Running the Application
Start the server with uvicorn:
uvicorn main:app --reload
The API will be available at http://localhost:8000
API Documentation
Once the server is running, you can access:
- Interactive API documentation: http://localhost:8000/docs
- Alternative API documentation: http://localhost:8000/redoc
- OpenAPI schema: http://localhost:8000/openapi.json
API Endpoints
Authentication
POST /api/v1/auth/register
- Register a new userPOST /api/v1/auth/login
- Login and get access token
Users
GET /api/v1/users/me
- Get current user infoPUT /api/v1/users/me
- Update current user info
Tasks
GET /api/v1/tasks
- List all tasksPOST /api/v1/tasks
- Create a new taskGET /api/v1/tasks/{task_id}
- Get a specific taskPUT /api/v1/tasks/{task_id}
- Update a taskDELETE /api/v1/tasks/{task_id}
- Delete a task
Categories
GET /api/v1/categories
- List all categoriesPOST /api/v1/categories
- Create a new categoryGET /api/v1/categories/{category_id}
- Get a specific categoryPUT /api/v1/categories/{category_id}
- Update a categoryDELETE /api/v1/categories/{category_id}
- Delete a category
Health Check
GET /health
- Check application health status
Environment Variables
Variable | Description | Default |
---|---|---|
SECRET_KEY | Secret key for JWT token generation | (See .env.example) |
ALGORITHM | Algorithm used for JWT | HS256 |
ACCESS_TOKEN_EXPIRE_MINUTES | Token expiration time in minutes | 30 |
BACKEND_CORS_ORIGINS | List of allowed CORS origins | [] |
Database Structure
The application uses three main database models:
- User - Stores user information
- Task - Stores task details with references to users and categories
- Category - Stores category information with references to users
License
This project is licensed under the MIT License - see the LICENSE file for details.