# Generic REST API Service A RESTful API service built with FastAPI and SQLite, providing standard CRUD operations with a clean architecture. ## Features - FastAPI framework for high performance - SQLite database with SQLAlchemy ORM - Alembic for database migrations - RESTful API endpoints - Input validation with Pydantic - Error handling - Health check endpoint - Interactive API documentation with Swagger ## Project Structure ``` ├── alembic/ # Database migrations │ └── versions/ # Migration scripts ├── app/ # Application code │ ├── api/ # API endpoints │ │ ├── endpoints/ # Individual API route handlers │ │ └── routes.py # API router setup │ ├── database.py # Database connection setup │ ├── errors.py # Error handling │ ├── models.py # SQLAlchemy models │ └── schemas.py # Pydantic schemas ├── main.py # Application entry point ├── alembic.ini # Alembic configuration └── requirements.txt # Project dependencies ``` ## Installation 1. Clone the repository 2. Install dependencies: ```bash pip install -r requirements.txt ``` ## Usage Run the application: ```bash uvicorn main:app --reload ``` The API will be available at http://localhost:8000 ## API Documentation - Swagger UI: http://localhost:8000/docs - ReDoc: http://localhost:8000/redoc ## API Endpoints ### Health Check - `GET /health` - Check API health status ### Items - `GET /items` - List all items (with optional filtering) - `POST /items` - Create a new item - `GET /items/{item_id}` - Get a specific item - `PUT /items/{item_id}` - Update an item - `DELETE /items/{item_id}` - Delete an item ## Database Management This project uses Alembic for database migrations: ```bash # Apply migrations alembic upgrade head # Create a new migration alembic revision -m "description" ``` The SQLite database is stored at `/app/storage/db/db.sqlite`.