A Python backend practice project built with FastAPI, SQLAlchemy, and PostgreSQL, demonstrating a simple REST API with database integration and CRUD operations.
This project demonstrates how to build a database-driven backend service using FastAPI and SQLAlchemy.
The application provides endpoints for creating, reading, updating, and deleting users while using PostgreSQL as the persistence layer.
- Create users
- Retrieve all users
- Retrieve a user by ID
- Update users
- Delete users
- PostgreSQL database integration
- SQLAlchemy ORM
- Pydantic request/response validation
- FastAPI dependency injection
- HTTP exception handling
- Python
- FastAPI
- SQLAlchemy
- PostgreSQL
- Pydantic
- Uvicorn
- psycopg2
fastapi-postgres-test/
├── database.py
├── main.py
├── models.py
├── schemas.py
└── requirements.txt
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
# fastapi-postgres-test
python
follow thes commands in cmd or terminal first :
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
python -m venv .venv
.\.venv\Scripts\activate
at last if you installed uvicorn use tis command
uvicorn main:app --reload
otherwise just run code