A simple FastAPI + PostgreSQL application for managing items. Built with SQLAlchemy ORM and structured with CRUD logic for clean maintainability.
Create, read, update, and delete items (CRUD).
PostgreSQL database connection with SQLAlchemy.
Clean project structure with schemas, crud, and database modules.
Built using FastAPI
⚡ FastAPI – High-performance Python web framework.
🐘 PostgreSQL – Relational database.
🧾 SQLAlchemy – ORM for database operations.
🐍 Python 3.10+ – Programming language.
🛡️ Pydantic – Data validation and settings management.
git clone https://github.com/RalitsaTerzieva/verta
cd verta
python -m venv env
source env/bin/activate # Linux / Mac
venv\Scripts\activate
pip install -r requirements.txt
Edit database.py with your PostgreSQL credentials:
DATABASE_URL = "postgresql+psycopg2://myuser:mypassword@localhost:5432/mydb"
uvicorn main:app --reload
curl -X POST "http://127.0.0.1:8000/items/" \
-H "Content-Type: application/json" \
-d '{"name": "Laptop", "description": "Workstation", "price": 1200}'
{
"name": "Laptop",
"description": "Workstation",
"price": 1200.0,
"on_offer": false,
"id": 2
}
curl -X GET "http://127.0.0.1:8000/items-list/"
[
{
"name": "Laptop",
"description": "Workstation",
"price": 1200.0,
"on_offer": false,
"id": 2
}
]
Swagger UI: http://127.0.0.1:8000/docs