How thanetphon026/backend-smart_condo works
Smart Condo is a Flask service for condominium parcel handling, resident support, and administration. Residents interact through LINE or a web chat: the service identifies the user, interprets requests, checks parcel state, and returns status or pickup/registration prompts. Administrators manage parcels, residents, settings, logs, and a knowledge base. AI support includes chat and parcel-label analysis; images and documents have dedicated processing utilities. The route excerpts show parcel lookups and AI intent handling, while several admin and processing modules are represented from the tree and app registration; their internal wiring is not inferred.
Main entry points: db.py Database access · __init__.py Flask application · webhook.py LINE webhook · web_chat.py Web chat API
Components 27
Service entrypoints
- Flask application
app/__init__.py
Resident workflows
- LINE webhook
app/routes/webhook.py - Web chat API
app/routes/web_chat.py - LINE messaging
app/utils/line.py - Message templates
flex_templates.py - Parcel templates
parcel_flex_templates.py
Administration
- Admin authentication
app/routes/admin_auth.py - Dashboard
app/routes/admin_dashboard.py - Parcel management
app/routes/admin_parcels.py - Resident management
app/routes/admin_users.py - Audit logs
app/routes/admin_logs.py - Settings
app/routes/admin_settings.py - Knowledge base
app/routes/admin_kb.py - Maintenance
app/routes/maintenance.py
AI and processing
- AI services
app/utils/ai.py - Resident lookup
app/utils/lookup.py - PDF processing
app/utils/pdf_processor.py - Keyword extraction
app/utils/keyword_extractor.py - Image storage utility
app/utils/cloudinary_utils.py
State and integrations
- Database access
app/utils/db.py - MongoDB
Other components
- LINE resident
- Web resident
- Admin user
- LINE platform
- AI providers
- Cloudinary
Connections 47
- Flask application → LINE webhook: registers
- Flask application → Web chat API: registers
- Flask application → Admin authentication: registers
- Flask application → Dashboard: registers
- Flask application → Parcel management: registers
- Flask application → Resident management: registers
- Flask application → Audit logs: registers
- Flask application → Settings: registers
- Flask application → Knowledge base: registers
- Flask application → Maintenance: registers
- LINE resident → LINE platform: sends events
- LINE platform → LINE webhook: webhook events
- LINE webhook → AI services: interprets intent
- LINE webhook → Database access: reads and writes
- LINE webhook → LINE messaging: sends replies
- LINE webhook → Message templates: builds cards
- LINE webhook → Parcel templates: builds parcel cards
- LINE messaging → LINE platform: sends messages
- Web resident → Web chat API: sends requests
- Web chat API → AI services: interprets intent
- Web chat API → Database access: reads and writes
- Web chat API → Message templates: builds cards
- Web chat API → Parcel templates: builds parcel cards
- AI services → AI providers: calls models
- AI services → Database access: retrieves knowledge
- AI services → Resident lookup: normalizes identity
- Admin user → Admin authentication: logs in
- Admin user → Dashboard: uses dashboard
- Admin user → Parcel management: manages parcels
- Admin user → Resident management: manages residents
- Admin user → Audit logs: reviews logs
- Admin user → Settings: changes settings
- Admin user → Knowledge base: manages knowledge
- Admin authentication → Database access: checks admins
- Admin authentication → Database access: records audit
- Parcel management → Database access: manages records
- Resident management → Database access: manages records
- Audit logs → Database access: reads audit
- Dashboard → Database access: reads data
- Settings → Database access: reads and writes
- Knowledge base → Database access: manages knowledge
- Database access → MongoDB: queries
- LINE webhook → Image storage utility: uploads images
- Web chat API → Image storage utility: uploads images
- Image storage utility → Cloudinary: stores images
- Knowledge base → PDF processing: processes documents
- Knowledge base → Keyword extraction: extracts terms