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

  1. Clone the repository
  2. 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:

API Endpoints

  • GET /: Root endpoint with API information
  • GET /health: Health check endpoint
  • GET /api/v1/items/: List all items
  • POST /api/v1/items/: Create a new item
  • GET /api/v1/items/{item_id}: Get a specific item
  • PUT /api/v1/items/{item_id}: Update a specific item
  • DELETE /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
Project: Quick Simple API
Readme 38 KiB
Languages
Python 94.9%
Mako 5.1%