sdp-request-watcher/CLAUDE.md
2026-10-15 16:53:51 -04:00

41 lines
2.3 KiB
Markdown

# CLAUDE.md
Context for Claude Code sessions in this repo. Keep this short. Longer notes live in `docs/`.
## Project
A help desk dashboard for ManageEngine ServiceDesk Plus Cloud (`ithelp.mainecc.edu`). It currently runs as a single Node/Express server. The central region (KVCC, EMCC, CMCC, MCCS) is configured through `.env`.
- **Goal:** multi-region, multi-user, customisable. See `docs/ROADMAP.md`.
- **Decisions, API gotchas and known issues:** `docs/NOTES.md`. Read it before touching any SDP query.
- **Latest session summary and handoff:** `SESSION.md`.
## Run
```text
npm install
npm run app # node src/server.js from the repo root; .env lives in the repo root
```
The app is served at <http://localhost:3000>. Sign in with the Connect button, which uses Zoho's device-code flow.
## Layout
- `src/server.js`: reads `.env` and starts everything.
- `src/auth.js`: Zoho device-code sign-in.
- `src/boardService.js`: token, state and refresh timers.
- `src/tickets.js`: all SDP queries (closed feed, status table, closed today, unassigned).
- `src/weather.js`: OpenWeatherMap, cached for 10 minutes.
- `src/routes.js`: the `/api/*` routes.
- `src/public/index.html`: the whole front end in one file (inline CSS and JS, no build step).
## Working agreements
- Never print or commit `.env` values (Zoho client secret, OpenWeatherMap key). Redact them when inspecting.
- There are no automated tests yet. Verify server logic by stubbing `axios.get`. Resolve axios from the project with `require.resolve('axios', { paths: [dir] })` so the stub hits the same instance. Verify the page by evaluating its `<script>` with stubbed `document` and `fetch`, or by taking a screenshot with headless Edge.
- The sandbox can't start a second server instance; it can't bind ports. Screenshots of the live app use the user's running server on port 3000.
- Match the existing style: 4-space indent and CommonJS on the server, 2-space indent in `index.html`, lowercase `//` comments explaining why rather than what. Some files have CRLF line endings, so use the Edit tool rather than sed for multi-line changes.
- Keep the core closed-ticket watcher (feed and ding) working and on by default.
- Don't commit unless asked. Commit messages end with the Co-Authored-By line for Claude.
- Record new decisions and gotchas in `docs/NOTES.md`, and move roadmap items as they're done.