# yogeshkanwade21/project_intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/yogeshkanwade21/project_intelligence
- Repository: https://github.com/yogeshkanwade21/project_intelligence

## Overview

##### Project type and purpose
- This is a full-stack, microservices-style application with three main containers:
- Frontend (React + Vite + Tailwind SPA)
- Auth service (FastAPI + Zoho integration)
- Backend orchestrator service (FastAPI + intent extraction + JQL generation + Jira API)
- It uses Docker Compose for local orchestration and communicates with two external APIs (Zoho for authentication, Jira for data).

##### File structure
- Root: docker-compose.yml, .env template for Jira credentials
- /frontend: React/Vite code (TSX components, API client, tests)
- /auth: Python FastAPI microservice (routers/zoho, config, constants, utils)
- /backend: Python FastAPI microservice (orchestrator modules, Jira service, routes)
- CI pipeline: .github/workflows/frontend-tests.yml

##### README for insights
- Docker-based local setup, environment variables for Jira
- No internal database—state is ephemeral or managed by external systems

##### Main components
a. Frontend Client
- React SPA served via Vite (port via Docker)
- Components: ChatWindow, LoginPage, service.ts API client
b. Auth Service
- FastAPI app (auth/main.py)
- Zoho Auth router (auth/routers/zoho/auth.py)
- Config & constants (auth/config.py, status codes, messages)
c. Orchestrator (Backend Service)
- FastAPI app (backend/app/main.py)
- Intent Extractor (backend/app/orchestrator/intent_extractor.py)
- JQL Generator (backend/app/orchestrator/jql_generator.py)
- Jira Service (backend/app/services/jira_service.py)
- Routes (backend/app/routes/jira.py)
d. External Services
- Zoho OAuth API
- Jira REST API

1. User ↔ Frontend (HTTP in browser)
2. Frontend → Auth Service (/auth/zoho/login) → Zoho OAuth → Auth Service
3. Auth Service → Frontend (JWT or session token)
4. Frontend → Backend Service (/jira/query) with token
5. Backend Service → Intent Extractor → JQL Generator → Jira Service
6. Jira Service → Jira REST API → Backend Service → Frontend

##### Highlighted architectural patterns
- Microservice separation (Auth vs. Orchestrator)
- Orchestrator pattern in backend to chain intent extraction & JQL generation
- External-integration pattern (Zoho, Jira)
- Clear separation between UI (React), API layer (FastAPI), and external APIs

##### Technologies & frameworks
- Frontend: React, Vite, TypeScript, Tailwind CSS, Vitest, ESLint
- Auth & Backend: Python 3.x, FastAPI, Pydantic, Uvicorn (implied), pip requirements
- Deployment: Docker, Docker Compose

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef auth fill:#D0FFD8,stroke:#333,stroke-width:1px
    classDef backend fill:#FFE4B5,stroke:#333,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#333,stroke-width:1px

    Browser["User Browser"]:::external
    CI["CI Pipeline"]:::external
    DockerCompose["Docker Compose\n(docker-compose.yml)"]:::external

    subgraph "Services (Docker Compose)"
        subgraph "Frontend (React SPA)" 
            FE_App["App.tsx"]:::frontend
            FE_Main["main.tsx"]:::frontend
            FE_Chat["ChatWindow.tsx"]:::frontend
            FE_Login["LoginPage.tsx"]:::frontend
            FE_Service["service.ts"]:::frontend
        end
        subgraph "Auth Service (FastAPI)"
            A_Main["main.py"]:::auth
            A_Config["config.py"]:::auth
            A_Status["status_codes.py"]:::auth
            A_Msg["response_messages.py"]:::auth
            A_Zoho["auth.py"]:::auth
            A_Utils["utils/"]:::auth
        end
        subgraph "Orchestrator Service (Backend)"
            B_Main["main.py"]:::backend
            B_Config["config.py"]:::backend
            B_Intent["intent_extractor.py"]:::backend
            B_JQL["jql_generator.py"]:::backend
            B_JiraServ["jira_service.py"]:::backend
            B_Route["jira.py"]:::backend
        end
    end

    subgraph "External APIs"
        Zoho["Zoho OAuth API"]:::external
        JiraExt["Jira REST API"]:::external
    end

    Browser --> FE_App
    FE_App --> FE_Service
    FE_Service -->|"POST /auth/zoho/login"| A_Zoho
    A_Zoho --> Zoho
    Zoho --> A_Zoho
    A_Zoho -->|"JWT Token"| FE_Service
    FE_Service -->|"POST /jira/query"| B_Route
    B_Route --> B_Intent
    B_Intent --> B_JQL
    B_JQL --> B_JiraServ
    B_JiraServ --> JiraExt
    JiraExt --> B_JiraServ
    B_JiraServ --> B_Route
    B_Route --> FE_Service

    CI -->|"runs tests in"| FE_App

    click FE_App "https://github.com/yogeshkanwade21/project_intelligence/blob/main/frontend/src/App.tsx"
    click FE_Main "https://github.com/yogeshkanwade21/project_intelligence/blob/main/frontend/src/main.tsx"
    click FE_Chat "https://github.com/yogeshkanwade21/project_intelligence/blob/main/frontend/src/components/ChatWindow.tsx"
    click FE_Login "https://github.com/yogeshkanwade21/project_intelligence/blob/main/frontend/src/pages/LoginPage.tsx"
    click FE_Service "https://github.com/yogeshkanwade21/project_intelligence/blob/main/frontend/src/api/service.ts"
    click A_Main "https://github.com/yogeshkanwade21/project_intelligence/blob/main/auth/main.py"
    click A_Config "https://github.com/yogeshkanwade21/project_intelligence/blob/main/auth/config.py"
    click A_Status "https://github.com/yogeshkanwade21/project_intelligence/blob/main/auth/constants/status_codes.py"
    click A_Msg "https://github.com/yogeshkanwade21/project_intelligence/blob/main/auth/constants/response_messages.py"
    click A_Zoho "https://github.com/yogeshkanwade21/project_intelligence/blob/main/auth/routers/zoho/auth.py"
    click A_Utils "https://github.com/yogeshkanwade21/project_intelligence/tree/main/auth/utils/"
    click B_Main "https://github.com/yogeshkanwade21/project_intelligence/blob/main/backend/app/main.py"
    click B_Config "https://github.com/yogeshkanwade21/project_intelligence/blob/main/backend/app/config.py"
    click B_Intent "https://github.com/yogeshkanwade21/project_intelligence/blob/main/backend/app/orchestrator/intent_extractor.py"
    click B_JQL "https://github.com/yogeshkanwade21/project_intelligence/blob/main/backend/app/orchestrator/jql_generator.py"
    click B_JiraServ "https://github.com/yogeshkanwade21/project_intelligence/blob/main/backend/app/services/jira_service.py"
    click B_Route "https://github.com/yogeshkanwade21/project_intelligence/blob/main/backend/app/routes/jira.py"
    click DockerCompose "https://github.com/yogeshkanwade21/project_intelligence/blob/main/docker-compose.yml"
    click CI "https://github.com/yogeshkanwade21/project_intelligence/blob/main/.github/workflows/frontend-tests.yml"
```
