# maheeth07/lucge architecture

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

- Interactive diagram: https://gitdiagram.com/maheeth07/lucge
- Repository: https://github.com/maheeth07/lucge

## Overview

LUCG appears to provide a web interface and REST API for running submitted code in language-specific Docker environments. The documented execution path accepts a request, checks its API key and daily usage, queues a job, runs it in a worker, and returns the result. The UI also presents key generation, feature information, and API documentation. The README contains no usable product detail, so the map relies on the sampled source and source index; some frontend-to-backend wiring and database connectivity remain unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/maheeth07/lucge/blob/main/frontend/src/App.jsx) (Page composition), [`backend/services/executionService.js`](https://github.com/maheeth07/lucge/blob/main/backend/services/executionService.js) (Language dispatch), [`backend/controllers/executionController.js`](https://github.com/maheeth07/lucge/blob/main/backend/controllers/executionController.js) (Execution handler), [`backend/index.js`](https://github.com/maheeth07/lucge/blob/main/backend/index.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["Page composition<br/>[App.jsx]"]
  node_nav["Navigation<br/>[Navbar.jsx]"]
  node_hero["Hero section<br/>[Hero.jsx]"]
  node_features["Feature overview<br/>[Features.jsx]"]
  node_keyui["Key generator UI<br/>[GenerateKey.jsx]"]
  node_docs["API documentation<br/>[Docs.jsx]"]
  node_codeblock["Code examples<br/>[CodeBlock.jsx]"]
  node_footer["Page footer<br/>[Footer.jsx]"]
end

subgraph group_api["API backend"]
  node_server["HTTP server<br/>[index.js]"]
  node_keyroute["Key route<br/>[keyRoutes.js]"]
  node_execroute["Execution route<br/>[executionRoutes.js]"]
  node_keycontroller["Key generation<br/>[apikey.js]"]
  node_execcontroller["Execution handler"]
end

subgraph group_runtime["Execution runtime"]
  node_worker["Queue worker<br/>[worker.js]"]
  node_executor["Language dispatch"]
  node_docker["Docker runtime"]
  node_cpp["C++ runner image"]
  node_java["Java runner image"]
  node_js["JavaScript runner image"]
  node_python["Python runner image"]
end

subgraph group_data["State and queues"]
  node_keymodel[("API key model<br/>[Key.js]")]
  node_executionmodel[("Execution model<br/>[Execution.js]")]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_redis[("Redis connection<br/>[redis.js]")]
  node_queue["Job queue<br/>[queue.js]"]
end

node_visitor(("API user"))

node_visitor -->|"opens interface"| node_app
node_app -->|"renders"| node_nav
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_features
node_app -->|"renders"| node_keyui
node_app -->|"renders"| node_docs
node_app -->|"renders"| node_footer
node_docs -->|"renders examples"| node_codeblock
node_visitor -->|"submits requests"| node_server
node_server -->|"mounts route"| node_keyroute
node_server -->|"mounts route"| node_execroute
node_server -->|"connects database"| node_dbconfig
node_keyroute -->|"routes to"| node_keycontroller
node_execroute -->|"routes to"| node_execcontroller
node_keycontroller -->|"saves key"| node_keymodel
node_execcontroller -->|"validates key"| node_keymodel
node_execcontroller -->|"counts usage"| node_redis
node_execcontroller -->|"enqueues job"| node_queue
node_execcontroller -->|"waits for result"| node_queue
node_worker -->|"uses connection"| node_redis
node_worker -->|"dispatches execution"| node_executor
node_queue -->|"uses connection"| node_redis
node_queue -.->|"delivers jobs"| node_worker
node_executor -->|"runs container"| node_docker
node_executor -->|"selects image"| node_cpp
node_executor -->|"selects image"| node_java
node_executor -->|"selects image"| node_js
node_executor -->|"selects image"| node_python

click node_app "https://github.com/maheeth07/lucge/blob/main/frontend/src/App.jsx"
click node_nav "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Navbar.jsx"
click node_hero "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Hero.jsx"
click node_features "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Features.jsx"
click node_keyui "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/GenerateKey.jsx"
click node_docs "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Docs.jsx"
click node_codeblock "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/CodeBlock.jsx"
click node_footer "https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Footer.jsx"
click node_server "https://github.com/maheeth07/lucge/blob/main/backend/index.js"
click node_keyroute "https://github.com/maheeth07/lucge/blob/main/backend/routes/keyRoutes.js"
click node_execroute "https://github.com/maheeth07/lucge/blob/main/backend/routes/executionRoutes.js"
click node_keycontroller "https://github.com/maheeth07/lucge/blob/main/backend/controllers/apikey.js"
click node_execcontroller "https://github.com/maheeth07/lucge/blob/main/backend/controllers/executionController.js"
click node_keymodel "https://github.com/maheeth07/lucge/blob/main/backend/models/Key.js"
click node_executionmodel "https://github.com/maheeth07/lucge/blob/main/backend/models/Execution.js"
click node_dbconfig "https://github.com/maheeth07/lucge/blob/main/backend/config/db.js"
click node_redis "https://github.com/maheeth07/lucge/blob/main/backend/config/redis.js"
click node_queue "https://github.com/maheeth07/lucge/blob/main/backend/queue.js"
click node_worker "https://github.com/maheeth07/lucge/blob/main/backend/worker.js"
click node_executor "https://github.com/maheeth07/lucge/blob/main/backend/services/executionService.js"
click node_cpp "https://github.com/maheeth07/lucge/blob/main/backend/Docker/cpp/Dockerfile"
click node_java "https://github.com/maheeth07/lucge/blob/main/backend/Docker/Java/Dockerfile"
click node_js "https://github.com/maheeth07/lucge/blob/main/backend/Docker/Js/Dockerfile"
click node_python "https://github.com/maheeth07/lucge/blob/main/backend/Docker/python/Dockerfile"

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_app,node_nav,node_hero,node_features,node_keyui,node_docs,node_codeblock,node_footer,node_visitor toneBlue
class node_server,node_keyroute,node_execroute,node_keycontroller,node_execcontroller toneAmber
class node_worker,node_executor,node_docker,node_cpp,node_java,node_js,node_python toneMint
class node_keymodel,node_executionmodel,node_dbconfig,node_redis,node_queue toneRose
```

## Components

### Web interface

- [Page composition](https://github.com/maheeth07/lucge/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Navigation](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Hero section](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Hero.jsx): `frontend/src/components/Hero.jsx`
- [Feature overview](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Features.jsx): `frontend/src/components/Features.jsx`
- [Key generator UI](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/GenerateKey.jsx): `frontend/src/components/GenerateKey.jsx`
- [API documentation](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Docs.jsx): `frontend/src/components/Docs.jsx`
- [Code examples](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/CodeBlock.jsx): `frontend/src/components/CodeBlock.jsx`
- [Page footer](https://github.com/maheeth07/lucge/blob/main/frontend/src/components/Footer.jsx): `frontend/src/components/Footer.jsx`

### API backend

- [HTTP server](https://github.com/maheeth07/lucge/blob/main/backend/index.js): `backend/index.js`
- [Key route](https://github.com/maheeth07/lucge/blob/main/backend/routes/keyRoutes.js): `backend/routes/keyRoutes.js`
- [Execution route](https://github.com/maheeth07/lucge/blob/main/backend/routes/executionRoutes.js): `backend/routes/executionRoutes.js`
- [Key generation](https://github.com/maheeth07/lucge/blob/main/backend/controllers/apikey.js): `backend/controllers/apikey.js`
- [Execution handler](https://github.com/maheeth07/lucge/blob/main/backend/controllers/executionController.js): `backend/controllers/executionController.js`

### Execution runtime

- [Queue worker](https://github.com/maheeth07/lucge/blob/main/backend/worker.js): `backend/worker.js`
- [Language dispatch](https://github.com/maheeth07/lucge/blob/main/backend/services/executionService.js): `backend/services/executionService.js`
- **Docker runtime**
- [C++ runner image](https://github.com/maheeth07/lucge/blob/main/backend/Docker/cpp/Dockerfile): `backend/Docker/cpp/Dockerfile`
- [Java runner image](https://github.com/maheeth07/lucge/blob/main/backend/Docker/Java/Dockerfile): `backend/Docker/Java/Dockerfile`
- [JavaScript runner image](https://github.com/maheeth07/lucge/blob/main/backend/Docker/Js/Dockerfile): `backend/Docker/Js/Dockerfile`
- [Python runner image](https://github.com/maheeth07/lucge/blob/main/backend/Docker/python/Dockerfile): `backend/Docker/python/Dockerfile`

### State and queues

- [API key model](https://github.com/maheeth07/lucge/blob/main/backend/models/Key.js): `backend/models/Key.js`
- [Execution model](https://github.com/maheeth07/lucge/blob/main/backend/models/Execution.js): `backend/models/Execution.js`
- [Database connection](https://github.com/maheeth07/lucge/blob/main/backend/config/db.js): `backend/config/db.js`
- [Redis connection](https://github.com/maheeth07/lucge/blob/main/backend/config/redis.js): `backend/config/redis.js`
- [Job queue](https://github.com/maheeth07/lucge/blob/main/backend/queue.js): `backend/queue.js`

### Other components

- **API user**

## Connections

- API user → Page composition: opens interface
- Page composition → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Page composition → Hero section: renders (evidence: `frontend/src/App.jsx`)
- Page composition → Feature overview: renders (evidence: `frontend/src/App.jsx`)
- Page composition → Key generator UI: renders (evidence: `frontend/src/App.jsx`)
- Page composition → API documentation: renders (evidence: `frontend/src/App.jsx`)
- Page composition → Page footer: renders (evidence: `frontend/src/App.jsx`)
- API documentation → Code examples: renders examples (evidence: `frontend/src/components/Docs.jsx`)
- API user → HTTP server: submits requests
- HTTP server → Key route: mounts route (evidence: `backend/index.js`)
- HTTP server → Execution route: mounts route (evidence: `backend/index.js`)
- HTTP server → Database connection: connects database (evidence: `backend/index.js`)
- Key route → Key generation: routes to (evidence: `backend/routes/keyRoutes.js`)
- Execution route → Execution handler: routes to (evidence: `backend/routes/executionRoutes.js`)
- Key generation → API key model: saves key (evidence: `backend/controllers/apikey.js`)
- Execution handler → API key model: validates key (evidence: `backend/controllers/executionController.js`)
- Execution handler → Redis connection: counts usage (evidence: `backend/controllers/executionController.js`)
- Execution handler → Job queue: enqueues job (evidence: `backend/controllers/executionController.js`)
- Execution handler → Job queue: waits for result (evidence: `backend/controllers/executionController.js`)
- Queue worker → Redis connection: uses connection (evidence: `backend/worker.js`)
- Queue worker → Language dispatch: dispatches execution (evidence: `backend/worker.js`)
- Job queue → Redis connection: uses connection (evidence: `backend/queue.js`)
- Job queue → Queue worker: delivers jobs
- Language dispatch → Docker runtime: runs container (evidence: `backend/services/executionService.js`)
- Language dispatch → C++ runner image: selects image (evidence: `backend/services/executionService.js`)
- Language dispatch → Java runner image: selects image (evidence: `backend/services/executionService.js`)
- Language dispatch → JavaScript runner image: selects image (evidence: `backend/services/executionService.js`)
- Language dispatch → Python runner image: selects image (evidence: `backend/services/executionService.js`)
