A simple FastAPI backend service for managing shipment data.
- RESTful API endpoint for shipment information
- Interactive API documentation with Scalar
- Fast and modern Python web framework
Returns shipment information including content and status.
Response:
{
"Content": "wooden tabel",
"Status": "In transit"
}Interactive API documentation interface.
-
Clone the repository
git clone https://github.com/veerpatil/fastapi-learning.git cd backend -
Create virtual environment
python3 -m venv venv
-
Activate virtual environment
# On macOS/Linux source venv/bin/activate # On Windows venv\Scripts\activate
-
Install dependencies
pip install fastapi scalar-fastapi
Start the development server:
fastapi dev The API will be available at:
- Main API: http://localhost:8000
- Shipment endpoint: http://localhost:8000/shipment
- API Documentation: http://localhost:8000/scalar
The main application code is located in app/main.py. The project uses:
- FastAPI for the web framework
- Uvicorn as the ASGI server
- Scalar for API documentation
backend/
├── app/
│ ├── __init__.py
│ └── main.py
├── venv/
├── .gitignore
└── README.md