# pawansimha/cerebrokognit-infosysinternship-b3 architecture

> Architecture diagram of the GitHub repository pawansimha/cerebrokognit-infosysinternship-b3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pawansimha/cerebrokognit-infosysinternship-b3
- Repository: https://github.com/pawansimha/cerebrokognit-infosysinternship-b3

## Overview

CerebroKognit is an AI-assisted alarm and habit platform: users configure wake-up alarms, solve cognitive challenges to dismiss them, and track behavior and productivity. The product spans a web dashboard and an Expo mobile app backed by a FastAPI service. Its main runtime path is client requests through API routing into domain services and persistent user/alarm/challenge data; mobile also schedules alarms locally and synchronizes offline records. The README documents broader analytics, reporting, administration, and notification capabilities. Some subsystem links are omitted where the sampled source does not show their callers.

Main entry points: [`backend/app/api`](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/backend/app/api) (Product API routes), [`backend/app/main.py`](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/main.py) (FastAPI application), [`mobile/App.js`](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/App.js) (Mobile app shell), [`mobile/src/screens`](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/mobile/src/screens) (Alarm and challenge screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_mobile_app["Mobile app shell<br/>[App.js]"]
  node_mobile_screens["Alarm and challenge screens"]
  node_mobile_auth["Mobile authentication<br/>[useAuth.jsx]"]
  node_web_app["Web app routing<br/>[App.jsx]"]
  node_web_pages["Dashboard and product pages"]
  node_web_api["Web API client<br/>[api.js]"]
end

subgraph group_backend["API and domain"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_api_routes["Product API routes"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_auth_service["Authentication service<br/>[auth.py]"]
  node_sync_routes["Server sync API<br/>[sync.py]"]
  node_reports["Reports and exports<br/>[report_service.py]"]
end

subgraph group_intelligence["Adaptive intelligence"]
  node_challenge_service["Challenge engine"]
  node_difficulty_model["Adaptive difficulty<br/>[difficulty.py]"]
  node_analytics["Analytics and recommendations"]
  node_habit_scoring["Habit scoring"]
end

subgraph group_state["Persistence and sync"]
  node_mobile_sync["Offline sync engine<br/>[syncEngine.js]"]
  node_orm_models["Domain data models<br/>[Models.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

subgraph group_integrations["Notifications and integrations"]
  node_mobile_alarm["Local alarm scheduling<br/>[scheduleAlarm.js]"]
  node_notifications["Notification services"]
  node_email["Email integration<br/>[email_sender.py]"]
end

node_mobile_user(("Mobile user"))
node_web_user(("Web user"))

node_mobile_user -->|"uses"| node_mobile_app
node_mobile_app -->|"navigates to"| node_mobile_screens
node_mobile_screens -->|"uses auth"| node_mobile_auth
node_mobile_auth -->|"requests API"| node_api_app
node_mobile_screens -->|"reads cached data"| node_mobile_sync
node_mobile_sync -->|"pushes and pulls"| node_sync_routes
node_mobile_app -.->|"configures alarms"| node_mobile_alarm
node_web_user -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_web_pages
node_web_pages -.->|"requests data"| node_web_api
node_web_api -->|"requests API"| node_api_app
node_api_app -->|"registers routes"| node_api_routes
node_api_routes -->|"uses sessions"| node_database
node_api_routes -->|"queries models"| node_orm_models
node_api_app -->|"registers routes"| node_auth_routes
node_auth_routes -->|"uses"| node_auth_service
node_challenge_service -->|"uses difficulty"| node_difficulty_model
node_api_routes -->|"requests analytics"| node_analytics
node_api_routes -.->|"requests scoring"| node_habit_scoring
node_api_routes -.->|"serves challenges"| node_challenge_service
node_api_routes -.->|"serves sync"| node_sync_routes
node_api_routes -.->|"serves notifications"| node_notifications
node_api_routes -.->|"serves reports"| node_reports
node_auth_routes -->|"sends messages"| node_email

click node_mobile_app "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/App.js"
click node_mobile_screens "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/mobile/src/screens"
click node_mobile_auth "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/src/hooks/useAuth.jsx"
click node_mobile_sync "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/src/sync/syncEngine.js"
click node_mobile_alarm "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/src/notifications/scheduleAlarm.js"
click node_web_app "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/web/src/App.jsx"
click node_web_pages "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/web/src/pages"
click node_web_api "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/web/src/utils/api.js"
click node_api_app "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/main.py"
click node_api_routes "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/backend/app/api"
click node_auth_routes "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/api/auth.py"
click node_auth_service "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/auth.py"
click node_challenge_service "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/challenge_service.py"
click node_difficulty_model "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/ai_engine/difficulty.py"
click node_analytics "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/analytics_service.py"
click node_habit_scoring "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/habit_scoring_service.py"
click node_orm_models "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/Models.py"
click node_database "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/database.py"
click node_sync_routes "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/api/sync.py"
click node_notifications "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/notification_service.py"
click node_reports "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/report_service.py"
click node_email "https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/integrations/email_sender.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mobile_app,node_mobile_screens,node_mobile_auth,node_web_app,node_web_pages,node_web_api,node_mobile_user,node_web_user toneBlue
class node_api_app,node_api_routes,node_auth_routes,node_auth_service,node_sync_routes,node_reports toneAmber
class node_challenge_service,node_difficulty_model,node_analytics,node_habit_scoring toneMint
class node_mobile_sync,node_orm_models,node_database toneRose
class node_mobile_alarm,node_notifications,node_email toneIndigo
```

## Components

### Client applications

- [Mobile app shell](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/App.js): `mobile/App.js`
- [Alarm and challenge screens](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/mobile/src/screens): `mobile/src/screens`
- [Mobile authentication](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/src/hooks/useAuth.jsx): `mobile/src/hooks/useAuth.jsx`
- [Web app routing](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Dashboard and product pages](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/web/src/pages): `web/src/pages`
- [Web API client](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/web/src/utils/api.js): `web/src/utils/api.js`

### API and domain

- [FastAPI application](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/main.py): `backend/app/main.py`
- [Product API routes](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/tree/main/backend/app/api): `backend/app/api`
- [Authentication routes](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Authentication service](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/auth.py): `backend/app/services/auth.py`
- [Server sync API](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/api/sync.py): `backend/app/api/sync.py`
- [Reports and exports](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/report_service.py): `backend/app/services/report_service.py`

### Adaptive intelligence

- [Challenge engine](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/challenge_service.py): `backend/app/services/challenge_service.py`
- [Adaptive difficulty](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/ai_engine/difficulty.py): `backend/app/ai_engine/difficulty.py`
- [Analytics and recommendations](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/analytics_service.py): `backend/app/services/analytics_service.py`
- [Habit scoring](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/habit_scoring_service.py): `backend/app/services/habit_scoring_service.py`

### Persistence and sync

- [Offline sync engine](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/src/sync/syncEngine.js): `mobile/src/sync/syncEngine.js`
- [Domain data models](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/Models.py): `backend/app/Models.py`
- [SQL database](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/database.py): `backend/app/database.py`

### Notifications and integrations

- [Local alarm scheduling](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/mobile/src/notifications/scheduleAlarm.js): `mobile/src/notifications/scheduleAlarm.js`
- [Notification services](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/services/notification_service.py): `backend/app/services/notification_service.py`
- [Email integration](https://github.com/pawansimha/cerebrokognit-infosysinternship-b3/blob/main/backend/app/integrations/email_sender.py): `backend/app/integrations/email_sender.py`

### Other components

- **Mobile user**
- **Web user**

## Connections

- Mobile user → Mobile app shell: uses (evidence: `mobile/App.js`)
- Mobile app shell → Alarm and challenge screens: navigates to (evidence: `mobile/App.js`)
- Alarm and challenge screens → Mobile authentication: uses auth (evidence: `mobile/src/screens/ChallengeScreen.jsx`)
- Mobile authentication → FastAPI application: requests API (evidence: `mobile/src/hooks/useAuth.jsx`)
- Alarm and challenge screens → Offline sync engine: reads cached data (evidence: `mobile/src/screens/ChallengeScreen.jsx`)
- Offline sync engine → Server sync API: pushes and pulls (evidence: `mobile/src/sync/syncEngine.js`)
- Mobile app shell → Local alarm scheduling: configures alarms
- Web user → Web app routing: uses (evidence: `web/src/App.jsx`)
- Web app routing → Dashboard and product pages: routes to (evidence: `web/src/App.jsx`)
- Dashboard and product pages → Web API client: requests data
- Web API client → FastAPI application: requests API (evidence: `README.md`)
- FastAPI application → Product API routes: registers routes (evidence: `backend/app/main.py`)
- Product API routes → SQL database: uses sessions (evidence: `backend/app/api/alarms.py`)
- Product API routes → Domain data models: queries models (evidence: `backend/app/api/alarms.py`)
- FastAPI application → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- Authentication routes → Authentication service: uses (evidence: `backend/app/api/auth.py`)
- Challenge engine → Adaptive difficulty: uses difficulty (evidence: `backend/app/services/challenge_service.py`)
- Product API routes → Analytics and recommendations: requests analytics (evidence: `backend/app/api/analytics.py`)
- Product API routes → Habit scoring: requests scoring
- Product API routes → Challenge engine: serves challenges
- Product API routes → Server sync API: serves sync
- Product API routes → Notification services: serves notifications
- Product API routes → Reports and exports: serves reports
- Authentication routes → Email integration: sends messages (evidence: `backend/app/api/auth.py`)
