A comprehensive product inventory management system built with FastAPI backend and React frontend, providing seamless tracking and management of product inventory.
- GET /: Welcome endpoint
- GET /products/: Get all products
- GET /products/{product_id}: Get a specific product by ID
- POST /products/: Create a new product
-
Create and activate virtual environment:
python -m venv myenv myenv\Scripts\activate.ps1 # Windows PowerShell
-
Install dependencies:
pip install fastapi uvicorn
-
Run the application:
uvicorn main:app --reload
-
Access the API:
- API: http://localhost:8000
- Interactive docs(Swagger): http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
stocksphere/
├── main.py # FastAPI application with endpoints
├── models.py # Pydantic models
├── .gitignore # Git ignore file
└── README.md # This file
curl http://localhost:8000/products/curl http://localhost:8000/products/1curl -X POST "http://localhost:8000/products/" \
-H "Content-Type: application/json" \
-d '{
"id": 5,
"name": "Monitor",
"description": "4K monitor",
"price": 299.99,
"quantity": 15
}'id: integername: stringdescription: stringprice: floatquantity: integer