A simple API Tasks created whit FastAPI, use the PostgreSQL database to store tasks with SQLAlchemy ORM.
- Create tasks
- Read tasks
- Update tasks
- Delete tasks
- Python3
- FastAPI
- PostgreSQL
- SQLAlchemy
- Pytest
Clone the repository:
git clone git@github.com:yorch-codes/task_api.git
cd task_apiCreate environment and install dependencies:
# Create environment with uv
uv venv# Use uv to install dependencies
uv pip install -r requirements.txt# Create environment with pip in windows
python -m venv venv# Create environment with pip in linux/macOS
python3 -m venv venv# Use pip to install dependencies
pip install -r requirements.txtalembic revision --autogenerate -m "create task table"# Apply the latest migration
alembic upgrade head# Downgrade to the previous migration
alembic downgrade -1Run the project:
# Run the application in windows
uvicorn app.main:app --reload# Run the application in linux/MacOS
uvicorn app.main:app --reloadRun the tests:
pytesttask_api/
│ alembic/
│ ├── versions/
│ │ ├── 000000000_init_db.py
│ ├── env.py
│ ├── script.py.mako
│ ├── README.md
├── app/
│ ├── models/
│ │ ├── __init__.py
│ │ ├── task.py
│ ├── main.py
│ ├── db/
│ │ ├── __init__.py
│ │ ├── database.py
├── docs/
│ ├── planning.md
│ ├── architecture.md
├── tests/
├── test_main.py
├── postman/
│ ├── Task_API.postman_collection.json
├── requirements.txt
├── .env
├── .gitignore
├── alembic.ini
├── README.md
Once the server is running, interactive documentation is available at:
Swagger Interactive API Docs ReDoc API Docs
A Postman collection is included in the repository:
Import it into Postman to test all endpoints quickly.
Project documentation:
- Planning → Planning
- Architecture → Architecture
Planned improvements:
- Data persistence
- Authentication
- Authorization
- Deployment
- API documentation
- tests
MIT