# ibrahimkataya/i-stream-app architecture

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

- Interactive diagram: https://gitdiagram.com/ibrahimkataya/i-stream-app
- Repository: https://github.com/ibrahimkataya/i-stream-app

## Overview

This is a language-exchange social app: users sign up, complete language profiles, discover people, build friendships, then chat or call. The frontend routes these stages; the backend provides cookie/JWT authentication, profile and friendship operations, and Stream credentials/user synchronization. Source excerpts do not include route implementations, frontend API calls, or chat screens, so those links are limited to wiring established by the sampled code and repository structure.

Main entry points: [`frontend/src/App.jsx`](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/App.jsx) (Route app), [`backend/src/models/User.js`](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/models/User.js) (User records), [`backend/src/server.js`](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/server.js) (HTTP server), [`backend/src/routes/auth.route.js`](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/auth.route.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web app"]
  node_app["Route app<br/>[App.jsx]"]
  node_authpages["Sign-in pages<br/>[LoginPage.jsx]"]
  node_signup["Sign-up page<br/>[SignUpPage.jsx]"]
  node_onboard["Profile setup<br/>[OnboardingPage.jsx]"]
  node_home["People discovery<br/>[HomePage.jsx]"]
  node_notifications["Friend requests"]
  node_chatpage["Chat screen<br/>[ChatPage.jsx]"]
  node_callpage["Call screen<br/>[CallPage.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_backend["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[auth.route.js]"]
  node_userroutes["User routes<br/>[user.route.js]"]
  node_chatroutes["Chat routes<br/>[chat.route.js]"]
  node_authcontroller["Auth workflows<br/>[auth.controller.js]"]
  node_usercontroller["Friend workflows<br/>[user.controller.js]"]
  node_chatcontroller["Stream token<br/>[chat.controller.js]"]
  node_protect["JWT protection<br/>[auth.middleware.js]"]
end

subgraph group_data["Persistence"]
  node_dbconn["DB connection<br/>[db.js]"]
  node_user[("User records<br/>[User.js]")]
  node_requests[("Friend requests<br/>[FriendRequest.js]")]
end

subgraph group_integrations["External services"]
  node_streamlib["Stream integration<br/>[stream.js]"]
end

node_visitor(("User"))
node_mongo[("MongoDB")]
node_stream["Stream service"]

node_visitor -->|"uses"| node_app
node_app -->|"routes"| node_authpages
node_app -->|"routes"| node_signup
node_app -->|"routes"| node_onboard
node_app -->|"routes"| node_home
node_app -->|"routes"| node_notifications
node_app -->|"routes"| node_chatpage
node_app -->|"routes"| node_callpage
node_app -->|"loads auth"| node_api
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_userroutes
node_server -->|"mounts"| node_chatroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"guards"| node_protect
node_userroutes -->|"dispatches"| node_usercontroller
node_chatroutes -->|"dispatches"| node_chatcontroller
node_protect -->|"loads user"| node_user
node_authcontroller -->|"reads/writes"| node_user
node_authcontroller -->|"syncs user"| node_streamlib
node_usercontroller -->|"reads/writes"| node_user
node_usercontroller -->|"reads/writes"| node_requests
node_chatcontroller -->|"creates token"| node_streamlib
node_dbconn -->|"connects"| node_mongo
node_user -->|"persists"| node_mongo
node_requests -->|"persists"| node_mongo
node_streamlib -->|"calls"| node_stream

click node_app "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/LoginPage.jsx"
click node_signup "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/SignUpPage.jsx"
click node_onboard "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/OnboardingPage.jsx"
click node_home "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/HomePage.jsx"
click node_notifications "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/NotificationsPage.jsx"
click node_chatpage "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/ChatPage.jsx"
click node_callpage "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/CallPage.jsx"
click node_api "https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/lib/api.js"
click node_server "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/auth.route.js"
click node_userroutes "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/user.route.js"
click node_chatroutes "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/chat.route.js"
click node_authcontroller "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/controllers/auth.controller.js"
click node_usercontroller "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/controllers/user.controller.js"
click node_chatcontroller "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/controllers/chat.controller.js"
click node_protect "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/middleware/auth.middleware.js"
click node_dbconn "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/lib/db.js"
click node_user "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/models/User.js"
click node_requests "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/models/FriendRequest.js"
click node_streamlib "https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/lib/stream.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_authpages,node_signup,node_onboard,node_home,node_notifications,node_chatpage,node_callpage,node_api,node_visitor toneBlue
class node_server,node_authroutes,node_userroutes,node_chatroutes,node_authcontroller,node_usercontroller,node_chatcontroller,node_protect,node_mongo toneAmber
class node_dbconn,node_user,node_requests toneMint
class node_streamlib toneRose
class node_stream toneIndigo
```

## Components

### Web app

- [Route app](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in pages](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/LoginPage.jsx): `frontend/src/pages/LoginPage.jsx`
- [Sign-up page](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/SignUpPage.jsx): `frontend/src/pages/SignUpPage.jsx`
- [Profile setup](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/OnboardingPage.jsx): `frontend/src/pages/OnboardingPage.jsx`
- [People discovery](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Friend requests](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/NotificationsPage.jsx): `frontend/src/pages/NotificationsPage.jsx`
- [Chat screen](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/ChatPage.jsx): `frontend/src/pages/ChatPage.jsx`
- [Call screen](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/pages/CallPage.jsx): `frontend/src/pages/CallPage.jsx`
- [API client](https://github.com/ibrahimkataya/i-stream-app/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`

### Backend API

- [HTTP server](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/server.js): `backend/src/server.js`
- [Auth routes](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/auth.route.js): `backend/src/routes/auth.route.js`
- [User routes](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/user.route.js): `backend/src/routes/user.route.js`
- [Chat routes](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/routes/chat.route.js): `backend/src/routes/chat.route.js`
- [Auth workflows](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Friend workflows](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/controllers/user.controller.js): `backend/src/controllers/user.controller.js`
- [Stream token](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/controllers/chat.controller.js): `backend/src/controllers/chat.controller.js`
- [JWT protection](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/middleware/auth.middleware.js): `backend/src/middleware/auth.middleware.js`

### Persistence

- [DB connection](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/lib/db.js): `backend/src/lib/db.js`
- [User records](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Friend requests](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/models/FriendRequest.js): `backend/src/models/FriendRequest.js`

### External services

- [Stream integration](https://github.com/ibrahimkataya/i-stream-app/blob/main/backend/src/lib/stream.js): `backend/src/lib/stream.js`

### Other components

- **User**
- **MongoDB**
- **Stream service**

## Connections

- User → Route app: uses
- Route app → Sign-in pages: routes
- Route app → Sign-up page: routes
- Route app → Profile setup: routes
- Route app → People discovery: routes
- Route app → Friend requests: routes
- Route app → Chat screen: routes
- Route app → Call screen: routes
- Route app → API client: loads auth
- HTTP server → Auth routes: mounts
- HTTP server → User routes: mounts
- HTTP server → Chat routes: mounts
- Auth routes → Auth workflows: dispatches
- Auth routes → JWT protection: guards
- User routes → Friend workflows: dispatches
- Chat routes → Stream token: dispatches
- JWT protection → User records: loads user
- Auth workflows → User records: reads/writes
- Auth workflows → Stream integration: syncs user
- Friend workflows → User records: reads/writes
- Friend workflows → Friend requests: reads/writes
- Stream token → Stream integration: creates token
- DB connection → MongoDB: connects
- User records → MongoDB: persists
- Friend requests → MongoDB: persists
- Stream integration → Stream service: calls
