# sazumivicky/cursor-reset-tools architecture

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

- Interactive diagram: https://gitdiagram.com/sazumivicky/cursor-reset-tools
- Repository: https://github.com/sazumivicky/cursor-reset-tools

## Overview

##### Project type and purpose
- This is a small full-stack web application built with Node.js/Express on the backend and plain HTML/CSS/JavaScript on the frontend, using EJS templates for server-side rendering.
- Purpose: provide a web interface that (with elevated privileges) locates and resets the Cursor IDE machine ID, clears caches, blocks updates, and unlocks “Pro” features via file system modifications and UUID generation.

##### File structure
- app.js: Express application entry point
- routes/reset.js: the primary API route that orchestrates the reset logic
- public/css & public/js: static assets served to the browser
- views/index.ejs: the UI template rendered by Express
- src/: likely contains images (previews) and may also house utility modules if expanded
- package.json, Dockerfile: deployment and dependency configuration

##### README for insights
- Tech stack: Node.js, Express, EJS, uuid, fs-extra, node-machine-id, node-fetch, user-agents
- Workflow: front end sends “Reset” command → backend detects Cursor process, stops it, regenerates UUID, clears files, patches system files, prevents updates.
- Requires admin privileges to modify system locations (Windows, macOS, Linux).

##### Detailed capture of essential elements
- Request/response flow end-to-end
- Modular breakdown in server: routes vs services vs utilities
- Administrative boundary for system-level changes
- Static vs dynamic content delivery paths

## Diagram (Mermaid)

```mermaid
flowchart TB
  Browser["Browser (UI)"]:::frontend
  App["Express Entry\n(app.js)"]:::backend

  subgraph "Express Server"
    direction TB
    StaticMiddleware["Static Middleware\n(public/)"]:::backend
    subgraph "Static & Views"
      View["EJS Template\n(views/index.ejs)"]:::static
      CSS["CSS\n(public/css/style.css)"]:::static
      JS["JavaScript\n(public/js/main.js)"]:::static
    end
    Route["Reset Route Handler\n(routes/reset.js)"]:::backend
    Service["Service Layer\n(fs-extra, uuid,\nnode-machine-id)"]:::service
  end

  FileSystem["OS File System\nMachine ID, caches,\nupdates config"]:::file
  NoteAdmin["Requires admin privileges"]:::annotation

  subgraph "Configuration"
    package["Dependency Config\n(package.json)"]:::util
    docker["Deployment Config\n(Dockerfile)"]:::util
  end

  subgraph "Project Directories"
    routesDir["Routes Directory\n(routes/)"]:::util
    viewsDir["Views Directory\n(views/)"]:::util
  end

  Browser -->|"GET /"| App
  App --> StaticMiddleware
  StaticMiddleware --> View
  StaticMiddleware --> CSS
  StaticMiddleware --> JS
  View -->|"render HTML"| Browser
  CSS -->|"serve CSS"| Browser
  JS -->|"serve JS"| Browser
  Browser -->|"POST /reset"| App
  App --> Route
  Route --> Service
  Service --> FileSystem
  FileSystem --> Route
  Route -->|"JSON response"| Browser
  Service --> NoteAdmin
  NoteAdmin -.-> FileSystem
  App --> package
  App --> docker
  App --> routesDir
  StaticMiddleware --> viewsDir

  click View "https://github.com/sazumivicky/cursor-reset-tools/blob/main/views/index.ejs"
  click CSS "https://github.com/sazumivicky/cursor-reset-tools/blob/main/public/css/style.css"
  click JS "https://github.com/sazumivicky/cursor-reset-tools/blob/main/public/js/main.js"
  click App "https://github.com/sazumivicky/cursor-reset-tools/blob/main/app.js"
  click StaticMiddleware "https://github.com/sazumivicky/cursor-reset-tools/tree/main/public/"
  click Route "https://github.com/sazumivicky/cursor-reset-tools/blob/main/routes/reset.js"
  click Service "https://github.com/sazumivicky/cursor-reset-tools/tree/main/src/"
  click package "https://github.com/sazumivicky/cursor-reset-tools/blob/main/package.json"
  click docker "https://github.com/sazumivicky/cursor-reset-tools/tree/main/Dockerfile"
  click routesDir "https://github.com/sazumivicky/cursor-reset-tools/tree/main/routes/"
  click viewsDir "https://github.com/sazumivicky/cursor-reset-tools/tree/main/views/"

  classDef frontend fill:#ADD8E6,stroke:#000,color:#000
  classDef backend fill:#90EE90,stroke:#000,color:#000
  classDef static fill:#87CEEB,stroke:#000,color:#000
  classDef service fill:#98FB98,stroke:#000,color:#000
  classDef file fill:#D3D3D3,stroke:#000,color:#000
  classDef annotation fill:none,stroke:#888,stroke-dasharray:2 2,color:#888
  classDef util fill:#FFDAB9,stroke:#000,color:#000
```
