# lalitsureliya-2005/lms-solver architecture

> Architecture diagram of the GitHub repository lalitsureliya-2005/lms-solver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lalitsureliya-2005/lms-solver
- Repository: https://github.com/lalitsureliya-2005/lms-solver

## Overview

This repository automates BMSCE LMS competitive-coding submissions: a student authenticates, the solver selects cached or generated Python code, injects it into the LMS editor, submits it, and records the verdict for resumption. It offers both a local CLI and a web interface with queued, private runs and live progress. The graph includes the documented scraping and solution-catalog capabilities; their implementation links are dashed where the sampled source does not show the wiring. Some internal source was not sampled.

Main entry points: [`runner.js`](https://github.com/lalitsureliya-2005/lms-solver/blob/main/runner.js) (CLI runner), [`solve.js`](https://github.com/lalitsureliya-2005/lms-solver/blob/main/solve.js) (Browser solver), [`problem-store.js`](https://github.com/lalitsureliya-2005/lms-solver/blob/main/problem-store.js) (Problem bookkeeping), [`server.js`](https://github.com/lalitsureliya-2005/lms-solver/blob/main/server.js) (Web API and jobs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entrypoints"]
  node_cli["CLI runner<br/>[runner.js]"]
  node_webui["Web interface<br/>[app.js]"]
end

subgraph group_execution["Solve execution"]
  node_login["Login and sessions<br/>[login.js]"]
  node_solver["Browser solver<br/>[solve.js]"]
  node_lock["Run lock<br/>[lock.js]"]
  node_banner["CLI banner<br/>[banner.js]"]
end

subgraph group_catalog["Problem and solution data"]
  node_problemdata["Problem catalog<br/>[scrape-problems.js]"]
  node_solutionfiles["Python solutions"]
  node_store["Problem bookkeeping<br/>[problem-store.js]"]
  node_jsonbuilder["Solution catalog builder"]
end

subgraph group_web["Web run service"]
  node_webserver["Web API and jobs<br/>[server.js]"]
  node_jobqueue["Run queue and events<br/>[server.js]"]
end

node_student(("Student"))
node_lms["BMSCE LMS"]

node_student -->|"starts run"| node_cli
node_student -->|"submits credentials"| node_webui
node_cli -.->|"authenticates"| node_login
node_cli -->|"runs problems"| node_solver
node_cli -->|"checks progress"| node_store
node_cli -->|"acquires"| node_lock
node_cli -->|"builds catalog"| node_jsonbuilder
node_cli -.->|"prints banner"| node_banner
node_login -->|"signs in"| node_lms
node_solver -->|"submits code"| node_lms
node_solver -->|"stores solution"| node_solutionfiles
node_solver -.->|"scrapes problems"| node_problemdata
node_solver -->|"uses cache"| node_store
node_problemdata -.->|"updates catalog"| node_store
node_jsonbuilder -->|"uses slug helper"| node_store
node_jsonbuilder -->|"reads code"| node_solutionfiles
node_webui -->|"requests run"| node_webserver
node_webui -->|"receives progress"| node_jobqueue
node_webserver -.->|"queues jobs"| node_jobqueue
node_webserver -->|"runs job"| node_solver
node_webserver -.->|"loads problems"| node_store

click node_cli "https://github.com/lalitsureliya-2005/lms-solver/blob/main/runner.js"
click node_webui "https://github.com/lalitsureliya-2005/lms-solver/blob/main/public/app.js"
click node_login "https://github.com/lalitsureliya-2005/lms-solver/blob/main/login.js"
click node_solver "https://github.com/lalitsureliya-2005/lms-solver/blob/main/solve.js"
click node_problemdata "https://github.com/lalitsureliya-2005/lms-solver/blob/main/scrape-problems.js"
click node_solutionfiles "https://github.com/lalitsureliya-2005/lms-solver/tree/main/solutions"
click node_store "https://github.com/lalitsureliya-2005/lms-solver/blob/main/problem-store.js"
click node_jsonbuilder "https://github.com/lalitsureliya-2005/lms-solver/blob/main/build-solutions-json.js"
click node_webserver "https://github.com/lalitsureliya-2005/lms-solver/blob/main/server.js"
click node_jobqueue "https://github.com/lalitsureliya-2005/lms-solver/blob/main/server.js"
click node_lock "https://github.com/lalitsureliya-2005/lms-solver/blob/main/lock.js"
click node_banner "https://github.com/lalitsureliya-2005/lms-solver/blob/main/banner.js"

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_cli,node_webui toneBlue
class node_login,node_solver,node_lock,node_banner toneAmber
class node_problemdata,node_solutionfiles,node_store,node_jsonbuilder toneMint
class node_webserver,node_jobqueue toneRose
class node_student,node_lms toneIndigo
```

## Components

### User entrypoints

- [CLI runner](https://github.com/lalitsureliya-2005/lms-solver/blob/main/runner.js): `runner.js`
- [Web interface](https://github.com/lalitsureliya-2005/lms-solver/blob/main/public/app.js): `public/app.js`

### Solve execution

- [Login and sessions](https://github.com/lalitsureliya-2005/lms-solver/blob/main/login.js): `login.js`
- [Browser solver](https://github.com/lalitsureliya-2005/lms-solver/blob/main/solve.js): `solve.js`
- [Run lock](https://github.com/lalitsureliya-2005/lms-solver/blob/main/lock.js): `lock.js`
- [CLI banner](https://github.com/lalitsureliya-2005/lms-solver/blob/main/banner.js): `banner.js`

### Problem and solution data

- [Problem catalog](https://github.com/lalitsureliya-2005/lms-solver/blob/main/scrape-problems.js): `scrape-problems.js`
- [Python solutions](https://github.com/lalitsureliya-2005/lms-solver/tree/main/solutions): `solutions`
- [Problem bookkeeping](https://github.com/lalitsureliya-2005/lms-solver/blob/main/problem-store.js): `problem-store.js`
- [Solution catalog builder](https://github.com/lalitsureliya-2005/lms-solver/blob/main/build-solutions-json.js): `build-solutions-json.js`

### Web run service

- [Web API and jobs](https://github.com/lalitsureliya-2005/lms-solver/blob/main/server.js): `server.js`
- [Run queue and events](https://github.com/lalitsureliya-2005/lms-solver/blob/main/server.js): `server.js`

### Other components

- **Student**
- **BMSCE LMS**

## Connections

- Student → CLI runner: starts run
- Student → Web interface: submits credentials
- CLI runner → Login and sessions: authenticates
- CLI runner → Browser solver: runs problems (evidence: `runner.js`)
- CLI runner → Problem bookkeeping: checks progress (evidence: `runner.js`)
- CLI runner → Run lock: acquires (evidence: `runner.js`)
- CLI runner → Solution catalog builder: builds catalog (evidence: `runner.js`)
- CLI runner → CLI banner: prints banner
- Login and sessions → BMSCE LMS: signs in (evidence: `login.js`)
- Browser solver → BMSCE LMS: submits code (evidence: `solve.js`)
- Browser solver → Python solutions: stores solution (evidence: `solve.js`)
- Browser solver → Problem catalog: scrapes problems (evidence: `solve.js`)
- Browser solver → Problem bookkeeping: uses cache (evidence: `solve.js`)
- Problem catalog → Problem bookkeeping: updates catalog
- Solution catalog builder → Problem bookkeeping: uses slug helper (evidence: `build-solutions-json.js`)
- Solution catalog builder → Python solutions: reads code (evidence: `build-solutions-json.js`)
- Web interface → Web API and jobs: requests run (evidence: `public/app.js`)
- Web interface → Run queue and events: receives progress (evidence: `public/app.js`)
- Web API and jobs → Run queue and events: queues jobs (evidence: `server.js`)
- Web API and jobs → Browser solver: runs job (evidence: `server.js`)
- Web API and jobs → Problem bookkeeping: loads problems
