An API built to manage vehicle records. This application allows users to create, read, update, and delete (CRUD) vehicle information stored in a SQLite database.
- Python 3.10+
- Unix-based terminal (Linux/macOS) or WSL for Windows
-
Clone the repository and navigate to the project directory: cd path/to/your/project
-
Create and activate a virtual environment: python3 -m venv venv source venv/bin/activate
-
Install the dependencies: pip install -r requirements.txt
-
Run the application: uvicorn main:app --reload
-
Access the API Documentation: Once the server is running, open your browser and navigate to:
- Swagger UI (Interactive Docs): http://127.0.0.1:8000/docs
The codebase is divided into 4 files.
database.py: This manages the SQLAlchemy engine and database connection.models.py: Contains the SQLAlchemy ORM models, defining how data is stored in the database tables.schemas.py: Contains the Pydantic models, defining how data flows in and out of the API and handling data validation.main.py: Coordinates the application, containing the FastAPI instance, API routes, and logic.