# mondalshefali1982-create/nova-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mondalshefali1982-create/nova-ai
- Repository: https://github.com/mondalshefali1982-create/nova-ai

## Overview

NOVA AI is a browser-based AI productivity workspace with serverless API handlers and MongoDB-backed user data. The principal workflow is a user working in the dashboard, which requests AI assistance; the chat handler can use account-scoped memories and an AI provider to return a response. Authentication and conversation synchronization are separate API workflows. The excerpts also show image, planner, and document generation actions. Dashboard internals and some integrations are only partially sampled, so unsupported connections are omitted.

Main entry points: [`api/ai.js`](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/ai.js) (AI actions API), [`api/auth.js`](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/auth.js) (Authentication API), [`api/_utils/db.js`](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_utils/db.js) (Database connection), [`api/sync.js`](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/sync.js) (Data sync API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_dashboard["Productivity dashboard<br/>[dashboard.js]"]
  node_browser_store[("Browser state<br/>[dashboard.js]")]
  node_login_ui["Login interface<br/>[login.js]"]
end

subgraph group_api["API workflows"]
  node_auth_api["Authentication API<br/>[auth.js]"]
  node_ai_api["AI actions API<br/>[ai.js]"]
  node_sync_api["Data sync API<br/>[sync.js]"]
end

subgraph group_services["AI and persistence"]
  node_token_verify["Token verification<br/>[auth.js]"]
  node_db_connect["Database connection<br/>[db.js]"]
  node_user_model[("User records<br/>[User.js]")]
  node_memory_model[("User memories<br/>[Memory.js]")]
  node_conversation_model[("Conversations<br/>[Conversation.js]")]
  node_ai_provider["AI provider gateway<br/>[gemini.js]"]
end

node_user(("User"))
node_mongo[("MongoDB")]
node_model_services["AI model services"]
node_image_services["Image services"]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"persists state"| node_browser_store
node_dashboard -->|"requests AI actions"| node_ai_api
node_login_ui -.->|"submits credentials"| node_auth_api
node_auth_api -->|"connects"| node_db_connect
node_auth_api -->|"reads and creates"| node_user_model
node_auth_api -->|"verifies session"| node_token_verify
node_ai_api -->|"connects"| node_db_connect
node_ai_api -->|"verifies session"| node_token_verify
node_ai_api -->|"reads and saves"| node_memory_model
node_ai_api -->|"requests generation"| node_ai_provider
node_ai_api -->|"requests images"| node_image_services
node_sync_api -->|"connects"| node_db_connect
node_sync_api -->|"verifies session"| node_token_verify
node_sync_api -->|"reads and updates"| node_conversation_model
node_db_connect -->|"connects"| node_mongo
node_ai_provider -->|"calls models"| node_model_services

click node_dashboard "https://github.com/mondalshefali1982-create/nova-ai/blob/main/dashboard.js"
click node_browser_store "https://github.com/mondalshefali1982-create/nova-ai/blob/main/dashboard.js"
click node_login_ui "https://github.com/mondalshefali1982-create/nova-ai/blob/main/login.js"
click node_auth_api "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/auth.js"
click node_ai_api "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/ai.js"
click node_sync_api "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/sync.js"
click node_token_verify "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_utils/auth.js"
click node_db_connect "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_utils/db.js"
click node_user_model "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_models/User.js"
click node_memory_model "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_models/Memory.js"
click node_conversation_model "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_models/Conversation.js"
click node_ai_provider "https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_lib/gemini.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_dashboard,node_browser_store,node_login_ui,node_user toneBlue
class node_auth_api,node_ai_api,node_sync_api,node_mongo toneAmber
class node_token_verify,node_db_connect,node_user_model,node_memory_model,node_conversation_model,node_ai_provider toneMint
class node_model_services,node_image_services toneIndigo
```

## Components

### Browser experience

- [Productivity dashboard](https://github.com/mondalshefali1982-create/nova-ai/blob/main/dashboard.js): `dashboard.js`
- [Browser state](https://github.com/mondalshefali1982-create/nova-ai/blob/main/dashboard.js): `dashboard.js`
- [Login interface](https://github.com/mondalshefali1982-create/nova-ai/blob/main/login.js): `login.js`

### API workflows

- [Authentication API](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/auth.js): `api/auth.js`
- [AI actions API](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/ai.js): `api/ai.js`
- [Data sync API](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/sync.js): `api/sync.js`

### AI and persistence

- [Token verification](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_utils/auth.js): `api/_utils/auth.js`
- [Database connection](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_utils/db.js): `api/_utils/db.js`
- [User records](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_models/User.js): `api/_models/User.js`
- [User memories](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_models/Memory.js): `api/_models/Memory.js`
- [Conversations](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_models/Conversation.js): `api/_models/Conversation.js`
- [AI provider gateway](https://github.com/mondalshefali1982-create/nova-ai/blob/main/api/_lib/gemini.js): `api/_lib/gemini.js`

### Other components

- **User**
- **MongoDB**
- **AI model services**
- **Image services**

## Connections

- User → Productivity dashboard: uses (evidence: `dashboard.js`)
- Productivity dashboard → Browser state: persists state (evidence: `dashboard.js`)
- Productivity dashboard → AI actions API: requests AI actions (evidence: `dashboard.js`)
- Login interface → Authentication API: submits credentials
- Authentication API → Database connection: connects (evidence: `api/auth.js`)
- Authentication API → User records: reads and creates (evidence: `api/auth.js`)
- Authentication API → Token verification: verifies session (evidence: `api/auth.js`)
- AI actions API → Database connection: connects (evidence: `api/ai.js`)
- AI actions API → Token verification: verifies session (evidence: `api/ai.js`)
- AI actions API → User memories: reads and saves (evidence: `api/ai.js`)
- AI actions API → AI provider gateway: requests generation (evidence: `api/ai.js`)
- AI actions API → Image services: requests images (evidence: `api/ai.js`)
- Data sync API → Database connection: connects (evidence: `api/sync.js`)
- Data sync API → Token verification: verifies session (evidence: `api/sync.js`)
- Data sync API → Conversations: reads and updates (evidence: `api/sync.js`)
- Database connection → MongoDB: connects (evidence: `api/_utils/db.js`)
- AI provider gateway → AI model services: calls models (evidence: `api/_lib/gemini.js`)
