# navuluribalaji/ai-inventory architecture

> Architecture diagram of the GitHub repository navuluribalaji/ai-inventory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/navuluribalaji/ai-inventory
- Repository: https://github.com/navuluribalaji/ai-inventory

## Overview

##### Project type and purpose
- Frontend: React + TypeScript + Tailwind CSS (SPA served via Vite)
- Backend: Node.js + Express (newsletter endpoint, plus MongoDB integration for data persistence)
- Database: MongoDB (user subscriptions, potentially news or model metadata)
- External Services: Email/SMS provider via Nodemailer, optional news‐API

##### File structure
- Top‐level:
- package.json / lock: Node deps
- vite.config.ts, tsconfig*.json, tailwind.config.js, postcss.config.js, eslint.config.js: build/tooling
- index.html + public/: static assets (robots.txt, sitemap.xml, ads.txt)
- backend/ newsletter.js: Express route to accept newsletter signup & send email
- src/: React app
– src/main.tsx → React entry point
– src/App.tsx → root component
– src/components/: UI widgets (SEO, cards, footer, newsletter form, etc.)
– src/pages/: route components (Home, CategoryPage, ModelDetail, Terminology)
– src/data/models.ts: static model data
– src/utils/seo.ts: SEO helper functions
– src/types/: TypeScript types
- The split between “backend” folder and “src” clearly indicates a two-tier separation: browser app vs. REST API.

##### README for additional insights
- Confirms the architecture: React SPA + Express API + MongoDB + Nodemailer

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (Vercel)" 
        direction TB
        VERCEL["Vercel (Static Hosting)"]:::external
        FSAS["React SPA"]:::frontend
        VERCEL --> FSAS

        subgraph "Source Files" 
            direction TB
            SRC["src/"]:::frontend
            MAIN["main.tsx"]:::frontend
            APP["App.tsx"]:::frontend
            COMPS["components/"]:::frontend
            PAGES["pages/"]:::frontend
            DATA["models.ts"]:::frontend
            UTILS["seo.ts"]:::frontend
            SEOComp["SEO.tsx"]:::frontend
            NEWSComp["newsletter.tsx"]:::frontend
            STYLES["index.css"]:::frontend
            TWCFG["tailwind.config.js"]:::frontend
            VITE["vite.config.ts"]:::frontend
            INDEXHTML["index.html"]:::frontend
            PUBLIC["public/"]:::frontend
        end
    end

    %% Backend Layer
    subgraph "Backend (Render)"
        direction TB
        RENDER["Render (API Hosting)"]:::external
        API["Express API"]:::backend
        NEWSENDP["newsletter.js"]:::backend
        RENDER --> API
        API --> NEWSENDP
    end

    %% Data Stores and External Services
    DB["MongoDB Atlas"]:::db
    SMTP["SMTP Service"]:::external
    NEWSAPI["External News API"]:::external

    %% User Browser
    BROWSER["User's Browser"]:::external

    %% Data Flows
    BROWSER --> FSAS
    BROWSER -->|REST calls| API
    API -->|read/write| DB
    API -->|send email| SMTP
    API -->|fetch news| NEWSAPI

    %% Click Events
    click SRC "https://github.com/navuluribalaji/ai-inventory/tree/main/src/"
    click MAIN "https://github.com/navuluribalaji/ai-inventory/blob/main/src/main.tsx"
    click APP "https://github.com/navuluribalaji/ai-inventory/blob/main/src/App.tsx"
    click COMPS "https://github.com/navuluribalaji/ai-inventory/tree/main/src/components/"
    click PAGES "https://github.com/navuluribalaji/ai-inventory/tree/main/src/pages/"
    click DATA "https://github.com/navuluribalaji/ai-inventory/blob/main/src/data/models.ts"
    click UTILS "https://github.com/navuluribalaji/ai-inventory/blob/main/src/utils/seo.ts"
    click SEOComp "https://github.com/navuluribalaji/ai-inventory/blob/main/src/components/SEO.tsx"
    click NEWSComp "https://github.com/navuluribalaji/ai-inventory/blob/main/src/components/newsletter.tsx"
    click STYLES "https://github.com/navuluribalaji/ai-inventory/blob/main/src/index.css"
    click TWCFG "https://github.com/navuluribalaji/ai-inventory/blob/main/tailwind.config.js"
    click VITE "https://github.com/navuluribalaji/ai-inventory/blob/main/vite.config.ts"
    click INDEXHTML "https://github.com/navuluribalaji/ai-inventory/blob/main/index.html"
    click PUBLIC "https://github.com/navuluribalaji/ai-inventory/tree/main/public/"
    click NEWSENDP "https://github.com/navuluribalaji/ai-inventory/blob/main/backend/newsletter.js"
    click API "https://github.com/navuluribalaji/ai-inventory/blob/main/package.json"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#0284C7,stroke-width:2px
    classDef backend fill:#D5FDD5,stroke:#0B6623,stroke-width:2px
    classDef db fill:#FFF4CC,stroke:#D69E2E,stroke-width:2px,stroke-dasharray: 5 5
    classDef external fill:#F3F4F6,stroke:#6B7280,stroke-width:2px,stroke-dasharray: 3 3
```
