# mdop297/isnex architecture

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

- Interactive diagram: https://gitdiagram.com/mdop297/isnex
- Repository: https://github.com/mdop297/isnex

## Overview

##### Project type and purpose
- This is a full-stack, polyglot microservices monorepo (managed by Nx/pnpm) called “IsNex.”
- It provides:
- A Next.js frontend (apps/client)
- Two NestJS backend services—Auth (apps/auth-svc) and Document (apps/document-svc)
- A Python data-processing service (apps/data-processing-svc)
- Shared libraries for TypeScript (libs/tscommon) and Python (libs/pycommon)
- It targets containerized deployment (Docker, Docker Compose, Kubernetes, Skaffold) and CI/CD (GitHub Actions, Husky hooks, linting, Jest/Pytest).

##### File structure
- Top-level dirs:
- apps/… – service and client applications
- libs/… – shared code for TS and Python
- infras/… – Kubernetes manifests for dev and prod
- docker-compose*.yml, skaffold.yaml – local and cluster orchestration
- CI/CD & lint configs (.github/, jest.config.ts, eslint.*, commitlint, husky, Makefile)
- Each NestJS service has its own Dockerfile, Prisma schema/migrations (for Auth), and standard src/app MVC layout.
- The Next.js client under apps/client uses TypeScript, PostCSS, ESLint, and Next’s file-based routes.
- The Python service uses PyProject, Poetry or pip-tools (uv.lock), pytest tests, and shares code via libs/pycommon.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Client["Client (Next.js)"]:::frontend
    end

    %% Service Layer
    subgraph "Service Layer"
        Auth["Auth Service (NestJS + Prisma)"]:::backend
        Document["Document Service (NestJS)"]:::backend
        DataProc["Data Processing Service (Python)"]:::backend
    end

    %% Shared Libraries
    subgraph "Shared Libraries"
        TSCommon["TSCommon Library"]:::library
        PyCommon["PyCommon Library"]:::library
    end

    %% Data Layer
    subgraph "Data Layer"
        Postgres["PostgreSQL"]:::database
    end

    %% Infrastructure
    subgraph "Infrastructure"
        Infra["Docker / Kubernetes"]:::infra
    end

    %% CI/CD
    subgraph "CI/CD Pipeline"
        CI["GitHub Actions & Husky"]:::cicd
    end

    %% Connections
    Client -->|"POST /login"| Auth
    Client -->|"GET/POST /documents (JWT)"| Document
    Document -->|"Task Request"| DataProc
    Auth -->|"Reads/Writes"| Postgres
    TSCommon -->|build-time| Auth
    TSCommon -->|build-time| Document
    PyCommon -->|build-time| DataProc
    CI -->|"Build & Push Images"| Infra
    Infra -->|deploy| Auth
    Infra -->|deploy| Document
    Infra -->|deploy| DataProc

    %% Click Events
    click Client "https://github.com/mdop297/isnex/tree/main/apps/client"
    click Auth "https://github.com/mdop297/isnex/tree/main/apps/auth-svc"
    click Auth "https://github.com/mdop297/isnex/blob/main/apps/auth-svc/prisma/schema.prisma"
    click Auth "https://github.com/mdop297/isnex/tree/main/apps/auth-svc/prisma/migrations/"
    click Auth "https://github.com/mdop297/isnex/tree/main/apps/auth-svc/Dockerfile"
    click Auth "https://github.com/mdop297/isnex/blob/main/apps/auth-svc/Dockerfile.dev"
    click Document "https://github.com/mdop297/isnex/tree/main/apps/document-svc"
    click Document "https://github.com/mdop297/isnex/blob/main/apps/document-svc/webpack.config.js"
    click Document "https://github.com/mdop297/isnex/blob/main/apps/document-svc/package.json"
    click DataProc "https://github.com/mdop297/isnex/tree/main/apps/data-processing-svc"
    click DataProc "https://github.com/mdop297/isnex/blob/main/apps/data-processing-svc/pyproject.toml"
    click DataProc "https://github.com/mdop297/isnex/blob/main/apps/data-processing-svc/project.json"
    click DataProc "https://github.com/mdop297/isnex/tree/main/apps/data-processing-svc/src"
    click TSCommon "https://github.com/mdop297/isnex/tree/main/libs/tscommon"
    click TSCommon "https://github.com/mdop297/isnex/tree/main/libs/tscommon/src"
    click TSCommon "https://github.com/mdop297/isnex/blob/main/libs/tscommon/src/lib/tscommon.spec.ts"
    click PyCommon "https://github.com/mdop297/isnex/tree/main/libs/pycommon"
    click PyCommon "https://github.com/mdop297/isnex/tree/main/libs/pycommon/src"
    click PyCommon "https://github.com/mdop297/isnex/tree/main/libs/pycommon/tests"
    click Infra "https://github.com/mdop297/isnex/blob/main/infras/k8s-dev/ingress-svc.yaml"
    click Infra "https://github.com/mdop297/isnex/blob/main/infras/k8s/auth/auth-depl.yaml"
    click Infra "https://github.com/mdop297/isnex/blob/main/infras/k8s/auth/auth-postgres-depl.yaml"
    click Infra "https://github.com/mdop297/isnex/blob/main/infras/k8s/auth/auth-configmap.yaml"
    click Infra "https://github.com/mdop297/isnex/blob/main/docker-compose.yml"
    click Infra "https://github.com/mdop297/isnex/blob/main/docker-compose.db.yml"
    click Infra "https://github.com/mdop297/isnex/blob/main/docker-compose.override.yml"
    click Infra "https://github.com/mdop297/isnex/blob/main/skaffold.yaml"
    click CI "https://github.com/mdop297/isnex/blob/main/.github/workflows/ci.yml"
    click CI "https://github.com/mdop297/isnex/tree/main/.husky/pre-commit"
    click CI "https://github.com/mdop297/isnex/tree/main/.husky/commit-msg"
    click CI "https://github.com/mdop297/isnex/tree/main/.husky/prepare-commit-msg"
    click CI "https://github.com/mdop297/isnex/blob/main/jest.config.ts"
    click CI "https://github.com/mdop297/isnex/blob/main/eslint.config.mjs"
    click CI "https://github.com/mdop297/isnex/blob/main/eslint.base.config.mjs"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#1E70BF,color:#000
    classDef backend fill:#E0F8E0,stroke:#2E8B57,color:#000
    classDef library fill:#FFF4CC,stroke:#CDA434,color:#000
    classDef database fill:#FFEBE8,stroke:#D9534F,color:#000
    classDef infra fill:#F3E8FF,stroke:#8A2BE2,color:#000
    classDef cicd fill:#F0F0F0,stroke:#555,color:#000
```
