How dos-ajith/native-life-dev works
Native Life API is a modular-monolith backend for the mobile app and web admin panel. A typical request enters a versioned FastAPI route, is validated and authorized, runs domain logic, and persists through repositories and SQLAlchemy models to PostgreSQL. Major capabilities include authentication and administration, posts and social interactions, collections, geography, notifications, pages, and user settings. The AI endpoint is a distinct read-only workflow that delegates tool requests to existing services and an external provider. Unsampled modules are included where documented; their internal calls are not inferred.
Main entry points: router.py API Router · routes.py Posts API · service.py AI Orchestrator · repositories Repositories
Components 26
HTTP API
- API Router
app/api/v1/router.py - Authentication API
app/api/v1/auth/routes.py - Posts API
app/api/v1/posts/routes.py - Social APIs
app/api/v1/posts - Collections API
app/api/v1/collections/routes.py - Geography API
app/api/v1/geography/routes.py - User Settings API
app/api/v1/user_settings/routes.py - Admin APIs
app/api/v1/admin/routes.py - AI API
app/api/v1/ai/routes.py
Domain Services
- Authentication Service
app/services/auth_service.py - Post Service
app/services/post_service.py - Geography Services
app/services/geography_service.py - Geography Import
app/services/geography_import_service.py - User Service
app/services/user_service.py - Settings Service
app/services/user_settings_service.py
AI Integration
- AI Orchestrator
app/ai/service.py - Read-only Tools
app/ai/tools - Provider Client
app/ai/client.py - AI Provider
Shared and Persistence
- Application Entry
app/main.py - Auth and Request Dependencies
app/api/deps.py - Activity Logging
app/services/activity_log_service.py - Repositories
app/repositories - ORM Models
app/models - PostgreSQL
Other components
- App and Admin Clients
Connections 26
- App and Admin Clients → API Router: sends requests
- Application Entry → API Router: mounts
app/main.py - API Router → Authentication API: routes to
- API Router → Posts API: routes to
- API Router → Collections API: routes to
- API Router → Geography API: routes to
- API Router → User Settings API: routes to
- API Router → Admin APIs: routes to
- API Router → AI API: routes to
- Authentication API → Authentication Service: delegates to
- Authentication Service → Repositories: queries
app/services/auth_service.py - Posts API → Post Service: calls
app/api/v1/posts/routes.py - Posts API → Social APIs: includes operations
app/api/v1/posts/routes.py - Collections API → Repositories: uses services
- Geography API → Geography Services: calls
app/api/v1/geography/routes.py - Geography Import → Activity Logging: logs activity
app/services/geography_import_service.py - Admin APIs → User Service: calls
app/api/v1/admin/routes.py - User Settings API → Settings Service: calls
app/api/v1/user_settings/routes.py - Settings Service → Activity Logging: logs changes
app/services/user_settings_service.py - AI API → AI Orchestrator: delegates to
- AI Orchestrator → Provider Client: requests completion
app/ai/service.py - AI Orchestrator → Read-only Tools: dispatches tools
app/ai/service.py - Read-only Tools → Post Service: calls services
- Provider Client → AI Provider: sends prompts
app/ai/client.py - Repositories → ORM Models: queries and persists
app/repositories/post_repository.py - ORM Models → PostgreSQL: maps to