Automated Action f1784ca3da Create REST API service with FastAPI and SQLite
- 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
2025-06-26 01:43:42 +00:00
2025-06-26 01:36:49 +00:00

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 information
  • GET /health - Health check
  • GET /docs - Interactive API documentation
  • GET /redoc - ReDoc API documentation

User Management

  • POST /api/v1/users/ - Create a new user
  • GET /api/v1/users/ - List all users (with pagination)
  • GET /api/v1/users/{user_id} - Get a specific user
  • PUT /api/v1/users/{user_id} - Update a user
  • DELETE /api/v1/users/{user_id} - Delete a user

Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. 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
Project: REST API Service
Readme 36 KiB
Languages
Python 93.2%
Mako 6.8%