How silpoages/silpo-backend works
Silpo is a server-side FastAPI API for a mobile mental-wellness product, backed by async SQLAlchemy and PostgreSQL. The main workflow is a client request entering the app’s registered HTTP routes, passing through route-level service dependencies, and using business services to operate on domain records; authentication additionally supports registration, login, and email confirmation. The graph preserves the listed mood, activity, good-practice, and emergency-contact capabilities, plus other domain models. Relationships for unsampled routes and storage are based on README statements and SOURCE INDEX references, not inspected implementations.
Main entry points: routes HTTP routes · models Domain records · main.py FastAPI app · user.py User service
Components 16
API entry
- FastAPI app
app/main.py - HTTP routes
app/api/routes - Service dependencies
app/api/deps.py
Identity
- Auth routes
app/api/routes/auth.py - User service
app/services/user.py - Token security
app/core/security.py - Email confirmation
app/services/email_confirmation.py - Transactional email
app/services/email.py
Wellness features
- Activities
app/services/activity.py - Mood logs
app/services/mood_log.py - Good practices
app/services/good_practice.py - Emergency contacts
app/services/emergency_contact.py
Persistence and domain
- Domain records
app/models - PostgreSQL
- Runtime settings
app/core/config.py
Other components
- API client
Connections 19
- API client → FastAPI app: sends requests
app/main.py - FastAPI app → HTTP routes: registers
app/main.py - HTTP routes → Service dependencies: resolves services
app/api/routes/auth.py - HTTP routes → Activities: calls services
README.md - HTTP routes → Mood logs: calls services
README.md - HTTP routes → Good practices: calls services
README.md - HTTP routes → Emergency contacts: calls services
README.md - Auth routes → User service: calls service
app/api/routes/auth.py - Auth routes → Email confirmation: calls service
app/api/routes/auth.py - User service → Token security: hashes and signs
app/services/user.py - User service → Email confirmation: sends confirmation
app/services/user.py - Email confirmation → Transactional email: sends email
app/services/email_confirmation.py - Activities → Domain records: queries activity records
app/services/activity.py - Mood logs → Domain records: uses mood records
app/services/mood_log.py - Good practices → Domain records: uses practice records
app/services/good_practice.py - Emergency contacts → Domain records: uses contact records
app/services/emergency_contact.py - Domain records → PostgreSQL: persisted via ORM
README.md - FastAPI app → Runtime settings: loads settings
app/main.py - Transactional email → Runtime settings: reads email config
app/services/email.py