How deryayildirimm/smartlead-ai works
This is a Flask reading-assistant application: users can chat about short readings, while prospective users submit interest leads and administrators list them. The main paths are request validation → assistant/provider response, and lead validation → SQLite persistence → lead listing. The graph reflects the sampled runtime source; the README is empty, so frontend behavior beyond the named templates is not assumed.
Main entry points: routes.py Lead endpoints · ai_service.py AI service · __init__.py App factory · database.py Lead data access
Components 18
Web application
- App factory
app/__init__.py - Page routes
app/routes.py - Home page
app/templates/index.html - Dashboard
app/templates/dashboard.html - Health endpoint
app/__init__.py
Reading assistant
- Chat endpoint
app/routes.py - Chat validation
app/validators.py - AI service
app/services/ai_service.py - Assistant prompt
app/prompts/reading_assistant.txt
Lead management
- Lead endpoints
app/routes.py - Lead validation
app/validators.py - Lead data access
app/database.py - SQLite database
app/database.py
Configuration and errors
- Runtime configuration
config.py - Error handlers
app/errors.py
Other components
- Visitor
- Administrator
- Groq API
Connections 22
- Visitor → Page routes: requests pages
- Page routes → Home page: renders
- Page routes → Dashboard: renders
- Visitor → Chat endpoint: sends chat
- Chat endpoint → Chat validation: validates via
- Chat endpoint → AI service: requests reply
- AI service → Chat validation: validates chat
- AI service → Groq API: sends completion
- Groq API → AI service: returns completion
- Runtime configuration → Assistant prompt: loads prompt
- Administrator → Lead endpoints: lists leads
- Visitor → Lead endpoints: submits lead
- Lead endpoints → Lead validation: validates via
- Lead endpoints → Lead data access: creates or lists
- Lead data access → SQLite database: reads and writes
- App factory → Runtime configuration: loads settings
- App factory → AI service: registers service
- App factory → Lead data access: initializes database
- App factory → Error handlers: registers handlers
- Visitor → Health endpoint: checks status
- Chat endpoint → Error handlers: errors handled by
- Lead endpoints → Error handlers: errors handled by