# rafsanoo1/learnloop architecture

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

- Interactive diagram: https://gitdiagram.com/rafsanoo1/learnloop
- Repository: https://github.com/rafsanoo1/learnloop

## Overview

LearnLoop is a skill-exchange app: users discover or request skills, arrange learning sessions, and manage teaching offers and profiles. The mobile app uses a shared state context and API services to communicate with an Express backend, whose controllers operate on MongoDB models. The README is only the Expo starter template, so domain capabilities and several screen-to-service links are inferred from the file tree; those links are shown as unverified where source evidence was not provided.

Main entry points: [`server/src/server.js`](https://github.com/rafsanoo1/learnloop/blob/main/server/src/server.js) (Express server), [`services/api.ts`](https://github.com/rafsanoo1/learnloop/blob/main/services/api.ts) (HTTP client), [`context/LearnLoopContext.tsx`](https://github.com/rafsanoo1/learnloop/blob/main/context/LearnLoopContext.tsx) (LearnLoop context), [`server/src/controllers/sessionController.js`](https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/sessionController.js) (Session controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_discover["Discover skills<br/>[index.tsx]"]
  node_search["Search skills<br/>[search.tsx]"]
  node_skill_detail["Skill details<br/>[&#91;id&#93;.tsx]"]
  node_skill_request["Request skills<br/>[&#91;id&#93;.tsx]"]
  node_teach["Teach offers<br/>[index.tsx]"]
  node_incoming["Incoming requests"]
  node_sessions["Manage sessions<br/>[index.tsx]"]
  node_profile["Profile and credits<br/>[index.tsx]"]
end

subgraph group_client["Client state and API"]
  node_context["LearnLoop context"]
  node_reducer["State reducer"]
  node_skill_service["Skill service<br/>[skillService.ts]"]
  node_session_service["Session service<br/>[sessionService.ts]"]
  node_request_service["Request service"]
  node_user_service["User service<br/>[userService.ts]"]
  node_api_client["HTTP client<br/>[api.ts]"]
end

subgraph group_server["API backend"]
  node_server["Express server<br/>[server.js]"]
  node_skill_routes["Skill routes<br/>[skillRoutes.js]"]
  node_session_routes["Session routes<br/>[sessionRoutes.js]"]
  node_request_routes["Request routes"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_skill_controller["Skill controller<br/>[skillController.js]"]
  node_session_controller["Session controller"]
  node_request_controller["Request controller"]
  node_user_controller["User controller<br/>[userController.js]"]
end

subgraph group_domain["Domain data"]
  node_skill_model[("Skill offers<br/>[SkillOffer.js]")]
  node_session_model[("Sessions<br/>[SkillSession.js]")]
  node_request_model[("Skill requests<br/>[SkillRequest.js]")]
  node_user_model[("User records<br/>[User.js]")]
end

node_user(("App user"))
node_mongo[("MongoDB")]

node_user -.->|"browses"| node_discover
node_user -.->|"manages offers"| node_teach
node_user -.->|"manages sessions"| node_sessions
node_user -.->|"views profile"| node_profile
node_search -.->|"uses state"| node_context
node_context -->|"fetches skills"| node_skill_service
node_context -->|"fetches users"| node_user_service
node_context -->|"dispatches state"| node_reducer
node_skill_service -->|"sends requests"| node_api_client
node_session_service -->|"sends requests"| node_api_client
node_request_service -->|"sends requests"| node_api_client
node_user_service -->|"sends requests"| node_api_client
node_api_client -.->|"calls API"| node_server
node_server -->|"mounts routes"| node_skill_routes
node_server -->|"mounts routes"| node_session_routes
node_server -->|"mounts routes"| node_request_routes
node_server -->|"mounts routes"| node_user_routes
node_skill_routes -->|"routes calls"| node_skill_controller
node_session_routes -->|"routes calls"| node_session_controller
node_request_routes -->|"routes calls"| node_request_controller
node_user_routes -->|"routes calls"| node_user_controller
node_skill_controller -->|"queries offers"| node_skill_model
node_session_controller -->|"looks up offer"| node_skill_model
node_session_controller -->|"creates session"| node_session_model
node_request_controller -->|"manages requests"| node_request_model
node_user_controller -->|"queries users"| node_user_model
node_server -->|"connects to"| node_mongo

click node_discover "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/index.tsx"
click node_search "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/search.tsx"
click node_skill_detail "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/skill/%5Bid%5D.tsx"
click node_skill_request "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/request/%5Bid%5D.tsx"
click node_teach "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(teach)/index.tsx"
click node_incoming "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(teach)/incoming-requests.tsx"
click node_sessions "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(sessions)/index.tsx"
click node_profile "https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(profile)/index.tsx"
click node_context "https://github.com/rafsanoo1/learnloop/blob/main/context/LearnLoopContext.tsx"
click node_reducer "https://github.com/rafsanoo1/learnloop/blob/main/context/learnLoopReducer.ts"
click node_skill_service "https://github.com/rafsanoo1/learnloop/blob/main/services/skillService.ts"
click node_session_service "https://github.com/rafsanoo1/learnloop/blob/main/services/sessionService.ts"
click node_request_service "https://github.com/rafsanoo1/learnloop/blob/main/services/skillRequestService.ts"
click node_user_service "https://github.com/rafsanoo1/learnloop/blob/main/services/userService.ts"
click node_api_client "https://github.com/rafsanoo1/learnloop/blob/main/services/api.ts"
click node_server "https://github.com/rafsanoo1/learnloop/blob/main/server/src/server.js"
click node_skill_routes "https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/skillRoutes.js"
click node_session_routes "https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/sessionRoutes.js"
click node_request_routes "https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/skillRequestRoutes.js"
click node_user_routes "https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/userRoutes.js"
click node_skill_controller "https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/skillController.js"
click node_session_controller "https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/sessionController.js"
click node_request_controller "https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/skillRequestController.js"
click node_user_controller "https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/userController.js"
click node_skill_model "https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/SkillOffer.js"
click node_session_model "https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/SkillSession.js"
click node_request_model "https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/SkillRequest.js"
click node_user_model "https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/User.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_discover,node_search,node_skill_detail,node_skill_request,node_teach,node_incoming,node_sessions,node_profile,node_user toneBlue
class node_context,node_reducer,node_skill_service,node_session_service,node_request_service,node_user_service,node_api_client,node_mongo toneAmber
class node_server,node_skill_routes,node_session_routes,node_request_routes,node_user_routes,node_skill_controller,node_session_controller,node_request_controller,node_user_controller toneMint
class node_skill_model,node_session_model,node_request_model,node_user_model toneRose
```

## Components

### Mobile app

- [Discover skills](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/index.tsx): `app/(tabs)/(discover)/index.tsx`
- [Search skills](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/search.tsx): `app/(tabs)/(discover)/search.tsx`
- [Skill details](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/skill/%5Bid%5D.tsx): `app/(tabs)/(discover)/skill/[id].tsx`
- [Request skills](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(discover)/request/%5Bid%5D.tsx): `app/(tabs)/(discover)/request/[id].tsx`
- [Teach offers](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(teach)/index.tsx): `app/(tabs)/(teach)/index.tsx`
- [Incoming requests](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(teach)/incoming-requests.tsx): `app/(tabs)/(teach)/incoming-requests.tsx`
- [Manage sessions](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(sessions)/index.tsx): `app/(tabs)/(sessions)/index.tsx`
- [Profile and credits](https://github.com/rafsanoo1/learnloop/blob/main/app/(tabs)/(profile)/index.tsx): `app/(tabs)/(profile)/index.tsx`

### Client state and API

- [LearnLoop context](https://github.com/rafsanoo1/learnloop/blob/main/context/LearnLoopContext.tsx): `context/LearnLoopContext.tsx`
- [State reducer](https://github.com/rafsanoo1/learnloop/blob/main/context/learnLoopReducer.ts): `context/learnLoopReducer.ts`
- [Skill service](https://github.com/rafsanoo1/learnloop/blob/main/services/skillService.ts): `services/skillService.ts`
- [Session service](https://github.com/rafsanoo1/learnloop/blob/main/services/sessionService.ts): `services/sessionService.ts`
- [Request service](https://github.com/rafsanoo1/learnloop/blob/main/services/skillRequestService.ts): `services/skillRequestService.ts`
- [User service](https://github.com/rafsanoo1/learnloop/blob/main/services/userService.ts): `services/userService.ts`
- [HTTP client](https://github.com/rafsanoo1/learnloop/blob/main/services/api.ts): `services/api.ts`

### API backend

- [Express server](https://github.com/rafsanoo1/learnloop/blob/main/server/src/server.js): `server/src/server.js`
- [Skill routes](https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/skillRoutes.js): `server/src/routes/skillRoutes.js`
- [Session routes](https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/sessionRoutes.js): `server/src/routes/sessionRoutes.js`
- [Request routes](https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/skillRequestRoutes.js): `server/src/routes/skillRequestRoutes.js`
- [User routes](https://github.com/rafsanoo1/learnloop/blob/main/server/src/routes/userRoutes.js): `server/src/routes/userRoutes.js`
- [Skill controller](https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/skillController.js): `server/src/controllers/skillController.js`
- [Session controller](https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/sessionController.js): `server/src/controllers/sessionController.js`
- [Request controller](https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/skillRequestController.js): `server/src/controllers/skillRequestController.js`
- [User controller](https://github.com/rafsanoo1/learnloop/blob/main/server/src/controllers/userController.js): `server/src/controllers/userController.js`

### Domain data

- [Skill offers](https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/SkillOffer.js): `server/src/models/SkillOffer.js`
- [Sessions](https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/SkillSession.js): `server/src/models/SkillSession.js`
- [Skill requests](https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/SkillRequest.js): `server/src/models/SkillRequest.js`
- [User records](https://github.com/rafsanoo1/learnloop/blob/main/server/src/models/User.js): `server/src/models/User.js`

### Other components

- **App user**
- **MongoDB**

## Connections

- App user → Discover skills: browses
- App user → Teach offers: manages offers
- App user → Manage sessions: manages sessions
- App user → Profile and credits: views profile
- Search skills → LearnLoop context: uses state (evidence: `app/(tabs)/(discover)/search.tsx`)
- LearnLoop context → Skill service: fetches skills (evidence: `context/LearnLoopContext.tsx`)
- LearnLoop context → User service: fetches users (evidence: `context/LearnLoopContext.tsx`)
- LearnLoop context → State reducer: dispatches state (evidence: `context/LearnLoopContext.tsx`)
- Skill service → HTTP client: sends requests (evidence: `services/skillService.ts`)
- Session service → HTTP client: sends requests (evidence: `services/sessionService.ts`)
- Request service → HTTP client: sends requests (evidence: `services/skillRequestService.ts`)
- User service → HTTP client: sends requests (evidence: `services/userService.ts`)
- HTTP client → Express server: calls API
- Express server → Skill routes: mounts routes (evidence: `server/src/server.js`)
- Express server → Session routes: mounts routes (evidence: `server/src/server.js`)
- Express server → Request routes: mounts routes (evidence: `server/src/server.js`)
- Express server → User routes: mounts routes (evidence: `server/src/server.js`)
- Skill routes → Skill controller: routes calls (evidence: `server/src/routes/skillRoutes.js`)
- Session routes → Session controller: routes calls (evidence: `server/src/routes/sessionRoutes.js`)
- Request routes → Request controller: routes calls (evidence: `server/src/routes/skillRequestRoutes.js`)
- User routes → User controller: routes calls (evidence: `server/src/routes/userRoutes.js`)
- Skill controller → Skill offers: queries offers (evidence: `server/src/controllers/skillController.js`)
- Session controller → Skill offers: looks up offer (evidence: `server/src/controllers/sessionController.js`)
- Session controller → Sessions: creates session (evidence: `server/src/controllers/sessionController.js`)
- Request controller → Skill requests: manages requests (evidence: `server/src/controllers/skillRequestController.js`)
- User controller → User records: queries users (evidence: `server/src/controllers/userController.js`)
- Express server → MongoDB: connects to (evidence: `server/src/server.js`)
