AnimeChat is a chatbot specialized in anime, manga, and Japanese pop culture, built with FastAPI and powered by the Google Gemini API. The project follows the MVC (Model-View-Controller) architecture and focus on delivering an interactive and thematic chat experience.
- 💬 Streaming Responses: Smooth chat experience with real-time response generation.
- 🎌 Specialized Persona: Knowledge focused exclusively on the otaku universe.
- 🔒 Rate Limiting: Protection against abuse using
slowapi. - 🌓 Dark Mode: Modern and adaptive user interface.
- 🧪 Automated Tests: Comprehensive coverage with
pytestand validation via GitHub Actions.
- Ruff (Linter & Formatter)
- uv (Package Manager)
- Antigravity (Editor)
- Google Gemini SDK (LLM)
- pre-commit (Git Hooks)
.
├── app/
│ ├── controllers/ # Business logic and Gemini integration
│ ├── models/ # Data definitions (Pydantic)
│ ├── routes/ # API and View endpoints
│ ├── static/ # CSS, JS, and assets
│ ├── templates/ # HTML templates (Jinja2)
│ └── utils/ # Helpers and Logger
├── tests/ # Unit and integration tests
├── logs/ # Application logs
├── main.py # Entry point (FastAPI)
├── pyproject.toml # Project configuration and dependencies
└── README.md
Ensure you have uv installed.
Create a .env file in the project root based on .env.example:
cp .env.example .envFill in the variables:
GEMINI_API_KEY: Your key from Google AI Studio.GEMINI_MODEL_NAME: Model to be used (e.g.,gemini-2.0-flash-exp).APP_PORT: Server port (default:8000).
uv will handle dependencies automatically:
uv run --env-file=.env main.py- Chat:
http://127.0.0.1:8000 - API Documentation:
http://127.0.0.1:8000/docs
The project uses strict tooling to maintain clean and functional code.
To install Git hooks (recommended):
uv run pre-commit installThey will run automatically on every git commit. To run manually on all files:
uv run pre-commit run --all-filesuv run ruff check .uv run pytestThis project is for educational and demonstration purposes. Feel free to explore!