A secure, RESTful backend service built with Python and Flask. This API allows users to manage their personal tasks with full CRUD functionality, protected by JWT (JSON Web Token) authentication.
- User Authentication: Secure Sign-up and Login system.
- JWT Security: Protected routes ensure users can only access their own data.
- Task Management: Full CRUD (Create, Read, Update, Delete) capabilities.
- Filtering: Fetch tasks by status (Completed/Pending) or category (Work, Personal, etc.).
- Database Integration: Lightweight and efficient data storage using SQLite.
| Technology | Purpose |
|---|---|
| Python | Primary Programming Language |
| Flask | Web Framework for API Development |
| SQLite | Relational Database |
| Flask-JWT-Extended | Authentication and Token Management |
| SQLAlchemy | ORM for Database Operations |
- Python 3.x installed.
uv(Python package manager).
- Clone the repository:
git clone https://github.com/pheonix-coder/task-manager-api.git
cd task-manager-api- Create a virtual environment:
uv venv- Install dependencies:
uv sync- Create .env:
mv .env.example .env- Run the application:
flask runThe API will be available at http://127.0.0.1:5000.
- Run the flask app with testing db:
DATABASE_URL=sqlite:///test.db uv run run.py- Run the test script in another terminal:
uv run test_api.py| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/signup |
Register a new user |
POST |
/api/auth/login |
Login and receive a JWT token |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/tasks |
Get all tasks for the logged-in user |
POST |
/api/tasks |
Create a new task |
GET |
/api/tasks/<id> |
Get details of a specific task |
PUT |
/api/tasks/<id> |
Update a task's title, description, or status |
DELETE |
/api/tasks/<id> |
Remove a task |
The API utilizes two main tables in SQLite:
- Users: Stores
id,username, andpassword_hash. - Tasks: Stores
id,title,description,category,status, anduser_id(Foreign Key).