0ae0e6e7fa
Co-authored-by: Copilot <copilot@github.com>
140 lines
4.3 KiB
Markdown
140 lines
4.3 KiB
Markdown
# All You Can GET AI
|
|
|
|
A multi-modal AI web application. Users can choose between different AI models for text generation, text-to-image, text-to-video, and image-to-video generation, powered by [openrouter.ai](https://openrouter.ai).
|
|
|
|
Key features:
|
|
|
|
- Multi-modal AI generation (text, images, videos)
|
|
- User authentication and role-based access control
|
|
- Admin dashboard for managing users, models, and video jobs
|
|
- Gallery for viewing generated images and videos
|
|
- Chat interface with message history
|
|
- Image upload and preview functionality
|
|
|
|
## Components
|
|
|
|
| Component | Technology | Description |
|
|
| --------- | ----------------- | -------------------------------------------------------- |
|
|
| Backend | FastAPI + uvicorn | REST API for auth, user management, and AI generation |
|
|
| Database | DuckDB | Lightweight embedded storage for users and session data |
|
|
| Frontend | Flask + Jinja2 | Server-rendered UI served at <https://ai.allucanget.biz> |
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Python 3.12+
|
|
- An [openrouter.ai](https://openrouter.ai) API key
|
|
|
|
### Setup
|
|
|
|
```bash
|
|
# Clone the repo
|
|
git clone https://git.allucanget.biz/allucanget/ai.allucanget.biz.git
|
|
cd ai.allucanget.biz
|
|
|
|
# Create and activate virtual environment
|
|
python -m venv .venv
|
|
# Windows
|
|
.venv\Scripts\activate
|
|
# Linux/macOS
|
|
source .venv/bin/activate
|
|
|
|
# Install core dependencies
|
|
pip install -r requirements.txt
|
|
|
|
# Install development dependencies
|
|
pip install -r backend/requirements-dev.txt
|
|
pip install -r frontend/requirements-dev.txt
|
|
|
|
# Copy environment variables file
|
|
cp .env.example .env
|
|
|
|
# Edit .env file and add your OpenRouter API key and configure other settings
|
|
nano .env
|
|
```
|
|
|
|
### Running the application locally
|
|
|
|
#### Backend (FastAPI + Uvicorn)
|
|
|
|
```bash
|
|
cd backend
|
|
uvicorn app.main:app --reload --port 12015
|
|
```
|
|
|
|
#### Frontend (Flask)
|
|
|
|
```bash
|
|
cd frontend
|
|
flask --app app.main run --port 12016 --debug
|
|
```
|
|
|
|
### Running tests
|
|
|
|
```bash
|
|
# Run all tests
|
|
pytest
|
|
|
|
# Run backend tests only
|
|
pytest backend/tests/
|
|
|
|
# Run frontend tests only
|
|
pytest frontend/tests/
|
|
```
|
|
|
|
### Available Environment Variables
|
|
|
|
| Variable | Description | Default |
|
|
| -------------------- | --------------------------- | ------------------- |
|
|
| `OPENROUTER_API_KEY` | Your OpenRouter API key | _Required_ |
|
|
| `ADMIN_EMAIL` | Default admin user email | `ai@allucanget.biz` |
|
|
| `ADMIN_PASSWORD` | Default admin user password | `admin123` |
|
|
| `DATABASE_URL` | DuckDB database path | `../data/app.db` |
|
|
|
|
## Default admin user
|
|
|
|
On first startup a default admin account is created:
|
|
|
|
| Field | Value |
|
|
| -------- | ------------------- |
|
|
| Email | `ai@allucanget.biz` |
|
|
| Password | `admin123` |
|
|
| Role | `admin` |
|
|
|
|
Override via environment variables `ADMIN_EMAIL` and `ADMIN_PASSWORD` before first run.
|
|
|
|
## Deployment
|
|
|
|
Deployed on [Coolify](https://coolify.io) using Nixpacks. See [docs/deployment/coolify.md](docs/deployment/coolify.md) for full instructions.
|
|
|
|
## Project Structure
|
|
|
|
```txt
|
|
backend/ FastAPI backend
|
|
app/
|
|
__init__.py Package initialization
|
|
db.py Database connection and operations
|
|
dependencies.py Dependency injection
|
|
main.py FastAPI application entrypoint
|
|
models/ Pydantic and database models
|
|
routers/ API route handlers (auth, users, admin, generate, gallery)
|
|
services/ Business logic for AI generation, users, admin, etc.
|
|
tests/ Backend test suite
|
|
frontend/ Flask frontend
|
|
app/
|
|
__init__.py Package initialization
|
|
main.py Flask application entrypoint
|
|
templates/ Jinja2 HTML templates
|
|
static/ CSS, JS, images
|
|
tests/ Frontend test suite
|
|
data/ DuckDB database files, uploaded media, and generated content
|
|
logs/ Application logs
|
|
docs/ Architecture documentation (arc42 template)
|
|
nginx/ Nginx configuration for Coolify deployment
|
|
```
|
|
|
|
## Documentation
|
|
|
|
For the full architecture documentation see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md), which links to all 12 arc42 sections.
|