# niranjan-aware/codecraft-platform-new architecture

> Architecture diagram of the GitHub repository niranjan-aware/codecraft-platform-new, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/niranjan-aware/codecraft-platform-new
- Repository: https://github.com/niranjan-aware/codecraft-platform-new

## Overview

##### Project type and purpose
- This is a full-stack, microservices-based platform (“codecraft-platform”) for code analysis, AI-driven code generation/fixing/review, project management, execution and notifications.
- It comprises a React/TypeScript frontend, an API Gateway, a Eureka service registry, multiple backend microservices (Java Spring Boot and Python FastAPI), messaging (RabbitMQ), object storage (Minio), relational databases, and WebSockets.

##### File structure
- Top-level “app/” is a Python FastAPI service (AI orchestrator? proof-of-concept).
- Under the root are multiple service folders, each with its own Dockerfile, code, configs, and build artifacts:
– codecraft-frontend (React + Vite)
– codecraft-gateway-service (Java Spring Boot, acts as API gateway & JWT filter)
– codecraft-eureka-server (Java Spring Boot, service registry)
– codecraft-auth-service, project-, analysis-, execution-, notification-services (Java and Python FastAPI microservices)
– codecraft-agent-service & codecraft-ai-service (Python FastAPI agents and AI logic)
– codecraft-infrastructure (Docker-Compose, RabbitMQ, Minio, DB init)
- Common patterns: Spring Boot microservices, FastAPI microservices, service discovery (Eureka), message-driven events, REST controllers, WebSocket for real-time logs.

##### README
- Minimal content; assume multi-service platform as above. Use file names and configs to infer tech: Java (pom.xml, application.yml), Python (requirements.txt, .env), React (package.json, tsconfig).

a. Main components:
- Client (Browser/React UI)
- API Gateway
- Eureka Service Registry
- Microservices:
– Auth Service (user/login/jwt)
– Project Service (create/manage code projects, file storage via Minio)
– Analysis Service (static analysis, metrics, uses Semgrep)
– Execution Service (code compile/run via Docker, real-time logs via WebSocket, uses RabbitMQ events)
– AI Service (core AI logic: code generation, explain, review, test gen, using a GROQ-based store)
– Agent Service (orchestrates tasks for AI agents)
– Notification Service (consumes RabbitMQ events, sends e-mails)
- Messaging Broker (RabbitMQ)
- Storage:
– Relational DB(s) for each service
– Minio (S3-compatible object storage)
- Service Discovery (Eureka)
- Infrastructure Orchestration (Docker Compose)

b. Relationships & interactions:
- UI → Gateway (REST calls)
- Gateway ↔ Eureka (register/discover)
- Gateway → each microservice (routes based on path)
- Microservices register with Eureka at startup
- Project Service stores files in Minio & metadata in DB
- Analysis, Execution, AI, Agent, Notification Services communicate asynchronously via RabbitMQ (e.g., Execution dispatches LogEvents, Notification consumes events)
- Execution Service uses WebSocket to push real-time logs back to UI via Gateway
- Auth Service issues JWTs; Gateway’s AuthenticationFilter validates tokens on every request
- Frontend establishes WebSocket connection to Execution Service through Gateway

c. Architectural patterns & principles:
- Microservices (bounded contexts, independent data stores)
- API Gateway (centralized entrypoint, authentication)
- Service Discovery with Eureka
- Event-driven communication via RabbitMQ (loose coupling)
- CQRS/Async for execution logs and notifications
- Containerization (Docker), infrastructure as code (docker-compose)

d. Key technologies & frameworks:
- Frontend: React, TypeScript, Vite
- Backend: Java Spring Boot, Python FastAPI
- Messaging: RabbitMQ
- Storage: PostgreSQL (or similar) per service, Minio
- Service Registry: Eureka
- API Gateway: Spring Cloud Gateway (with custom Jwt filter)
- WebSockets: Spring WebSocket / FastAPI websockets
- AI: Groq, custom AI services, agent orchestrator
- Containerization: Docker, Docker Compose

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph Presentation
        Browser["Browser"]:::browser
        Frontend["React UI"]:::frontend
    end
    Browser -->|"HTTP/REST & WS"| Frontend

    subgraph Edge
        Gateway["API Gateway"]:::gateway
        Eureka["Service Registry"]:::registry
    end
    Frontend -->|"REST Calls"| Gateway
    Frontend -->|"<-> WS"| Execution
    Gateway -->|"register/discover"| Eureka

    subgraph Services
        subgraph Java_Services
            Auth["Auth Service"]:::service
            Project["Project Service"]:::service
            Analysis["Analysis Service"]:::service
            Execution["Execution Service"]:::service
            Notification["Notification Service"]:::service
        end
        subgraph Python_Services
            AI["AI Service"]:::service
            Agent["Agent Service"]:::service
            POC["AI Orchestrator POC"]:::service
        end
    end

    Gateway -->|"JWT Validate & Route"| Auth
    Gateway -->|"Route Requests"| Project
    Gateway -->|"Route Requests"| Analysis
    Gateway -->|"Route Requests"| Execution
    Gateway -->|"Route Requests"| AI
    Gateway -->|"Route Requests"| Agent
    Gateway -->|"Route Requests"| Notification

    subgraph Infrastructure
        Rabbit["RabbitMQ"]:::message
        Minio["Minio Storage"]:::storage
        DBAuth["Auth DB"]:::db
        DBProj["Project DB"]:::db
        DBAnal["Analysis DB"]:::db
        DBExec["Execution DB"]:::db
        DBAI["AI DB"]:::db
        DBAgent["Agent DB"]:::db
        DBNot["Notification DB"]:::db
        DockerComp["Docker Compose"]:::infra
    end

    Auth -->|"JDBC"| DBAuth
    Project -->|"JDBC"| DBProj
    Project -->|"S3 API"| Minio
    Analysis -->|"JDBC"| DBAnal
    Analysis -->|"S3 API"| Minio
    Execution -->|"JDBC"| DBExec
    Execution -->|"Emit Events"| Rabbit
    Execution -->|"<-> WebSocket"| Frontend
    Notification -->|"JDBC"| DBNot
    Notification -->|"Consume Events"| Rabbit
    AI -->|"JDBC"| DBAI
    AI -->|"Events"| Rabbit
    Agent -->|"JDBC"| DBAgent
    Agent -->|"Events"| Rabbit
    POC -->|"Various"| Rabbit

    DockerComp --> Rabbit
    DockerComp --> Minio
    DockerComp --> Eureka
    DockerComp --> DBAuth
    DockerComp --> DBProj
    DockerComp --> DBAnal
    DockerComp --> DBExec
    DockerComp --> DBAI
    DockerComp --> DBAgent
    DockerComp --> DBNot

    click Frontend "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-frontend/"
    click Gateway "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-gateway-service/src/main/java/com/codecraft/gateway/"
    click Eureka "https://github.com/niranjan-aware/codecraft-platform-new/blob/main/codecraft-eureka-server/src/main/java/com/codecraft/eureka/EurekaServerApplication.java"
    click Auth "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-auth-service/src/main/java/com/codecraft/auth/"
    click Project "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-project-service/src/main/java/com/codecraft/project/"
    click Analysis "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-analysis-service/codecraft-analysis-service/src/main/java/com/codecraft/analysis/"
    click Execution "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-execution-service/src/main/java/com/codecraft/execution/"
    click AI "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-ai-service/app/"
    click Agent "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-agent-service/app/"
    click Notification "https://github.com/niranjan-aware/codecraft-platform-new/tree/main/codecraft-notification-service/app/"
    click DockerComp "https://github.com/niranjan-aware/codecraft-platform-new/blob/main/codecraft-infrastructure/docker-compose.yml"
    click POC "https://github.com/niranjan-aware/codecraft-platform-new/blob/main/app/main.py"

    classDef browser fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef frontend fill:#bbdefb,stroke:#1e88e5,stroke-width:2px
    classDef gateway fill:#fff9c4,stroke:#fbc02d,stroke-width:2px
    classDef registry fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px,stroke-dasharray: 5 5
    classDef service fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px
    classDef message fill:#ffe0b2,stroke:#f57c00,stroke-width:2px,stroke-dasharray: 4 2
    classDef storage fill:#d1c4e9,stroke:#512da8,stroke-width:2px
    classDef db fill:#b3e5fc,stroke:#0288d1,stroke-width:2px
    classDef infra fill:#f0f4c3,stroke:#9e9d24,stroke-width:2px
```
