portfolio

Task Management API

A RESTful API built with FastAPI for managing tasks, projects, and user collaboration. Features JWT authentication, PostgreSQL database, and comprehensive API documentation.

Features

Technologies Used

Installation

pip install -r requirements.txt

Configuration

Create a .env file in the root directory:

DATABASE_URL=postgresql://user:password@localhost:5432/taskdb
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

Database Setup

# Initialize database
python init_db.py

Usage

Start the server:

python main.py

The API will be available at http://localhost:8000

API Documentation:

API Endpoints

Authentication

Tasks

Projects

Users

Example Usage

Register a user:

curl -X POST "http://localhost:8000/auth/register" \
  -H "Content-Type: application/json" \
  -d '{"username": "john", "email": "john@example.com", "password": "secret123"}'

Create a task:

curl -X POST "http://localhost:8000/tasks" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "Complete API", "description": "Finish the API implementation", "priority": "high"}'

Project Structure

Testing

pytest tests/

Future Enhancements