A lightweight FastAPI application for querying and serving data from a SQLite database using RESTful endpoints. Built with simplicity and modularity in mind.
- FastAPI-based REST API
- SQLite database backend (Chinook)
- Pydantic models for request/response validation
- Configurable via
.inifiles - Logging configuration support
- Unit tests included
- Python 3.9+
- pip
git clone https://github.com/ryanschostag/fastapi_db_reader.git
cd fastapi_db_reader
pip install -r requirements.txtconfig.ini: Application settings (e.g., database path)logging.ini: Logging behavior (format, level, etc.)
uvicorn app:app --reloadVisit: http://127.0.0.1:8000/docs for the interactive Swagger documentation.
fastapi_db_reader/
├── app.py # FastAPI app setup and routes
├── db_interface.py # DB query interface logic
├── models.py # Pydantic models
├── settings.py # Settings/config parsing
├── config.ini # Application configuration
├── logging.ini # Logging configuration
├── requirements.txt # Project dependencies
├── db/
│ └── chinook.db # SQLite database file
└── tests/
├── test_app.py # Tests for app endpoints
└── app_test_vars.py # Test fixtures/config
pytest tests/MIT License. See LICENSE for details.