How alharthalhajhussein/core-platform-service works
Core-Platform-Service is a FastAPI backend for managing users, companies, agents, knowledge buckets, and monitored conversations. Users enter through API routes; authentication and role-based access checks gate domain services, which implement requests against relational models or proxy selected work to external services. Conversation endpoints also provide real-time WebSocket access. The README identifies PostgreSQL and Redis as backing services; GCS, Telegram, and the RAG engine are evidenced in source. Some routes and services were not sampled, so those subsystem links are included only where the source index or README supports them.
Main entry points: services Domain Services · main.py FastAPI App · dependencies.py Auth and RBAC · agent_router.py Agent Management
Components 23
API and Access
- FastAPI App
src/main.py - Auth and RBAC
src/routers/dependencies.py
Platform Domains
- Authentication
src/routers/auth_router.py - User Management
src/routers/user_router.py - Administration
src/routers/admin_router.py - Section Management
src/routers/section_router.py - Agent Management
src/routers/agent_router.py - Knowledge Management
src/routers/kb_router.py - Conversation Monitoring
src/routers/conversation_router.py - Platform Overview
src/routers/overview_router.py - Internal API
src/routers/internal_api.py - Domain Services
src/services - Conversation Service
src/services/conversation_service.py
Persistence
- Relational Domain Models
src/models - PostgreSQL
Supporting Services
- Redis
- Security Helpers
src/helpers/security.py - WebSocket Manager
src/helpers/websocket_manager.py
External Integrations
- RAG Proxy
src/services/rag_proxy_service.py - Google Cloud Storage
- RAG Engine
- Telegram API
Other components
- API Client
Connections 40
- API Client → FastAPI App: sends requests
src/main.py - FastAPI App → Authentication: registers routes
src/main.py - FastAPI App → User Management: registers routes
src/main.py - FastAPI App → Administration: registers routes
src/main.py - FastAPI App → Section Management: registers routes
src/main.py - FastAPI App → Agent Management: registers routes
src/main.py - FastAPI App → Knowledge Management: registers routes
src/main.py - FastAPI App → Conversation Monitoring: registers routes
src/main.py - FastAPI App → Platform Overview: registers routes
src/main.py - FastAPI App → Internal API: registers routes
src/main.py - Authentication → Domain Services: calls auth service
src/routers/auth_router.py - User Management → Domain Services: calls user service
src/routers/user_router.py - Administration → Domain Services: calls admin service
src/routers/admin_router.py - Section Management → Domain Services: calls section service
src/routers/section_router.py - Agent Management → Domain Services: calls agent service
src/routers/agent_router.py - Knowledge Management → Domain Services: calls KB service
src/routers/kb_router.py - Conversation Monitoring → Conversation Service: calls service
src/routers/conversation_router.py - Platform Overview → Domain Services: calls overview service
src/routers/overview_router.py - Authentication → Auth and RBAC: uses dependencies
src/routers/auth_router.py - User Management → Auth and RBAC: uses dependencies
src/routers/user_router.py - Administration → Auth and RBAC: uses dependencies
src/routers/admin_router.py - Section Management → Auth and RBAC: uses dependencies
src/routers/section_router.py - Agent Management → Auth and RBAC: uses dependencies
src/routers/agent_router.py - Knowledge Management → Auth and RBAC: uses dependencies
src/routers/kb_router.py - Conversation Monitoring → Auth and RBAC: checks access
src/routers/conversation_router.py - Platform Overview → Auth and RBAC: uses dependencies
src/routers/overview_router.py - Auth and RBAC → Relational Domain Models: queries identity and access
src/routers/dependencies.py - Auth and RBAC → Redis: checks token blocks
src/routers/dependencies.py - Domain Services → Relational Domain Models: uses domain records
src/services/user_service.py - Conversation Service → Relational Domain Models: reads and updates
src/services/conversation_service.py - Domain Services → PostgreSQL: persists domain data
src/services/user_service.py - Conversation Service → PostgreSQL: persists conversations
src/services/conversation_service.py - Domain Services → RAG Proxy: delegates KB actions
src/services/knowledge_bucket_service.py - RAG Proxy → RAG Engine: sends authenticated requests
src/services/rag_proxy_service.py - Conversation Service → Google Cloud Storage: uses file storage
src/services/conversation_service.py - Domain Services → Redis: uses cache and blocklist
src/services/auth_service.py - Domain Services → Security Helpers: uses security functions
src/services/auth_service.py - Security Helpers → Redis: checks blocklist
src/helpers/security.py - Agent Management → WebSocket Manager: manages live connection
- Domain Services → Telegram API: registers webhooks
src/services/agent_service.py