# elfilaliamin/masteryos architecture

> Architecture diagram of the GitHub repository elfilaliamin/masteryos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elfilaliamin/masteryos
- Repository: https://github.com/elfilaliamin/masteryos
- Video tour (about a minute): https://gitdiagram.com/elfilaliamin/masteryos/video

## Overview

MasteryOS is a productivity dashboard for managing tasks, strategic goals, courses, habits, and categories, with account customization and balanced gamification. The user workflow runs from the React workspace through data hooks and the API client to Express routes, domain controllers, and PostgreSQL-backed models; uploads provide a separate certificate/file path. The graph preserves documented dashboard, analytics, settings, and learning capabilities. Some page and model implementations were not sampled, so their internal links are included only where the source index or README supports them.

Main entry points: [`frontend/src/App.jsx`](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/App.jsx) (React application), [`backend/src/routes`](https://github.com/elfilaliamin/masteryos/tree/main/backend/src/routes) (API routes), [`frontend/src/hooks`](https://github.com/elfilaliamin/masteryos/tree/main/frontend/src/hooks) (Data hooks), [`backend/src/controllers/auth.controller.js`](https://github.com/elfilaliamin/masteryos/blob/main/backend/src/controllers/auth.controller.js) (Account controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web workspace"]
  node_app["React application<br/>[App.jsx]"]
  node_datahooks["Data hooks"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_backend["API workflow"]
  node_routes["API routes"]
  node_authcontroller["Account controller<br/>[auth.controller.js]"]
  node_domaincontrollers["Domain controllers"]
  node_uploads["Certificate uploads<br/>[upload.routes.js]"]
end

subgraph group_data["Persistence and security"]
  node_middleware["Request security"]
  node_validators["Request schemas<br/>[schemas.js]"]
  node_models["Domain models"]
  node_database[("PostgreSQL<br/>[db.js]")]
  node_filevolume[("Upload storage")]
end

subgraph group_features["Product capabilities"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_tasks["Task management<br/>[TasksPage.jsx]"]
  node_goals["Goals and milestones<br/>[GoalsPage.jsx]"]
  node_courses["Courses and learning<br/>[CoursesPage.jsx]"]
  node_habits["Habit tracking<br/>[HabitsPage.jsx]"]
  node_categories["Categories<br/>[CategoriesPage.jsx]"]
  node_analytics["Analytics<br/>[AnalyticsPage.jsx]"]
  node_settings["Settings<br/>[SettingsPage.jsx]"]
  node_gamification["Gamification"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_tasks
node_app -->|"routes to"| node_goals
node_app -->|"routes to"| node_courses
node_app -->|"routes to"| node_habits
node_app -->|"routes to"| node_categories
node_app -->|"routes to"| node_analytics
node_app -->|"routes to"| node_settings
node_app -->|"provides context"| node_gamification
node_tasks -.->|"uses task data"| node_datahooks
node_goals -.->|"uses goal data"| node_datahooks
node_courses -.->|"uses course data"| node_datahooks
node_habits -.->|"uses habit data"| node_datahooks
node_datahooks -->|"calls"| node_api
node_api -->|"sends API requests"| node_routes
node_routes -->|"dispatches account requests"| node_authcontroller
node_routes -->|"dispatches domain requests"| node_domaincontrollers
node_routes -->|"applies auth and validation"| node_middleware
node_routes -->|"uses schemas"| node_validators
node_authcontroller -->|"calls user operations"| node_models
node_authcontroller -->|"queries"| node_database
node_domaincontrollers -->|"calls domain operations"| node_models
node_domaincontrollers -->|"queries"| node_database
node_models -->|"queries"| node_database
node_uploads -->|"verifies upload user"| node_middleware
node_uploads -->|"writes and serves files"| node_filevolume

click node_app "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_tasks "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/TasksPage.jsx"
click node_goals "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/GoalsPage.jsx"
click node_courses "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/CoursesPage.jsx"
click node_habits "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/HabitsPage.jsx"
click node_categories "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/CategoriesPage.jsx"
click node_analytics "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/AnalyticsPage.jsx"
click node_settings "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/SettingsPage.jsx"
click node_gamification "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/context/GamificationContext.jsx"
click node_datahooks "https://github.com/elfilaliamin/masteryos/tree/main/frontend/src/hooks"
click node_api "https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/services/api.js"
click node_routes "https://github.com/elfilaliamin/masteryos/tree/main/backend/src/routes"
click node_authcontroller "https://github.com/elfilaliamin/masteryos/blob/main/backend/src/controllers/auth.controller.js"
click node_domaincontrollers "https://github.com/elfilaliamin/masteryos/tree/main/backend/src/controllers"
click node_middleware "https://github.com/elfilaliamin/masteryos/tree/main/backend/src/middleware"
click node_validators "https://github.com/elfilaliamin/masteryos/blob/main/backend/src/validators/schemas.js"
click node_models "https://github.com/elfilaliamin/masteryos/tree/main/backend/src/models"
click node_database "https://github.com/elfilaliamin/masteryos/blob/main/backend/src/config/db.js"
click node_uploads "https://github.com/elfilaliamin/masteryos/blob/main/backend/src/routes/upload.routes.js"

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_app,node_datahooks,node_api,node_user toneBlue
class node_routes,node_authcontroller,node_domaincontrollers,node_uploads toneAmber
class node_middleware,node_validators,node_models,node_database,node_filevolume toneMint
class node_dashboard,node_tasks,node_goals,node_courses,node_habits,node_categories,node_analytics,node_settings,node_gamification toneRose
```

## Components

### Web workspace

- [React application](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Data hooks](https://github.com/elfilaliamin/masteryos/tree/main/frontend/src/hooks): `frontend/src/hooks`
- [API client](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API workflow

- [API routes](https://github.com/elfilaliamin/masteryos/tree/main/backend/src/routes): `backend/src/routes`
- [Account controller](https://github.com/elfilaliamin/masteryos/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Domain controllers](https://github.com/elfilaliamin/masteryos/tree/main/backend/src/controllers): `backend/src/controllers`
- [Certificate uploads](https://github.com/elfilaliamin/masteryos/blob/main/backend/src/routes/upload.routes.js): `backend/src/routes/upload.routes.js`

### Persistence and security

- [Request security](https://github.com/elfilaliamin/masteryos/tree/main/backend/src/middleware): `backend/src/middleware`
- [Request schemas](https://github.com/elfilaliamin/masteryos/blob/main/backend/src/validators/schemas.js): `backend/src/validators/schemas.js`
- [Domain models](https://github.com/elfilaliamin/masteryos/tree/main/backend/src/models): `backend/src/models`
- [PostgreSQL](https://github.com/elfilaliamin/masteryos/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- **Upload storage**

### Product capabilities

- [Dashboard](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Task management](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/TasksPage.jsx): `frontend/src/pages/TasksPage.jsx`
- [Goals and milestones](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/GoalsPage.jsx): `frontend/src/pages/GoalsPage.jsx`
- [Courses and learning](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/CoursesPage.jsx): `frontend/src/pages/CoursesPage.jsx`
- [Habit tracking](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/HabitsPage.jsx): `frontend/src/pages/HabitsPage.jsx`
- [Categories](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/CategoriesPage.jsx): `frontend/src/pages/CategoriesPage.jsx`
- [Analytics](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/AnalyticsPage.jsx): `frontend/src/pages/AnalyticsPage.jsx`
- [Settings](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/pages/SettingsPage.jsx): `frontend/src/pages/SettingsPage.jsx`
- [Gamification](https://github.com/elfilaliamin/masteryos/blob/main/frontend/src/context/GamificationContext.jsx): `frontend/src/context/GamificationContext.jsx`

### Other components

- **User**

## Connections

- User → React application: uses (evidence: `README.md`)
- React application → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- React application → Task management: routes to (evidence: `frontend/src/App.jsx`)
- React application → Goals and milestones: routes to (evidence: `frontend/src/App.jsx`)
- React application → Courses and learning: routes to (evidence: `frontend/src/App.jsx`)
- React application → Habit tracking: routes to (evidence: `frontend/src/App.jsx`)
- React application → Categories: routes to (evidence: `frontend/src/App.jsx`)
- React application → Analytics: routes to (evidence: `frontend/src/App.jsx`)
- React application → Settings: routes to (evidence: `frontend/src/App.jsx`)
- React application → Gamification: provides context (evidence: `frontend/src/App.jsx`)
- Task management → Data hooks: uses task data
- Goals and milestones → Data hooks: uses goal data
- Courses and learning → Data hooks: uses course data
- Habit tracking → Data hooks: uses habit data
- Data hooks → API client: calls (evidence: `frontend/src/hooks/useTasks.js`)
- API client → API routes: sends API requests (evidence: `frontend/src/services/api.js`)
- API routes → Account controller: dispatches account requests (evidence: `backend/src/routes/auth.routes.js`)
- API routes → Domain controllers: dispatches domain requests (evidence: `backend/src/controllers/task.controller.js`)
- API routes → Request security: applies auth and validation (evidence: `backend/src/routes/auth.routes.js`)
- API routes → Request schemas: uses schemas (evidence: `backend/src/routes/auth.routes.js`)
- Account controller → Domain models: calls user operations (evidence: `backend/src/controllers/auth.controller.js`)
- Account controller → PostgreSQL: queries (evidence: `backend/src/controllers/auth.controller.js`)
- Domain controllers → Domain models: calls domain operations (evidence: `backend/src/controllers/course.controller.js`)
- Domain controllers → PostgreSQL: queries (evidence: `backend/src/controllers/course.controller.js`)
- Domain models → PostgreSQL: queries (evidence: `backend/src/models/task.model.js`)
- Certificate uploads → Request security: verifies upload user (evidence: `backend/src/routes/upload.routes.js`)
- Certificate uploads → Upload storage: writes and serves files (evidence: `backend/src/routes/upload.routes.js`)
