A modern asynchronous task management REST API built with FastAPI, SQLAlchemy, and JWT Authentication.
Secure user authentication, task management, and user-specific task tracking with a fully asynchronous backend architecture.
Features • Quick Start • API Docs • Endpoints • Roadmap
- JWT Authentication
- OAuth2 Password Flow
- Protected endpoints
- User-specific data access
- Create, read, update, and delete tasks
- Partial updates using
PATCH - Task completion tracking
- User-owned task isolation
- Fully asynchronous architecture
- FastAPI framework
- Async SQLAlchemy ORM
- SQLite with
aiosqlite
| Layer | Technology |
|---|---|
| Framework | FastAPI |
| Language | Python 3.12 |
| ORM | SQLAlchemy (Async) |
| Database | SQLite |
| Authentication | JWT + OAuth2 |
| ASGI Server | Uvicorn |
| Package Manager | uv |
git clone https://github.com/syswitzz/task-tracker-api.git
cd task-tracker-apiuv syncCreate a .env file:
SECRET_KEY=your_secret_key
ACCESS_TOKEN_EXPIRE_MINUTES=30
ALGORITHM=HS256Generate a secure key:
python -c "import secrets; print(secrets.token_hex(32))"uv run uvicorn main:app --reloadServer will start at:
http://127.0.0.1:8000
| Interface | URL |
|---|---|
| Swagger UI | http://127.0.0.1:8000/docs |
| ReDoc | http://127.0.0.1:8000/redoc |
Swagger UI includes built-in JWT authentication via the Authorize button.
SQLite is used as the default database.
tasks.db
The database is automatically initialized when the application starts.
👤 User Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /users |
Register user |
| GET | /users |
Get all users |
| POST | /users/token |
Login & obtain access token |
| GET | /users/me |
Current authenticated user |
| PUT | /users/{user_id} |
Update user |
| DELETE | /users/{user_id} |
Delete user |
📝 Task Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /tasks |
Get all tasks |
| POST | /tasks |
Create task |
| GET | /tasks/me |
Get current user's tasks |
| GET | /tasks/{task_id} |
Get task by ID |
| PATCH | /tasks/{task_id} |
Update task |
| DELETE | /tasks/{task_id} |
Delete task |
| POST | /tasks/{task_id}/complete |
Mark completed |
| POST | /tasks/{task_id}/incomplete |
Mark incomplete |
curl -X POST http://127.0.0.1:8000/tasks \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"title":"Finish README",
"description":"Write project documentation"
}'{
"id": 1,
"title": "Finish README",
"description": "Write project documentation",
"completed": false,
"user_id": 1
}task-tracker-api/
├── router/
│ ├── tasks.py
│ └── users.py
├── auth.py
├── config.py
├── database.py
├── main.py
├── models.py
├── schemas.py
├── pyproject.toml
├── uv.lock
└── README.md
- JWT Authentication
- Async SQLAlchemy
- User-specific Tasks
- Task Completion Tracking
- Task Priorities
- Tags & Categories
- Deadlines & Reminders
- Pagination & Filtering
- Docker Support
- Unit Tests
- PostgreSQL Support
Contributions, issues, and feature requests are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push the branch
- Open a Pull Request
Licensed under the MIT License.
Built with ❤️ using FastAPI & Python