How oliviern-dev/ffmkai works
Clarity is a Flask-based AI chat application. Users register or sign in, configure a provider and private API key, then create chats whose messages can be streamed, edited, searched, and managed; SQLite persists account, settings, conversation, and message data. The graph follows documented capabilities while limiting connections to relationships visible in excerpts or the README. Front-end assets and profile/settings features are included; unsampled route internals are represented only at their documented subsystem paths.
Main entry points: api_routes.py Chat API and SSE · __init__.py Flask app setup · db.py SQLite data access · auth_routes.py Registration and login
Components 18
Web interface
- Flask app setup
app/__init__.py - Chat pages
app/routes/chat_routes.py - Settings interface
static/js/settings.js - Shared UI behavior
static/js/app.js - Runtime configuration
config.py
Accounts and profile
- Registration and login
app/routes/auth_routes.py - Sessions and passwords
app/security.py - Profile management
app/routes/api_routes.py - Profile interface
static/js/profile.js
Chat and history
- Chat API and SSE
app/routes/api_routes.py - Chat interaction
static/js/chat.js - History and search
static/js/sidebar.js
AI providers
- Provider integration
app/services/ai.py - Private API keys
app/keystore.py
Persistence
- SQLite data access
app/db.py - Application database
Other components
- User
- AI provider APIs
Connections 29
- User → Flask app setup: uses
README.md - Flask app setup → Runtime configuration: loads
app/__init__.py - Flask app setup → SQLite data access: initializes
app/__init__.py - Flask app setup → Sessions and passwords: loads user
app/__init__.py - Flask app setup → Registration and login: registers routes
- Flask app setup → Chat pages: registers routes
- Flask app setup → Chat API and SSE: registers routes
- Registration and login → Sessions and passwords: authenticates
app/routes/auth_routes.py - Registration and login → SQLite data access: reads and writes
app/routes/auth_routes.py - Chat pages → SQLite data access: reads chats
app/routes/chat_routes.py - Chat pages → Sessions and passwords: loads settings
app/routes/chat_routes.py - Chat API and SSE → SQLite data access: reads and writes
app/routes/api_routes.py - Chat API and SSE → Sessions and passwords: requires login
app/routes/api_routes.py - Chat API and SSE → Provider integration: requests replies
app/routes/api_routes.py - Provider integration → Private API keys: gets key
app/services/ai.py - Provider integration → AI provider APIs: calls provider
app/services/ai.py - Private API keys → AI provider APIs: uses environment keys
README.md - SQLite data access → Application database: reads and writes
app/db.py - Chat interaction → Chat API and SSE: uses API
README.md - History and search → Chat API and SSE: uses API
README.md - Settings interface → Chat API and SSE: uses API
README.md - Profile interface → Chat API and SSE: uses API
README.md - User → Registration and login: registers or signs in
README.md - User → Chat interaction: chats
README.md - User → Settings interface: configures
README.md - User → Profile interface: manages profile
README.md - User → Profile management: uploads avatar
README.md - Chat API and SSE → Profile management: serves profile endpoints
app/routes/api_routes.py - Shared UI behavior → User: presents interface