
- Create project structure and dependencies - Set up SQLAlchemy models for anime, genres, and their relationships - Implement CRUD operations for all models - Set up FastAPI endpoints for managing anime and genres - Add health check endpoint - Configure Alembic for database migrations - Add data seeding capability - Update README with project information
Anime Information API
This is a FastAPI application that provides anime information via a RESTful API.
Features
- Anime Information: Comprehensive anime data including titles, synopsis, episodes, scores, etc.
- Genre Management: Create, read, update, and delete anime genres
- Search Capabilities: Search anime by title, genre, or status
- Health Endpoint: Check the health of the application and its database connection
Tech Stack
- Framework: FastAPI
- Database: SQLite with SQLAlchemy ORM
- Migration Tool: Alembic
- Validation: Pydantic
- Code Quality: Ruff linter
Project Structure
anime-information-api/
├── alembic/ # Database migrations
├── app/ # Application code
│ ├── api/ # API endpoints
│ │ └── endpoints/ # Route definitions
│ ├── core/ # Core application components
│ ├── crud/ # CRUD operations
│ ├── db/ # Database setup
│ ├── initial_data/ # Data seeding
│ ├── models/ # SQLAlchemy models
│ └── schemas/ # Pydantic schemas
├── storage/ # Storage for SQLite database
├── alembic.ini # Alembic config
├── main.py # Application entry point
├── requirements.txt # Dependencies
└── seed_data.py # Script to seed initial data
Getting Started
Prerequisites
- Python 3.9+
Installation
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
Database Setup
Run the Alembic migrations to set up the database schema:
alembic upgrade head
Seed the database with initial data:
python seed_data.py
Running the Application
Start the application with:
uvicorn main:app --reload
The API will be available at http://localhost:8000, and the interactive API documentation at http://localhost:8000/docs.
API Endpoints
Health Check
GET /health
: Check application health
Anime
GET /api/v1/anime/
: Get anime list with search capabilitiesPOST /api/v1/anime/
: Create new animeGET /api/v1/anime/{id}
: Get anime by IDPUT /api/v1/anime/{id}
: Update animeDELETE /api/v1/anime/{id}
: Delete anime
Genres
GET /api/v1/genres/
: Get genre listPOST /api/v1/genres/
: Create new genreGET /api/v1/genres/{id}
: Get genre by IDPUT /api/v1/genres/{id}
: Update genreDELETE /api/v1/genres/{id}
: Delete genre
Description
Languages
Python
99.2%
Mako
0.8%