
- Set up project structure with FastAPI and SQLAlchemy - Configure SQLite database with async support - Implement CRUD endpoints for items resource - Add health endpoint for monitoring - Set up Alembic migrations - Create comprehensive documentation generated with BackendIM... (backend.im)
Quick REST API Service
A fast, lightweight REST API service built with FastAPI and SQLite.
Features
- FastAPI Framework: High-performance async API framework
- SQLite Database: Simple, file-based database with SQLAlchemy ORM
- Async Support: Full async/await pattern for high concurrency
- Migrations: Database versioning with Alembic
- API Documentation: Auto-generated OpenAPI docs
- Health Endpoint: Monitoring endpoint at
/api/v1/health
- CRUD Operations: Complete REST API for item resources
Project Structure
.
├── app
│ ├── api
│ │ └── v1
│ │ ├── __init__.py
│ │ ├── health.py
│ │ └── items.py
│ ├── core
│ │ └── config.py
│ ├── db
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── session.py
│ │ └── migrations/
│ ├── models
│ │ ├── __init__.py
│ │ └── item.py
│ └── schemas
│ ├── __init__.py
│ └── item.py
├── alembic.ini
├── main.py
├── requirements.txt
└── README.md
Installation
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
Running the Application
Start the server with:
uvicorn main:app --reload
The API will be available at http://localhost:8000.
API documentation is available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
API Endpoints
GET /api/v1/health
- Check API healthGET /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 an itemDELETE /api/v1/items/{item_id}
- Delete an item
Description
Languages
Python
95.8%
Mako
4.2%