# lirazn7/app-aprende-junto architecture

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

- Interactive diagram: https://gitdiagram.com/lirazn7/app-aprende-junto
- Repository: https://github.com/lirazn7/app-aprende-junto

## Overview

AprendeJunto is a student-to-student learning PWA. Students create or access profiles, post a question (spending a coin), match with a tutor in a private 15-minute room, chat, complete the session, and rate the tutor. Separate capabilities include the student directory and saved connections, ongoing direct chats, and the coin ledger. The server exposes REST and Socket.IO services over a database adapter; the PWA provides the client shell and offline asset handling. Some modules are only partially excerpted, so uncertain internal links are omitted.

Main entry points: [`src/routes/api.js`](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js) (REST API), [`public/js/app.js`](https://github.com/lirazn7/app-aprende-junto/blob/main/public/js/app.js) (Student app), [`src/server.js`](https://github.com/lirazn7/app-aprende-junto/blob/main/src/server.js) (HTTP app server), [`src/db.js`](https://github.com/lirazn7/app-aprende-junto/blob/main/src/db.js) (Coin economy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["PWA client"]
  node_pwa["Student app<br/>[app.js]"]
  node_offline["Offline shell<br/>[sw.js]"]
end

subgraph group_learning["Quick tutoring"]
  node_doubts["Doubt board<br/>[api.js]"]
  node_rooms["15-minute rooms<br/>[api.js]"]
  node_ratings["Session ratings<br/>[api.js]"]
  node_ledger["Coin economy<br/>[db.js]"]
end

subgraph group_community["Study network"]
  node_profile["Student profiles<br/>[api.js]"]
  node_directory["Student directory<br/>[api.js]"]
  node_connections["Saved connections<br/>[api.js]"]
  node_direct["Direct chats<br/>[api.js]"]
end

subgraph group_platform["Server and storage"]
  node_api["REST API<br/>[api.js]"]
  node_realtime["Socket.IO server<br/>[server.js]"]
  node_server["HTTP app server<br/>[server.js]"]
  node_storage[("SQLite / Turso<br/>[db.js]")]
end

node_student(("Student"))

node_student -->|"uses"| node_pwa
node_pwa -->|"requests"| node_api
node_pwa -->|"opens live chat"| node_realtime
node_pwa -->|"loads shell"| node_offline
node_server -->|"mounts routes"| node_api
node_server -->|"hosts sockets"| node_realtime
node_server -->|"serves static files"| node_pwa
node_api -->|"reads and writes"| node_storage
node_realtime -->|"persists messages"| node_storage
node_api -->|"routes profile requests"| node_profile
node_api -->|"routes searches"| node_directory
node_api -->|"routes saved links"| node_connections
node_api -->|"routes direct chats"| node_direct
node_api -->|"routes doubts"| node_doubts
node_api -->|"routes room actions"| node_rooms
node_api -->|"routes ratings"| node_ratings
node_doubts -->|"debits coins"| node_ledger
node_rooms -->|"rewards tutor"| node_ledger
node_api -->|"serves transactions"| node_ledger

click node_pwa "https://github.com/lirazn7/app-aprende-junto/blob/main/public/js/app.js"
click node_offline "https://github.com/lirazn7/app-aprende-junto/blob/main/public/sw.js"
click node_profile "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_directory "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_connections "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_direct "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_doubts "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_rooms "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_ratings "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_ledger "https://github.com/lirazn7/app-aprende-junto/blob/main/src/db.js"
click node_api "https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js"
click node_realtime "https://github.com/lirazn7/app-aprende-junto/blob/main/src/server.js"
click node_server "https://github.com/lirazn7/app-aprende-junto/blob/main/src/server.js"
click node_storage "https://github.com/lirazn7/app-aprende-junto/blob/main/src/db.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_pwa,node_offline toneBlue
class node_doubts,node_rooms,node_ratings,node_ledger toneAmber
class node_profile,node_directory,node_connections,node_direct toneMint
class node_api,node_realtime,node_server,node_storage toneRose
class node_student toneIndigo
```

## Components

### PWA client

- [Student app](https://github.com/lirazn7/app-aprende-junto/blob/main/public/js/app.js): `public/js/app.js`
- [Offline shell](https://github.com/lirazn7/app-aprende-junto/blob/main/public/sw.js): `public/sw.js`

### Quick tutoring

- [Doubt board](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [15-minute rooms](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [Session ratings](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [Coin economy](https://github.com/lirazn7/app-aprende-junto/blob/main/src/db.js): `src/db.js`

### Study network

- [Student profiles](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [Student directory](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [Saved connections](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [Direct chats](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`

### Server and storage

- [REST API](https://github.com/lirazn7/app-aprende-junto/blob/main/src/routes/api.js): `src/routes/api.js`
- [Socket.IO server](https://github.com/lirazn7/app-aprende-junto/blob/main/src/server.js): `src/server.js`
- [HTTP app server](https://github.com/lirazn7/app-aprende-junto/blob/main/src/server.js): `src/server.js`
- [SQLite / Turso](https://github.com/lirazn7/app-aprende-junto/blob/main/src/db.js): `src/db.js`

### Other components

- **Student**

## Connections

- Student → Student app: uses (evidence: `README.md`)
- Student app → REST API: requests (evidence: `public/js/app.js`)
- Student app → Socket.IO server: opens live chat (evidence: `README.md`)
- Student app → Offline shell: loads shell (evidence: `public/sw.js`)
- HTTP app server → REST API: mounts routes (evidence: `src/server.js`)
- HTTP app server → Socket.IO server: hosts sockets (evidence: `src/server.js`)
- HTTP app server → Student app: serves static files (evidence: `src/server.js`)
- REST API → SQLite / Turso: reads and writes (evidence: `src/routes/api.js`)
- Socket.IO server → SQLite / Turso: persists messages (evidence: `src/server.js`)
- REST API → Student profiles: routes profile requests (evidence: `src/routes/api.js`)
- REST API → Student directory: routes searches (evidence: `README.md`)
- REST API → Saved connections: routes saved links (evidence: `src/routes/api.js`)
- REST API → Direct chats: routes direct chats (evidence: `src/routes/api.js`)
- REST API → Doubt board: routes doubts (evidence: `src/routes/api.js`)
- REST API → 15-minute rooms: routes room actions (evidence: `src/routes/api.js`)
- REST API → Session ratings: routes ratings (evidence: `README.md`)
- Doubt board → Coin economy: debits coins (evidence: `src/db.js`)
- 15-minute rooms → Coin economy: rewards tutor (evidence: `README.md`)
- REST API → Coin economy: serves transactions (evidence: `README.md`)
