58 lines
1.8 KiB
Markdown
58 lines
1.8 KiB
Markdown
# Frontend — Flask Web UI
|
|
|
|
Server-rendered UI powered by Flask + Jinja2 + Tailwind CSS.
|
|
|
|
## Tech Stack
|
|
|
|
| Layer | Choice |
|
|
| ----------- | -------------------------------- |
|
|
| Framework | Flask |
|
|
| Templates | Jinja2 |
|
|
| Styling | Tailwind CSS (CDN) + custom CSS |
|
|
| HTTP client | httpx |
|
|
| Server | gunicorn (prod), Flask dev (dev) |
|
|
|
|
## Project Structure
|
|
|
|
```txt
|
|
frontend/
|
|
app/
|
|
__init__.py App factory (create_app)
|
|
main.py Entry point — calls create_app()
|
|
config.py Configuration (secret key, backend URL)
|
|
filters.py Jinja2 template filters (fromisoformat, humantime)
|
|
helpers.py API client (_api), auth decorators, model helpers
|
|
routes/ Blueprint route handlers
|
|
__init__.py register_blueprints()
|
|
auth.py /login, /register, /logout, /
|
|
dashboard.py /dashboard
|
|
gallery.py /gallery, image/video/upload detail, /images/<id>/file
|
|
generate.py /generate/text, /generate/image, /generate/video
|
|
admin.py /admin, /admin/models, /api/admin/*
|
|
profile.py /users/profile
|
|
templates/ Jinja2 HTML templates
|
|
admin/ Admin sub-templates (models, videos)
|
|
static/ CSS (style.css), JS (app.js)
|
|
tests/ pytest suite
|
|
Dockerfile Production container
|
|
requirements.txt Runtime dependencies
|
|
requirements-dev.txt Dev dependencies
|
|
```
|
|
|
|
## Running locally
|
|
|
|
```bash
|
|
cd frontend
|
|
flask --app app.main run --port 12016 --debug
|
|
```
|
|
|
|
## Running tests
|
|
|
|
```bash
|
|
pytest frontend/tests/
|
|
```
|
|
|
|
## Architecture
|
|
|
|
See [docs/ARCHITECTURE.md](../docs/ARCHITECTURE.md) for full documentation (arc42 template).
|