# Stylomex / Style Transfer AI
Style Transfer AI is a stylometry and style-transfer project with a FastAPI backend and a static browser app.
Current primary runtime:
- FastAPI server in
api.py - Static app in
app/served at/app - Static docs site in
docs/served at/docs
- API server:
api.py - Core Python package:
src/ - Browser app:
app/ - Docs/marketing static site:
docs/ - Local persistence:
local_data/(ignored by Git) - Deployment helpers:
deploy/ - Dependency manifest:
install/requirements.txt
python -m venv .venv
.\.venv\Scripts\Activate.ps1pip install -r install/requirements.txtollama serve
ollama pull gemma3:1bpython -m uvicorn api:app --host 127.0.0.1 --port 8000Alternative:
python run.pyOpen:
- App: http://127.0.0.1:8000/app
- Docs page: http://127.0.0.1:8000/docs/index.html
- OpenAPI Swagger: http://127.0.0.1:8000/docs
All standard JSON responses follow:
{ "success": true, "data": {}, "error": null }POST /api/auth/signupPOST /api/auth/signinPOST /api/auth/google/startPOST /api/auth/signoutGET /api/auth/mePOST /api/auth/passwordPOST /api/account/delete
POST /api/analyze(NDJSON stream)POST /api/generate(text stream)POST /api/analogyPOST /api/transfer
GET /api/profilesPOST /api/profilesGET /api/profiles/{profile_id}DELETE /api/profiles/{profile_id}POST /api/comparisonsGET /api/comparisons
GET /api/health
app/ is plain JavaScript and is served directly by FastAPI. It does not require a frontend build step.
Recent UI updates:
- Generate and Transfer page now use an open layout aligned with Analyze page content width.
- Generate, Analyze, and Compare forms have cleaner open sections with fixed-height textareas.
- Compare mode labels and spacing were refined.
- Page subtitles were removed from Analyze, Generate, Compare, Student Analogy, Profiles, and Settings.
- Student Analogy page title is
Student Analogy.
style-transfer-ai/
|- api.py
|- run.py
|- app/
|- data/
|- deploy/
|- docs/
|- install/
| |- requirements.txt
|- scripts/
| |- generate_frontend_config.py
|- src/
| |- analysis/
| |- config/
| |- database/
| |- generation/
| |- models/
| |- utils/
| |- local_store.py
|- tests/
|- README.md
Supabase is used only for authentication. Saved profiles, generated content, comparisons, and uploaded avatar files are stored locally under local_data/ by default.
Create .env in the project root for authentication and optional local storage location:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
LOCAL_DATA_DIR=local_data- Use constants from
src/config/settings.pyfor model and mode values. - Keep API responses consistent with the
{ success, data, error }shape. - For UI feature additions in the primary app, wire routes in
app/js/router.jsand nav links inapp/js/components/navbar.js.
See LICENSE.