# ikerom3/learn-lingo architecture

> Architecture diagram of the GitHub repository ikerom3/learn-lingo, 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/ikerom3/learn-lingo
- Repository: https://github.com/ikerom3/learn-lingo

## Overview

Learn Lingo is a React app for discovering language tutors. A visitor enters through the landing page, navigates to the tutor directory, and can filter and browse tutor cards; the directory loads teacher records from Firebase. Authentication is initialized separately through a shared provider, with auth helpers and a private-route component available. The tree also contains a favorites page, but the shown app routes do not connect it. Evidence is limited to the README, source index, and sampled files, so unsampled relationships are omitted.

Main entry points: [`src/App.jsx`](https://github.com/ikerom3/learn-lingo/blob/main/src/App.jsx) (App router), [`src/Page/Teachers/Teachers.jsx`](https://github.com/ikerom3/learn-lingo/blob/main/src/Page/Teachers/Teachers.jsx) (Teacher directory), [`src/context/AuthContext.jsx`](https://github.com/ikerom3/learn-lingo/blob/main/src/context/AuthContext.jsx) (Auth provider), [`src/services/firebase.js`](https://github.com/ikerom3/learn-lingo/blob/main/src/services/firebase.js) (Firebase Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["App router<br/>[App.jsx]"]
  node_header["Header<br/>[Header.jsx]"]
  node_hero["Landing hero<br/>[Hero.jsx]"]
  node_sprite["Sprite injector<br/>[SpriteInjector.jsx]"]
  node_palette["Color palettes<br/>[palettes.js]"]
end

subgraph group_discovery["Tutor discovery"]
  node_teachers["Teacher directory<br/>[Teachers.jsx]"]
  node_teacher_hook["Teacher loading hook<br/>[useTeachers.js]"]
  node_teacher_card["Teacher card<br/>[TeacherCard.jsx]"]
  node_favorites["Favorites page<br/>[Favorites.jsx]"]
end

subgraph group_identity["Authentication"]
  node_auth_provider["Auth provider<br/>[AuthContext.jsx]"]
  node_auth_hook["Auth hook<br/>[useAuth.js]"]
  node_private_route["Private route<br/>[PrivateRoute.jsx]"]
  node_auth_service["Auth operations<br/>[authService.js]"]
end

subgraph group_backend["Firebase services"]
  node_firebase_auth["Firebase Auth<br/>[firebase.js]"]
  node_teacher_service["Teacher data service<br/>[teachersService.js]"]
  node_realtime_db[("Realtime Database<br/>[firebase.js]")]
end

node_visitor(("Visitor"))
node_firebase(("Firebase"))

node_visitor -.->|"uses"| node_app
node_app -->|"renders"| node_header
node_app -->|"routes to"| node_hero
node_app -->|"routes to"| node_teachers
node_app -->|"renders"| node_sprite
node_app -->|"selects palette"| node_palette
node_app -->|"provides auth"| node_auth_provider
node_teachers -->|"loads teachers"| node_teacher_hook
node_teachers -->|"renders cards"| node_teacher_card
node_teacher_hook -->|"fetches records"| node_teacher_service
node_teacher_service -->|"reads records"| node_realtime_db
node_auth_hook -->|"reads context"| node_auth_provider
node_private_route -->|"checks auth"| node_auth_hook
node_auth_provider -->|"observes session"| node_firebase_auth
node_auth_service -->|"authenticates users"| node_firebase_auth
node_firebase_auth -.->|"connects"| node_firebase
node_realtime_db -.->|"connects"| node_firebase

click node_app "https://github.com/ikerom3/learn-lingo/blob/main/src/App.jsx"
click node_header "https://github.com/ikerom3/learn-lingo/blob/main/src/components/Header/Header.jsx"
click node_hero "https://github.com/ikerom3/learn-lingo/blob/main/src/components/Hero/Hero.jsx"
click node_sprite "https://github.com/ikerom3/learn-lingo/blob/main/src/components/SpriteInjector/SpriteInjector.jsx"
click node_palette "https://github.com/ikerom3/learn-lingo/blob/main/src/constants/palettes.js"
click node_teachers "https://github.com/ikerom3/learn-lingo/blob/main/src/Page/Teachers/Teachers.jsx"
click node_teacher_hook "https://github.com/ikerom3/learn-lingo/blob/main/src/hooks/useTeachers.js"
click node_teacher_card "https://github.com/ikerom3/learn-lingo/blob/main/src/components/TeacherCard/TeacherCard.jsx"
click node_favorites "https://github.com/ikerom3/learn-lingo/blob/main/src/Page/Favorites/Favorites.jsx"
click node_auth_provider "https://github.com/ikerom3/learn-lingo/blob/main/src/context/AuthContext.jsx"
click node_auth_hook "https://github.com/ikerom3/learn-lingo/blob/main/src/hooks/useAuth.js"
click node_private_route "https://github.com/ikerom3/learn-lingo/blob/main/src/components/PrivateRoute/PrivateRoute.jsx"
click node_auth_service "https://github.com/ikerom3/learn-lingo/blob/main/src/services/authService.js"
click node_firebase_auth "https://github.com/ikerom3/learn-lingo/blob/main/src/services/firebase.js"
click node_teacher_service "https://github.com/ikerom3/learn-lingo/blob/main/src/services/teachersService.js"
click node_realtime_db "https://github.com/ikerom3/learn-lingo/blob/main/src/services/firebase.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_header,node_hero,node_sprite,node_palette toneBlue
class node_teachers,node_teacher_hook,node_teacher_card,node_favorites toneAmber
class node_auth_provider,node_auth_hook,node_private_route,node_auth_service toneMint
class node_firebase_auth,node_teacher_service,node_realtime_db toneRose
class node_visitor,node_firebase toneIndigo
```

## Components

### App and navigation

- [App router](https://github.com/ikerom3/learn-lingo/blob/main/src/App.jsx): `src/App.jsx`
- [Header](https://github.com/ikerom3/learn-lingo/blob/main/src/components/Header/Header.jsx): `src/components/Header/Header.jsx`
- [Landing hero](https://github.com/ikerom3/learn-lingo/blob/main/src/components/Hero/Hero.jsx): `src/components/Hero/Hero.jsx`
- [Sprite injector](https://github.com/ikerom3/learn-lingo/blob/main/src/components/SpriteInjector/SpriteInjector.jsx): `src/components/SpriteInjector/SpriteInjector.jsx`
- [Color palettes](https://github.com/ikerom3/learn-lingo/blob/main/src/constants/palettes.js): `src/constants/palettes.js`

### Tutor discovery

- [Teacher directory](https://github.com/ikerom3/learn-lingo/blob/main/src/Page/Teachers/Teachers.jsx): `src/Page/Teachers/Teachers.jsx`
- [Teacher loading hook](https://github.com/ikerom3/learn-lingo/blob/main/src/hooks/useTeachers.js): `src/hooks/useTeachers.js`
- [Teacher card](https://github.com/ikerom3/learn-lingo/blob/main/src/components/TeacherCard/TeacherCard.jsx): `src/components/TeacherCard/TeacherCard.jsx`
- [Favorites page](https://github.com/ikerom3/learn-lingo/blob/main/src/Page/Favorites/Favorites.jsx): `src/Page/Favorites/Favorites.jsx`

### Authentication

- [Auth provider](https://github.com/ikerom3/learn-lingo/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Auth hook](https://github.com/ikerom3/learn-lingo/blob/main/src/hooks/useAuth.js): `src/hooks/useAuth.js`
- [Private route](https://github.com/ikerom3/learn-lingo/blob/main/src/components/PrivateRoute/PrivateRoute.jsx): `src/components/PrivateRoute/PrivateRoute.jsx`
- [Auth operations](https://github.com/ikerom3/learn-lingo/blob/main/src/services/authService.js): `src/services/authService.js`

### Firebase services

- [Firebase Auth](https://github.com/ikerom3/learn-lingo/blob/main/src/services/firebase.js): `src/services/firebase.js`
- [Teacher data service](https://github.com/ikerom3/learn-lingo/blob/main/src/services/teachersService.js): `src/services/teachersService.js`
- [Realtime Database](https://github.com/ikerom3/learn-lingo/blob/main/src/services/firebase.js): `src/services/firebase.js`

### Other components

- **Visitor**
- **Firebase**

## Connections

- Visitor → App router: uses
- App router → Header: renders (evidence: `src/App.jsx`)
- App router → Landing hero: routes to (evidence: `src/App.jsx`)
- App router → Teacher directory: routes to (evidence: `src/App.jsx`)
- App router → Sprite injector: renders (evidence: `src/App.jsx`)
- App router → Color palettes: selects palette (evidence: `src/App.jsx`)
- App router → Auth provider: provides auth (evidence: `src/App.jsx`)
- Teacher directory → Teacher loading hook: loads teachers (evidence: `src/Page/Teachers/Teachers.jsx`)
- Teacher directory → Teacher card: renders cards (evidence: `src/Page/Teachers/Teachers.jsx`)
- Teacher loading hook → Teacher data service: fetches records (evidence: `src/hooks/useTeachers.js`)
- Teacher data service → Realtime Database: reads records (evidence: `src/services/teachersService.js`)
- Auth hook → Auth provider: reads context (evidence: `src/hooks/useAuth.js`)
- Private route → Auth hook: checks auth (evidence: `src/components/PrivateRoute/PrivateRoute.jsx`)
- Auth provider → Firebase Auth: observes session (evidence: `src/context/AuthContext.jsx`)
- Auth operations → Firebase Auth: authenticates users (evidence: `src/services/authService.js`)
- Firebase Auth → Firebase: connects
- Realtime Database → Firebase: connects
