QuickSimpleAPI
A simple FastAPI application with SQLite database integration for basic CRUD operations.
Features
- FastAPI with SQLite backend
- CRUD operations for items
- Alembic for database migrations
- Health check endpoint
- OpenAPI documentation
Project Structure
/
├── app/
│ ├── api/
│ │ ├── deps.py
│ │ ├── health.py
│ │ └── v1/
│ │ ├── api.py
│ │ └── endpoints/
│ │ └── items.py
│ ├── core/
│ │ └── config.py
│ ├── db/
│ │ ├── base.py
│ │ └── session.py
│ ├── models/
│ │ └── item.py
│ └── schemas/
│ └── item.py
├── migrations/
│ ├── versions/
│ │ └── 001_initial_migration.py
│ ├── env.py
│ ├── README
│ └── script.py.mako
├── alembic.ini
├── main.py
└── requirements.txt
Installation
- Clone the repository
- Install the dependencies:
pip install -r requirements.txt
Running the Application
To run the application:
uvicorn main:app --reload
The API will be available at http://localhost:8000.
API Documentation
Once the application is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
GET /
: Root endpoint with API informationGET /health
: Health check endpointGET /api/v1/items/
: List all itemsPOST /api/v1/items/
: Create a new itemGET /api/v1/items/{item_id}
: Get a specific itemPUT /api/v1/items/{item_id}
: Update a specific itemDELETE /api/v1/items/{item_id}
: Delete a specific item
Database Migrations
This project uses Alembic for database migrations. To run the migrations:
alembic upgrade head
To create a new migration:
alembic revision --autogenerate -m "Description of changes"
Environment Variables
No environment variables are required for basic operation.
Description
Languages
Python
94.9%
Mako
5.1%