# muskansyd/jemrox_ai_project architecture

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

- Interactive diagram: https://gitdiagram.com/muskansyd/jemrox_ai_project
- Repository: https://github.com/muskansyd/jemrox_ai_project

## Overview

Jemrox is a browser-based AI assistant with tech chat and AI website-building modes, backed by a FastAPI service. Users authenticate, then submit prompts; the chat endpoint retrieves recent conversation history, invokes the AI service, and stores the exchange. The frontend also manages chat and project views, uploads, and browser-local preferences. The excerpts do not show the frontend’s backend URL or the full project-persistence implementation, so those links are left unverified; no README was provided.

Main entry points: [`frontend/script.js`](https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js) (App interface), [`backend/auth.py`](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py) (FastAPI endpoints), [`backend/ai_service.py`](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/ai_service.py) (Prompt and response generation), [`backend/database.py`](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/database.py) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser app"]
  node_webapp["App interface<br/>[script.js]"]
  node_authforms["Auth forms<br/>[script.js]"]
  node_chat["Chat management<br/>[script.js]"]
  node_builder["Website builder<br/>[script.js]"]
  node_uploads["File uploads<br/>[script.js]"]
  node_browserstore[("Browser storage")]
end

subgraph group_api["API and auth"]
  node_api["FastAPI endpoints<br/>[auth.py]"]
  node_credentials["Credential and token handling<br/>[auth.py]"]
  node_chatflow["Chat orchestration<br/>[auth.py]"]
end

subgraph group_ai["AI generation"]
  node_aiservice["Prompt and response generation<br/>[ai_service.py]"]
end

subgraph group_storage["Persistence"]
  node_dbaccess["Database access<br/>[database.py]"]
end

node_user(("User"))
node_groq{{"Groq API"}}
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_webapp
node_webapp -->|"opens"| node_authforms
node_authforms -.->|"submits auth"| node_api
node_webapp -->|"selects mode"| node_chat
node_chat -.->|"sends prompt"| node_api
node_webapp -->|"shows builder"| node_builder
node_builder -->|"renders reply"| node_chat
node_webapp -->|"accepts files"| node_uploads
node_webapp -->|"stores settings"| node_browserstore
node_api -->|"handles credentials"| node_credentials
node_api -->|"routes chat"| node_chatflow
node_chatflow -->|"reads and writes"| node_dbaccess
node_chatflow -->|"requests response"| node_aiservice
node_aiservice -->|"requests completion"| node_groq
node_dbaccess -->|"connects"| node_postgres

click node_webapp "https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js"
click node_authforms "https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js"
click node_chat "https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js"
click node_builder "https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js"
click node_uploads "https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js"
click node_api "https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py"
click node_credentials "https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py"
click node_chatflow "https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py"
click node_aiservice "https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/ai_service.py"
click node_dbaccess "https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/database.py"

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_webapp,node_authforms,node_chat,node_builder,node_uploads,node_browserstore,node_user toneBlue
class node_api,node_credentials,node_chatflow,node_postgres toneAmber
class node_aiservice,node_groq toneMint
class node_dbaccess toneRose
```

## Components

### Browser app

- [App interface](https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js): `frontend/script.js`
- [Auth forms](https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js): `frontend/script.js`
- [Chat management](https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js): `frontend/script.js`
- [Website builder](https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js): `frontend/script.js`
- [File uploads](https://github.com/muskansyd/jemrox_ai_project/blob/main/frontend/script.js): `frontend/script.js`
- **Browser storage**

### API and auth

- [FastAPI endpoints](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py): `backend/auth.py`
- [Credential and token handling](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py): `backend/auth.py`
- [Chat orchestration](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/auth.py): `backend/auth.py`

### AI generation

- [Prompt and response generation](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/ai_service.py): `backend/ai_service.py`

### Persistence

- [Database access](https://github.com/muskansyd/jemrox_ai_project/blob/main/backend/database.py): `backend/database.py`

### Other components

- **User**
- **Groq API**
- **PostgreSQL**

## Connections

- User → App interface: uses (evidence: `frontend/script.js`)
- App interface → Auth forms: opens (evidence: `frontend/script.js`)
- Auth forms → FastAPI endpoints: submits auth
- App interface → Chat management: selects mode (evidence: `frontend/script.js`)
- Chat management → FastAPI endpoints: sends prompt
- App interface → Website builder: shows builder (evidence: `frontend/script.js`)
- Website builder → Chat management: renders reply (evidence: `frontend/script.js`)
- App interface → File uploads: accepts files (evidence: `frontend/script.js`)
- App interface → Browser storage: stores settings (evidence: `frontend/script.js`)
- FastAPI endpoints → Credential and token handling: handles credentials (evidence: `backend/auth.py`)
- FastAPI endpoints → Chat orchestration: routes chat (evidence: `backend/auth.py`)
- Chat orchestration → Database access: reads and writes (evidence: `backend/auth.py`)
- Chat orchestration → Prompt and response generation: requests response (evidence: `backend/auth.py`)
- Prompt and response generation → Groq API: requests completion (evidence: `backend/ai_service.py`)
- Database access → PostgreSQL: connects (evidence: `backend/database.py`)
