
- Set up FastAPI application with CORS middleware - Implement SQLite database with SQLAlchemy ORM - Create user model and schemas for data validation - Set up Alembic for database migrations - Add comprehensive CRUD endpoints for user management - Include health check and service info endpoints - Configure automatic API documentation - Update README with complete project documentation
REST API Service
A REST API service built with FastAPI and SQLite, featuring user management endpoints.
Features
- FastAPI framework with automatic API documentation
- SQLite database with SQLAlchemy ORM
- Database migrations with Alembic
- User management CRUD operations
- Health check endpoint
- CORS enabled for all origins
API Endpoints
Core Endpoints
GET /
- Service informationGET /health
- Health checkGET /docs
- Interactive API documentationGET /redoc
- ReDoc API documentation
User Management
POST /api/v1/users/
- Create a new userGET /api/v1/users/
- List all users (with pagination)GET /api/v1/users/{user_id}
- Get a specific userPUT /api/v1/users/{user_id}
- Update a userDELETE /api/v1/users/{user_id}
- Delete a user
Installation
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python main.py
The API will be available at http://localhost:8000
Database
The application uses SQLite database stored at /app/storage/db/db.sqlite
. The database schema is managed through Alembic migrations.
Environment Variables
No environment variables are currently required for basic operation.
Development
- API documentation is available at
/docs
(Swagger UI) and/redoc
(ReDoc) - The application includes automatic database table creation on startup
- Code formatting and linting is handled by Ruff
Description
Languages
Python
93.2%
Mako
6.8%