# yashchavan05/memora architecture

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

- Interactive diagram: https://gitdiagram.com/yashchavan05/memora
- Repository: https://github.com/yashchavan05/memora

## Overview

Memora is a React/Express GitHub intelligence platform. Users authenticate, connect GitHub, explore repositories and issues, and use AI-assisted issue analysis and project-context search; the README also describes risk-aware commit analysis and a health dashboard. The graph preserves those documented capabilities, but source evidence is incomplete: some page-to-API flows and context-route behavior are not shown, so those links are omitted. Dashed links mark documented capabilities whose implementation wiring was not sampled.

Main entry points: [`frontend/src/App.tsx`](https://github.com/yashchavan05/memora/blob/main/frontend/src/App.tsx) (Route shell), [`backend/services/aiService.js`](https://github.com/yashchavan05/memora/blob/main/backend/services/aiService.js) (AI analysis engine), [`backend/middleware/authMiddleware.js`](https://github.com/yashchavan05/memora/blob/main/backend/middleware/authMiddleware.js) (Token protection), [`backend/server.js`](https://github.com/yashchavan05/memora/blob/main/backend/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route shell<br/>[App.tsx]"]
  node_authui["Auth state<br/>[AuthContext.tsx]"]
  node_dashboard["Health dashboard<br/>[DashboardPage.tsx]"]
  node_repos["Repository browser"]
  node_issues["Issue browser<br/>[IssuesPage.tsx]"]
  node_issuecontext["Issue analysis view"]
  node_contextsearch["Project context search"]
  node_integrationsui["Integration settings"]
  node_authservice["Auth API client<br/>[authService.ts]"]
  node_aiserviceui["AI API client<br/>[aiService.js]"]
  node_githubserviceui["GitHub API client<br/>[githubService.js]"]
  node_integrationservice["Integration API client"]
end

subgraph group_api["API and identity"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_githroutes["GitHub routes<br/>[githubRoutes.js]"]
  node_airoutes["AI routes<br/>[aiRoutes.js]"]
  node_integrationroutes["Integration routes"]
  node_authcontroller["Authentication logic<br/>[authController.js]"]
  node_authmiddleware["Token protection<br/>[authMiddleware.js]"]
end

subgraph group_github["GitHub integration"]
  node_githubcontroller["GitHub handlers"]
  node_githubservice["GitHub data service<br/>[githubService.js]"]
  node_integrationcontroller["GitHub connection and sync"]
  node_github{{"GitHub API"}}
end

subgraph group_intelligence["AI intelligence"]
  node_aicontroller["AI handlers<br/>[aiController.js]"]
  node_aiservice["AI analysis engine<br/>[aiService.js]"]
  node_llms{{"Gemini / OpenAI"}}
end

subgraph group_persistence["User state"]
  node_userdb[("MongoDB user records<br/>[User.js]")]
  node_mongodb[("MongoDB")]
end

node_user(("Team member"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_authui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_repos
node_app -->|"routes to"| node_issues
node_app -->|"routes to"| node_issuecontext
node_app -->|"routes to"| node_contextsearch
node_app -->|"routes to"| node_integrationsui
node_authui -->|"calls"| node_authservice
node_issuecontext -->|"calls"| node_aiserviceui
node_issuecontext -->|"calls"| node_githubserviceui
node_integrationsui -->|"calls"| node_integrationservice
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_githroutes
node_server -->|"mounts"| node_airoutes
node_server -->|"mounts"| node_integrationroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"protects"| node_authmiddleware
node_githroutes -->|"dispatches"| node_githubcontroller
node_githroutes -->|"protects"| node_authmiddleware
node_airoutes -->|"dispatches"| node_aicontroller
node_airoutes -->|"protects"| node_authmiddleware
node_integrationroutes -->|"dispatches"| node_integrationcontroller
node_integrationroutes -->|"protects"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_userdb
node_authmiddleware -->|"loads user"| node_userdb
node_integrationcontroller -->|"updates connection"| node_userdb
node_githubcontroller -->|"delegates"| node_githubservice
node_aicontroller -->|"delegates"| node_aiservice
node_aicontroller -->|"uses data"| node_githubservice
node_integrationcontroller -->|"OAuth and sync"| node_github
node_githubservice -->|"fetches GitHub data"| node_github
node_aiservice -.->|"analyzes with"| node_llms
node_userdb -.->|"stores records"| node_mongodb
node_aiservice -.->|"supports issue analysis"| node_issuecontext
node_aiservice -.->|"supports context answers"| node_contextsearch
node_aiservice -.->|"provides health insights"| node_dashboard
node_aiservice -.->|"analyzes commits and issues"| node_githubservice

click node_app "https://github.com/yashchavan05/memora/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/yashchavan05/memora/blob/main/frontend/src/context/AuthContext.tsx"
click node_dashboard "https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_repos "https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/RepositoriesPage.tsx"
click node_issues "https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/IssuesPage.tsx"
click node_issuecontext "https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/IssueContextPage.tsx"
click node_contextsearch "https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/ContextSearchPage.tsx"
click node_integrationsui "https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/IntegrationsPage.tsx"
click node_authservice "https://github.com/yashchavan05/memora/blob/main/frontend/src/services/authService.ts"
click node_aiserviceui "https://github.com/yashchavan05/memora/blob/main/frontend/src/services/aiService.js"
click node_githubserviceui "https://github.com/yashchavan05/memora/blob/main/frontend/src/services/githubService.js"
click node_integrationservice "https://github.com/yashchavan05/memora/blob/main/frontend/src/services/integrationService.ts"
click node_server "https://github.com/yashchavan05/memora/blob/main/backend/server.js"
click node_authroutes "https://github.com/yashchavan05/memora/blob/main/backend/routes/authRoutes.js"
click node_githroutes "https://github.com/yashchavan05/memora/blob/main/backend/routes/githubRoutes.js"
click node_airoutes "https://github.com/yashchavan05/memora/blob/main/backend/routes/aiRoutes.js"
click node_integrationroutes "https://github.com/yashchavan05/memora/blob/main/backend/routes/integrationRoutes.js"
click node_authcontroller "https://github.com/yashchavan05/memora/blob/main/backend/controllers/authController.js"
click node_authmiddleware "https://github.com/yashchavan05/memora/blob/main/backend/middleware/authMiddleware.js"
click node_githubcontroller "https://github.com/yashchavan05/memora/blob/main/backend/controllers/githubController.js"
click node_githubservice "https://github.com/yashchavan05/memora/blob/main/backend/services/githubService.js"
click node_integrationcontroller "https://github.com/yashchavan05/memora/blob/main/backend/controllers/integrationController.js"
click node_aicontroller "https://github.com/yashchavan05/memora/blob/main/backend/controllers/aiController.js"
click node_aiservice "https://github.com/yashchavan05/memora/blob/main/backend/services/aiService.js"
click node_userdb "https://github.com/yashchavan05/memora/blob/main/backend/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_app,node_authui,node_dashboard,node_repos,node_issues,node_issuecontext,node_contextsearch,node_integrationsui,node_authservice,node_aiserviceui,node_githubserviceui,node_integrationservice toneBlue
class node_server,node_authroutes,node_githroutes,node_airoutes,node_integrationroutes,node_authcontroller,node_authmiddleware toneAmber
class node_githubcontroller,node_githubservice,node_integrationcontroller,node_github toneMint
class node_aicontroller,node_aiservice,node_llms toneRose
class node_userdb,node_mongodb,node_user toneIndigo
```

## Components

### Web application

- [Route shell](https://github.com/yashchavan05/memora/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth state](https://github.com/yashchavan05/memora/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Health dashboard](https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Repository browser](https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/RepositoriesPage.tsx): `frontend/src/pages/RepositoriesPage.tsx`
- [Issue browser](https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/IssuesPage.tsx): `frontend/src/pages/IssuesPage.tsx`
- [Issue analysis view](https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/IssueContextPage.tsx): `frontend/src/pages/IssueContextPage.tsx`
- [Project context search](https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/ContextSearchPage.tsx): `frontend/src/pages/ContextSearchPage.tsx`
- [Integration settings](https://github.com/yashchavan05/memora/blob/main/frontend/src/pages/IntegrationsPage.tsx): `frontend/src/pages/IntegrationsPage.tsx`
- [Auth API client](https://github.com/yashchavan05/memora/blob/main/frontend/src/services/authService.ts): `frontend/src/services/authService.ts`
- [AI API client](https://github.com/yashchavan05/memora/blob/main/frontend/src/services/aiService.js): `frontend/src/services/aiService.js`
- [GitHub API client](https://github.com/yashchavan05/memora/blob/main/frontend/src/services/githubService.js): `frontend/src/services/githubService.js`
- [Integration API client](https://github.com/yashchavan05/memora/blob/main/frontend/src/services/integrationService.ts): `frontend/src/services/integrationService.ts`

### API and identity

- [Express server](https://github.com/yashchavan05/memora/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/yashchavan05/memora/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [GitHub routes](https://github.com/yashchavan05/memora/blob/main/backend/routes/githubRoutes.js): `backend/routes/githubRoutes.js`
- [AI routes](https://github.com/yashchavan05/memora/blob/main/backend/routes/aiRoutes.js): `backend/routes/aiRoutes.js`
- [Integration routes](https://github.com/yashchavan05/memora/blob/main/backend/routes/integrationRoutes.js): `backend/routes/integrationRoutes.js`
- [Authentication logic](https://github.com/yashchavan05/memora/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Token protection](https://github.com/yashchavan05/memora/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### GitHub integration

- [GitHub handlers](https://github.com/yashchavan05/memora/blob/main/backend/controllers/githubController.js): `backend/controllers/githubController.js`
- [GitHub data service](https://github.com/yashchavan05/memora/blob/main/backend/services/githubService.js): `backend/services/githubService.js`
- [GitHub connection and sync](https://github.com/yashchavan05/memora/blob/main/backend/controllers/integrationController.js): `backend/controllers/integrationController.js`
- **GitHub API**

### AI intelligence

- [AI handlers](https://github.com/yashchavan05/memora/blob/main/backend/controllers/aiController.js): `backend/controllers/aiController.js`
- [AI analysis engine](https://github.com/yashchavan05/memora/blob/main/backend/services/aiService.js): `backend/services/aiService.js`
- **Gemini / OpenAI**

### User state

- [MongoDB user records](https://github.com/yashchavan05/memora/blob/main/backend/models/User.js): `backend/models/User.js`
- **MongoDB**

### Other components

- **Team member**

## Connections

- Team member → Route shell: uses (evidence: `frontend/src/App.tsx`)
- Route shell → Auth state: provides auth (evidence: `frontend/src/App.tsx`)
- Route shell → Health dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Repository browser: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Issue browser: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Issue analysis view: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Project context search: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Integration settings: routes to (evidence: `frontend/src/App.tsx`)
- Auth state → Auth API client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- Issue analysis view → AI API client: calls (evidence: `frontend/src/pages/IssueContextPage.tsx`)
- Issue analysis view → GitHub API client: calls (evidence: `frontend/src/pages/IssueContextPage.tsx`)
- Integration settings → Integration API client: calls (evidence: `frontend/src/pages/IntegrationsPage.tsx`)
- Express server → Authentication routes: mounts (evidence: `backend/server.js`)
- Express server → GitHub routes: mounts (evidence: `backend/server.js`)
- Express server → AI routes: mounts (evidence: `backend/server.js`)
- Express server → Integration routes: mounts (evidence: `backend/server.js`)
- Authentication routes → Authentication logic: dispatches (evidence: `backend/routes/authRoutes.js`)
- Authentication routes → Token protection: protects (evidence: `backend/routes/authRoutes.js`)
- GitHub routes → GitHub handlers: dispatches (evidence: `backend/routes/githubRoutes.js`)
- GitHub routes → Token protection: protects (evidence: `backend/routes/githubRoutes.js`)
- AI routes → AI handlers: dispatches (evidence: `backend/routes/aiRoutes.js`)
- AI routes → Token protection: protects (evidence: `backend/routes/aiRoutes.js`)
- Integration routes → GitHub connection and sync: dispatches (evidence: `backend/routes/integrationRoutes.js`)
- Integration routes → Token protection: protects (evidence: `backend/routes/integrationRoutes.js`)
- Authentication logic → MongoDB user records: reads and writes (evidence: `backend/controllers/authController.js`)
- Token protection → MongoDB user records: loads user (evidence: `backend/middleware/authMiddleware.js`)
- GitHub connection and sync → MongoDB user records: updates connection (evidence: `backend/controllers/integrationController.js`)
- GitHub handlers → GitHub data service: delegates (evidence: `backend/controllers/githubController.js`)
- AI handlers → AI analysis engine: delegates (evidence: `backend/controllers/aiController.js`)
- AI handlers → GitHub data service: uses data (evidence: `backend/controllers/aiController.js`)
- GitHub connection and sync → GitHub API: OAuth and sync (evidence: `backend/controllers/integrationController.js`)
- GitHub data service → GitHub API: fetches GitHub data (evidence: `backend/services/githubService.js`)
- AI analysis engine → Gemini / OpenAI: analyzes with
- MongoDB user records → MongoDB: stores records
- AI analysis engine → Issue analysis view: supports issue analysis
- AI analysis engine → Project context search: supports context answers
- AI analysis engine → Health dashboard: provides health insights
- AI analysis engine → GitHub data service: analyzes commits and issues
