AnimeAPI
This project is a online video cms backend with a mature scrapy framework and async user-side push notification cron workers. Python-based web application with a framework of FastAPI for the backend. It includes health checks for Redis and MySQL, middleware for processing time, and session management. The application is containerized using Docker.
Install / Use
/learn @binaryYuki/AnimeAPIREADME
Anime API Project
THIS PROJECT IS ONLY FOR EDUCATIONAL PURPOSES. DO NOT USE IT FOR COMMERCIAL PURPOSES.
Overview
This project is a Python-based web application with a framework of video player's backend that uses FastAPI for the backend. It includes health checks for Redis and MySQL, middleware for processing time, and session management. The application is containerized using Docker.
Features
- FastAPI backend
- Health checks for Redis and MySQL
- Middleware for processing time
- Session management
- CORS support
- GZip compression
Requirements
- Python 3.12.4
- Docker
- Redis
- MySQL
Installation
Prerequisites
-
Install Python 3.12.4:
sudo apt update sudo apt install python3.12 -
Install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
Using Docker
-
Clone the repository:
git clone https://github.com/binaryYuki/oleapi.git cd oleapi.git -
Build the Docker image:
docker build --build-arg COMMIT_ID=$(git rev-parse HEAD) --build-arg BUILD_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") -t oleapi:latest . -
Run the Docker container:
docker run -p 8000:8000 -e SESSION_SECRET=$(python -c 'import binascii, os; print(binascii.hexlify(os.urandom(16)).decode()') oleapi:latest
Without Docker
-
Clone the repository:
git clone https://github.com/binaryYuki/oleapi.git cd oleapi -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` -
Install the dependencies:
pip install -r requirements.txt -
Set environment variables:
export COMMIT_ID=$(git rev-parse HEAD) export BUILD_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") export SESSION_SECRET=$(python -c 'import binascii, os; print(binascii.hexlify(os.urandom(16)).decode())') -
Run the application:
uvicorn app:app --host 0.0.0.0 --port 8000
Endpoints
Health Check
- GET
/healthz- Checks the status of Redis and MySQL connections.
- Response:
{ "status": "ok", "redis": true, "mysql": true, "live_servers": [] }
Middleware
- Process Time Header: Adds the processing time to the response headers.
- Session Middleware: Manages user sessions.
- Trusted Host Middleware: Allows requests from all hosts.
- GZip Middleware: Compresses responses larger than 1000 bytes.
- CORS Middleware: Configures CORS settings based on the environment.
Environment Variables
COMMIT_ID: The current commit ID.BUILD_AT: The build timestamp.SESSION_SECRET: The secret key for session management.DEBUG: Set totrueorfalseto enable or disable debug mode.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Related Skills
feishu-drive
337.7k|
things-mac
337.7kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
337.7kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
1.9k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
