# brannthichmeo-create/enghabit architecture

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

- Interactive diagram: https://gitdiagram.com/brannthichmeo-create/enghabit
- Repository: https://github.com/brannthichmeo-create/enghabit

## Overview

ENGHABIT is a habit-building English-learning app: learners study vocabulary and flashcards, review on a spaced schedule, and track streaks and progress; it also provides groups, community, rewards, and administration. The main user journey runs from the routed learner interface into study and review, with shared rules supporting learning and progress features. The README documents broad capabilities, while source excerpts establish only selected route, component, and service calls; unverified frontend-to-backend links are therefore omitted.

Main entry points: [`fe/src/routes/AppRoutes.tsx`](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/routes/AppRoutes.tsx) (App routes), [`fe/src/shared/lib/api-client.ts`](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/shared/lib/api-client.ts) (HTTP client), [`fe/src/features/groups/components/GroupsPage.tsx`](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/groups/components/GroupsPage.tsx) (Group pages), [`fe/src/features/statistics/components/DashboardPage.tsx`](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/statistics/components/DashboardPage.tsx) (Progress views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Learner experience"]
  node_routes["App routes<br/>[AppRoutes.tsx]"]
  node_studyui["Study sessions<br/>[StudySession.tsx]"]
  node_reviewui["Review page<br/>[ReviewPage.tsx]"]
  node_api["HTTP client<br/>[api-client.ts]"]
  node_authstate["Auth state<br/>[auth.store.ts]"]
  node_groupsui["Group pages<br/>[GroupsPage.tsx]"]
  node_dashboard["Progress views<br/>[DashboardPage.tsx]"]
end

subgraph group_backend["Application services"]
  node_studyservice["Study service<br/>[study.service.ts]"]
  node_groupservice["Group service<br/>[group.service.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
end

subgraph group_shared["Shared domain logic"]
  node_srs["Spaced repetition<br/>[sm2.ts]"]
  node_streak["Streak rules<br/>[streak.ts]"]
  node_report["Report logic<br/>[report.ts]"]
  node_habits["Habit schedules<br/>[habit-schedule.ts]"]
end

subgraph group_ops["Notifications and admin"]
  node_notifications["Notification service"]
  node_admin["Admin routes<br/>[admin.routes.ts]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_routes
node_routes -->|"routes to"| node_reviewui
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_groupsui
node_reviewui -->|"renders"| node_studyui
node_api -->|"refreshes through"| node_authstate
node_studyui -.->|"requests via"| node_api
node_groupsui -.->|"requests via"| node_api
node_studyservice -.->|"uses"| node_srs
node_groupservice -.->|"serves"| node_groupsui
node_authservice -.->|"may notify"| node_notifications
node_notifications -->|"audited by"| node_admin
node_studyservice -.->|"updates"| node_streak
node_dashboard -.->|"presents progress"| node_report
node_habits -.->|"supports tracking"| node_dashboard

click node_routes "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/routes/AppRoutes.tsx"
click node_studyui "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/study/components/StudySession.tsx"
click node_reviewui "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/study/components/ReviewPage.tsx"
click node_api "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/shared/lib/api-client.ts"
click node_authstate "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/auth/auth.store.ts"
click node_groupsui "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/groups/components/GroupsPage.tsx"
click node_dashboard "https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/statistics/components/DashboardPage.tsx"
click node_studyservice "https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/study/study.service.ts"
click node_groupservice "https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/groups/group.service.ts"
click node_authservice "https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/auth/auth.service.ts"
click node_notifications "https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/notifications/notification.service.ts"
click node_admin "https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/admin/admin.routes.ts"
click node_srs "https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/srs/sm2.ts"
click node_streak "https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/streak/streak.ts"
click node_report "https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/report/report.ts"
click node_habits "https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/habit/habit-schedule.ts"

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_routes,node_studyui,node_reviewui,node_api,node_authstate,node_groupsui,node_dashboard toneBlue
class node_studyservice,node_groupservice,node_authservice toneAmber
class node_srs,node_streak,node_report,node_habits toneMint
class node_notifications,node_admin toneRose
class node_learner toneIndigo
```

## Components

### Learner experience

- [App routes](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/routes/AppRoutes.tsx): `fe/src/routes/AppRoutes.tsx`
- [Study sessions](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/study/components/StudySession.tsx): `fe/src/features/study/components/StudySession.tsx`
- [Review page](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/study/components/ReviewPage.tsx): `fe/src/features/study/components/ReviewPage.tsx`
- [HTTP client](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/shared/lib/api-client.ts): `fe/src/shared/lib/api-client.ts`
- [Auth state](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/auth/auth.store.ts): `fe/src/features/auth/auth.store.ts`
- [Group pages](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/groups/components/GroupsPage.tsx): `fe/src/features/groups/components/GroupsPage.tsx`
- [Progress views](https://github.com/brannthichmeo-create/enghabit/blob/main/fe/src/features/statistics/components/DashboardPage.tsx): `fe/src/features/statistics/components/DashboardPage.tsx`

### Application services

- [Study service](https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/study/study.service.ts): `be/src/modules/study/study.service.ts`
- [Group service](https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/groups/group.service.ts): `be/src/modules/groups/group.service.ts`
- [Auth service](https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/auth/auth.service.ts): `be/src/modules/auth/auth.service.ts`

### Shared domain logic

- [Spaced repetition](https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/srs/sm2.ts): `shared/src/srs/sm2.ts`
- [Streak rules](https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/streak/streak.ts): `shared/src/streak/streak.ts`
- [Report logic](https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/report/report.ts): `shared/src/report/report.ts`
- [Habit schedules](https://github.com/brannthichmeo-create/enghabit/blob/main/shared/src/habit/habit-schedule.ts): `shared/src/habit/habit-schedule.ts`

### Notifications and admin

- [Notification service](https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/notifications/notification.service.ts): `be/src/modules/notifications/notification.service.ts`
- [Admin routes](https://github.com/brannthichmeo-create/enghabit/blob/main/be/src/modules/admin/admin.routes.ts): `be/src/modules/admin/admin.routes.ts`

### Other components

- **Learner**

## Connections

- Learner → App routes: uses (evidence: `fe/src/routes/AppRoutes.tsx`)
- App routes → Review page: routes to (evidence: `fe/src/routes/AppRoutes.tsx`)
- App routes → Progress views: routes to (evidence: `fe/src/routes/AppRoutes.tsx`)
- App routes → Group pages: routes to (evidence: `fe/src/routes/AppRoutes.tsx`)
- Review page → Study sessions: renders (evidence: `fe/src/features/study/components/ReviewPage.tsx`)
- HTTP client → Auth state: refreshes through (evidence: `fe/src/shared/lib/api-client.ts`)
- Study sessions → HTTP client: requests via (evidence: `fe/src/features/study/components/StudySession.tsx`)
- Group pages → HTTP client: requests via
- Study service → Spaced repetition: uses
- Group service → Group pages: serves
- Auth service → Notification service: may notify
- Notification service → Admin routes: audited by (evidence: `be/src/modules/notifications/notification.service.ts`)
- Study service → Streak rules: updates
- Progress views → Report logic: presents progress
- Habit schedules → Progress views: supports tracking
