A full-stack product management application built with FastAPI (backend) and React (frontend). Supports creating, updating, and deleting products through a clean REST API connected to a PostgreSQL database.
| Layer | Technology |
|---|---|
| Backend | FastAPI, SQLAlchemy, psycopg2 |
| Database | PostgreSQL |
| Frontend | React 18, Axios |
| Server | Uvicorn |
| Config | python-dotenv |
project-root/
├── backend/ # FastAPI app
│ ├── main.py
│ ├── models.py
│ ├── database.py
│ ├── .env
│ └── pyproject.toml
└── frontend/ # React app
├── src/
├── public/
└── package.json
- Python 3.13+
- PostgreSQL running locally
cd backend
pip install .Create a .env file in the backend/ directory:
DATABASE_URL=postgresql://username:password@localhost:5432/your_db_nameuvicorn main:app --reloadThe API will be available at http://localhost:8000
| Method | Endpoint | Description |
|---|---|---|
| GET | /products |
Get all products |
| GET | /products/{id} |
Get product by ID |
| POST | /products |
Create a product |
| PUT | /products/{id} |
Update a product |
| DELETE | /products/{id} |
Delete a product |
Interactive API docs available at: http://localhost:8000/docs
- Node.js & npm
cd frontend
npm installnpm startThe app will be available at http://localhost:3000 and proxies API requests to http://localhost:8000.
- Start PostgreSQL
- Start the backend:
cd backend && uvicorn main:app --reload
- Start the frontend:
cd frontend && npm start
MIT