# shailesh-sharma369/earthlygen architecture

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

- Interactive diagram: https://gitdiagram.com/shailesh-sharma369/earthlygen
- Repository: https://github.com/shailesh-sharma369/earthlygen

## Overview

EarthlyGen (RUHI) is a conversational voice/text assistant joined to a social-commerce application. The main workflow runs from a user request through the frontend and Python AI server/controller, which interprets intent, resolves context, and either responds or calls application APIs; results return to the interface. The application also supports independent commerce, social/community, identity, and eco-trust workflows. Edges are limited to relationships visible in excerpts, the source index, or README; unsampled subsystem links are omitted rather than inferred.

Main entry points: [`Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js) (Application API), [`AIVS/agentic_ai/controller.py`](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/controller.py) (Agent controller), [`Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/middleware/auth.js`](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/middleware/auth.js) (JWT authentication), [`Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js`](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js) (Orders and payments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ai["Agent orchestration"]
  node_ai_server["AI request server<br/>[server.py]"]
  node_controller["Agent controller<br/>[controller.py]"]
  node_brain["Mistral reasoning<br/>[mistral_brain.py]"]
  node_context["Context resolver"]
  node_memory[("Session memory<br/>[session_memory.py]")]
  node_planner["Action planner<br/>[simple_planner.py]"]
end

subgraph group_commerce["Commerce workflows"]
  node_orders["Orders and payments<br/>[orderroutes.js]"]
  node_payment["Payment confirmation<br/>[paymentRoutes.js]"]
  node_order_store[("Order records<br/>[order.js]")]
  node_products[("Product catalog<br/>[product.js]")]
end

subgraph group_social["Social and eco"]
  node_community["Groups and events<br/>[groupRoutes.js]"]
  node_messaging["Direct messaging<br/>[messageRoutes.js]"]
  node_posts["Social and eco posts<br/>[postroutes.js]"]
  node_notifications["Notifications"]
  node_eco_verify["Eco verification"]
end

subgraph group_platform["Application platform"]
  node_frontend["Assistant interface<br/>[assistant_logic.py]"]
  node_backend["Application API<br/>[server.js]"]
  node_auth["JWT authentication<br/>[auth.js]"]
  node_db[("MongoDB<br/>[db.js]")]
  node_users["User accounts<br/>[userRoutes.js]"]
end

node_user(("User"))

node_user -->|"interacts"| node_frontend
node_frontend -->|"sends request"| node_ai_server
node_ai_server -->|"dispatches"| node_controller
node_controller -->|"requests reasoning"| node_brain
node_controller -->|"resolves arguments"| node_context
node_context -->|"reads context"| node_memory
node_controller -->|"stores turns"| node_memory
node_controller -->|"plans actions"| node_planner
node_controller -->|"calls APIs"| node_backend
node_backend -->|"uses middleware"| node_auth
node_backend -->|"connects database"| node_db
node_backend -->|"mounts routes"| node_orders
node_backend -->|"mounts routes"| node_payment
node_backend -->|"mounts routes"| node_users
node_backend -->|"mounts routes"| node_community
node_backend -->|"mounts routes"| node_messaging
node_backend -->|"mounts routes"| node_posts
node_backend -->|"mounts routes"| node_eco_verify
node_orders -->|"reads and writes"| node_order_store
node_orders -->|"reads products"| node_products
node_payment -->|"creates order"| node_order_store
node_posts -->|"notifies activity"| node_notifications
node_community -->|"authenticates requests"| node_auth
node_messaging -->|"authenticates requests"| node_auth
node_users -->|"authenticates requests"| node_auth

click node_frontend "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/frontend/assistant_logic.py"
click node_ai_server "https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/server.py"
click node_controller "https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/controller.py"
click node_brain "https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/brain/mistral_brain.py"
click node_context "https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/resolver/context_resolver.py"
click node_memory "https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/memory/session_memory.py"
click node_planner "https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/planner/simple_planner.py"
click node_backend "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js"
click node_auth "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/middleware/auth.js"
click node_db "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/config/db.js"
click node_users "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/userRoutes.js"
click node_orders "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js"
click node_payment "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/paymentRoutes.js"
click node_order_store "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/models/order.js"
click node_products "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/models/product.js"
click node_community "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/groupRoutes.js"
click node_messaging "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/messageRoutes.js"
click node_posts "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/postroutes.js"
click node_notifications "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/utils/notificationService.js"
click node_eco_verify "https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/ecoVerificationRoutes.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_ai_server,node_controller,node_brain,node_context,node_memory,node_planner,node_user toneBlue
class node_orders,node_payment,node_order_store,node_products toneAmber
class node_community,node_messaging,node_posts,node_notifications,node_eco_verify toneMint
class node_frontend,node_backend,node_auth,node_db,node_users toneRose
```

## Components

### Agent orchestration

- [AI request server](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/server.py): `AIVS/agentic_ai/server.py`
- [Agent controller](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/controller.py): `AIVS/agentic_ai/controller.py`
- [Mistral reasoning](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/brain/mistral_brain.py): `AIVS/agentic_ai/brain/mistral_brain.py`
- [Context resolver](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/resolver/context_resolver.py): `AIVS/agentic_ai/resolver/context_resolver.py`
- [Session memory](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/memory/session_memory.py): `AIVS/agentic_ai/memory/session_memory.py`
- [Action planner](https://github.com/shailesh-sharma369/earthlygen/blob/main/AIVS/agentic_ai/planner/simple_planner.py): `AIVS/agentic_ai/planner/simple_planner.py`

### Commerce workflows

- [Orders and payments](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js`
- [Payment confirmation](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/paymentRoutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/paymentRoutes.js`
- [Order records](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/models/order.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/models/order.js`
- [Product catalog](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/models/product.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/models/product.js`

### Social and eco

- [Groups and events](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/groupRoutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/groupRoutes.js`
- [Direct messaging](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/messageRoutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/messageRoutes.js`
- [Social and eco posts](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/postroutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/postroutes.js`
- [Notifications](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/utils/notificationService.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/utils/notificationService.js`
- [Eco verification](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/ecoVerificationRoutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/ecoVerificationRoutes.js`

### Application platform

- [Assistant interface](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/frontend/assistant_logic.py): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/frontend/assistant_logic.py`
- [Application API](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`
- [JWT authentication](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/middleware/auth.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/middleware/auth.js`
- [MongoDB](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/config/db.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/config/db.js`
- [User accounts](https://github.com/shailesh-sharma369/earthlygen/blob/main/Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/userRoutes.js): `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/userRoutes.js`

### Other components

- **User**

## Connections

- User → Assistant interface: interacts
- Assistant interface → AI request server: sends request
- AI request server → Agent controller: dispatches (evidence: `AIVS/agentic_ai/server.py`)
- Agent controller → Mistral reasoning: requests reasoning
- Agent controller → Context resolver: resolves arguments (evidence: `AIVS/agentic_ai/controller.py`)
- Context resolver → Session memory: reads context (evidence: `AIVS/agentic_ai/resolver/context_resolver.py`)
- Agent controller → Session memory: stores turns (evidence: `AIVS/agentic_ai/controller.py`)
- Agent controller → Action planner: plans actions (evidence: `AIVS/agentic_ai/controller.py`)
- Agent controller → Application API: calls APIs
- Application API → JWT authentication: uses middleware (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → MongoDB: connects database (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → Orders and payments: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → Payment confirmation: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → User accounts: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → Groups and events: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → Direct messaging: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → Social and eco posts: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Application API → Eco verification: mounts routes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/server.js`)
- Orders and payments → Order records: reads and writes (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js`)
- Orders and payments → Product catalog: reads products (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/orderroutes.js`)
- Payment confirmation → Order records: creates order (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/paymentRoutes.js`)
- Social and eco posts → Notifications: notifies activity (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/postroutes.js`)
- Groups and events → JWT authentication: authenticates requests (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/groupRoutes.js`)
- Direct messaging → JWT authentication: authenticates requests (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/messageRoutes.js`)
- User accounts → JWT authentication: authenticates requests (evidence: `Nova/EcoSoul-Jarvis/EcoSoul-Jarvis/backend/routes/userRoutes.js`)
