Automated Action f8bb3dd21d Implement Task Management Tool with FastAPI and SQLite
- Set up FastAPI project structure with API versioning
- Create database models for users and tasks
- Implement SQLAlchemy ORM with SQLite database
- Initialize Alembic for database migrations
- Create API endpoints for task management (CRUD)
- Create API endpoints for user management
- Add JWT authentication and authorization
- Add health check endpoint
- Add comprehensive README.md with API documentation
2025-06-02 20:40:57 +00:00
2025-06-02 20:29:46 +00:00

Task Management Tool

A FastAPI backend for managing tasks with user authentication and SQLite database.

Features

  • User registration and authentication with JWT tokens
  • Task management with CRUD operations
  • Task prioritization and status tracking
  • RESTful API with JSON responses
  • SQLite database with SQLAlchemy ORM
  • Database migrations with Alembic
  • Health check endpoint

API Endpoints

Health Check

  • GET /health - Check API health

User Management

  • POST /users/register - Register a new user
  • POST /users/login - Login and get access token
  • GET /users/me - Get current user info
  • PUT /users/me - Update current user info

Task Management

  • GET /tasks - List all tasks for current user
  • POST /tasks - Create a new task
  • GET /tasks/{task_id} - Get a specific task
  • PUT /tasks/{task_id} - Update a task
  • DELETE /tasks/{task_id} - Delete a task

Tech Stack

  • FastAPI - Modern, fast web framework for building APIs
  • SQLAlchemy - SQL toolkit and Object-Relational Mapping
  • Alembic - Database migration tool
  • Pydantic - Data validation and settings management
  • SQLite - Lightweight relational database
  • Python-Jose - JavaScript Object Signing and Encryption (JOSE) implementation
  • Passlib - Password hashing library

Setup and Installation

Prerequisites

  • Python 3.9+
  • pip (Python package installer)

Environment Setup

  1. Clone the repository:
git clone <repository-url>
cd taskmanagementtool
  1. Create and activate a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set environment variables (optional, defaults are provided):
export SECRET_KEY="your-secret-key"
export ACCESS_TOKEN_EXPIRE_MINUTES=30

Database Setup

  1. Run Alembic migrations to set up the database:
alembic upgrade head

Running the Application

  1. Start the FastAPI server:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
  1. Access the API documentation:

Development

Adding Migrations

When you modify the database models, create a new migration:

alembic revision --autogenerate -m "Description of changes"

Applying Migrations

To update your database to the latest schema:

alembic upgrade head

API Documentation

The API documentation is automatically generated and can be accessed at /docs or /redoc endpoints.

Description
Project: Task Management Tool
Readme 46 KiB
Languages
Python 98.3%
Mako 1.7%