This repository holds the server-side orchestration entrypoint for SleepFocus.
It defines how backend services, model services, queues, and data stores run together.
Internal implementation repositories are not public. This repo keeps the integration surface (compose, scripts, architecture assets), while core backend/model internals live in private repos.
- iOS App SleepFocus_Frontend
- Sends sleep uploads and status polling requests to the REST backend.
- Sends chat messages to the AI backend.
- Backend API (REST): validation, auth, ingest endpoints, and polling.
- MongoDB (ingest store): validated sleep/biometric data persistence.
- Redis Job Queue: async pipeline jobs (
ingest,score,AI). - ML Worker: consumes queued jobs for sleep scoring and circadian processing.
- AI Recommender (Qwen3-8B): generates recommendations when scoring signals loss points.
- MongoDB Write Data: stores completed pipeline outputs and notifies backend status.
- Backend API AI: chat-facing API layer.
- MongoDB (AI/auth side): token/user verification data used by AI endpoints.
- AI Runtime (vLLM / Qwen3-8B): prompt/schema execution for responses.
- Internal MCP: internal tool context bridge used when model calls need additional user-scoped data.
- User token is passed from AI backend to internal MCP for scoped context access.
- AI module can request additional data from internal systems before final response generation.
This repository provides a project overview and serves as the server integration layer (compose, scripts, and architecture assets), not the full product code.
Related repositories in this workspace:
SleepFocus_Backend_v2: TypeScript REST API + worker pipeline orchestration.SleepFocus_Model_v3: Python modeling pipeline, scoring/circadian logic, labeling tooling, and model API.SleepFocus_Frontend: SwiftUI iOS app and widget client.SleepFocus_Icon: app icon source assets and exports.
