You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,29 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Commands
6
6
7
-
Prerequisites: Node.js v18, npm v10, Angular CLI v18. A CouchDB instance must be running (the README describes a Docker Compose setup that exposes CouchDB on port 2200 and `planet-gateway` on port 5000).
7
+
Prerequisites: Node.js v18, npm v10, Angular CLI v18. A CouchDB instance must be running (the README describes a Docker Compose setup that exposes CouchDB on port 2200 and `gateway` on port 5000).
8
8
9
9
### Angular app (root)
10
10
11
11
-`npm install` — install dependencies.
12
-
-`npm run install-hooks` — copy `git-hooks/*` into `.git/hooks`. The `pre-push` hook runs `npm run lint` in both the root and `planet-gateway/`.
12
+
-`npm run install-hooks` — copy `git-hooks/*` into `.git/hooks`. The `pre-push` hook runs `npm run lint` in both the root and `gateway/`.
13
13
-`npm start` / `ng serve` — dev server on port 3000 (host `0.0.0.0`). If 3000 is taken, use `ng serve --port 3001`.
14
-
-`npm run dev` — runs `dev-env.sh` (which templates `src/environments/environment.dev.ts` from `environment.template` using `CHAT_PORT`, `COUCH_PORT`, `PARENT_PROTOCOL` from an optional `.env`) then `ng serve --configuration dev`. Use this when `planet-gateway` or CouchDB are on non-default ports.
14
+
-`npm run dev` — runs `dev-env.sh` (which templates `src/environments/environment.dev.ts` from `environment.template` using `CHAT_PORT`, `COUCH_PORT`, `PARENT_PROTOCOL` from an optional `.env`) then `ng serve --configuration dev`. Use this when `gateway` or CouchDB are on non-default ports.
15
15
-`npm run build` — production build via `ng-high-memory` (`--max_old_space_size=4096`); large builds OOM without it.
16
16
-`npm run test` — Karma + Jasmine; opens `localhost:9876`. There is no `e2e` workflow wired up on this branch.
17
17
- Single spec: `ng test --include src/app/path/to/file.spec.ts` (or temporarily use `fdescribe` / `fit`).
18
18
-`npm run lint` — ESLint over `src/**/*.{ts,html}` via `@angular-eslint/builder`. `ng lint --fix` auto-fixes.
19
19
-`npm run lint-all` — sass-lint + `ng lint --type-check` + htmlhint. Heavier than the pre-push hook.
20
20
- Locales (en, so, fr, ne, ar, es): `ng serve --configuration <spa|fra|nep|ara|som>` or `LNG=es npm start`. Locale configs, base hrefs, and xlf sources are defined in `angular.json` under `projects.planet-app.i18n`.
21
21
22
-
### planet-gateway (`planet-gateway/`)
22
+
### gateway (`gateway/`)
23
23
24
-
Independent Node service; requires its own `.env` (see `planet-gateway/README.md`) with `SERVE_PORT`, `COUCHDB_HOST`, `COUCHDB_USER`, `COUCHDB_PASS`. macOS/Windows users typically use `SERVE_PORT=5400` and mirror it in the root `.env` as `CHAT_PORT`.
24
+
Independent Node service; requires its own `.env` (see `gateway/README.md`) with `SERVE_PORT`, `COUCHDB_HOST`, `COUCHDB_USER`, `COUCHDB_PASS`. macOS/Windows users typically use `SERVE_PORT=5400` and mirror it in the root `.env` as `CHAT_PORT`.
-`npm run lint` / `npm run lint-fix` — uses legacy ESLint config (`ESLINT_USE_FLAT_CONFIG=false`); the root app uses flat config (`eslint.config.mjs`), so don't try to unify them casually.
29
-
- Only one planet-gateway can bind the port at a time; stop the Docker gateway container before `npm run dev`.
29
+
- Only one `gateway` instance can bind the port at a time; stop the Docker gateway container before `npm run dev`.
30
30
31
31
### CouchDB bootstrap
32
32
@@ -43,9 +43,9 @@ Planet Learning is an Angular 19 + CouchDB learning platform. There are two tier
43
43
-`couchdb.service.ts` — HTTP wrapper around CouchDB used by most features. Every request goes through `setOpts` / `couchDBReq`, which injects `withCredentials` and surfaces 403s via `PlanetMessageService`. Prefer adding new calls through this service rather than raw `HttpClient`.
44
44
-`database/pouch.service.ts` + `pouch-auth.service.ts` — PouchDB mirror for offline-capable data (currently seeded with `feedback`). When adding an offline-capable database, register it in the `databases` Set so `configureDBs()` creates the local mirror.
45
45
-`src/app/manager-dashboard/` — admin surfaces (sync, fetch, AI configuration, reports, requests, certifications). AI provider keys/models are read from the CouchDB `configurations` database; do not hardcode them.
46
-
-`planet-gateway/` — standalone Express + WebSocket gateway with internal `chatapi` and `public` modules. It serves chat on the existing `/ml/` namespace and scoped public operations on `/api/`. Credentials/models come from the CouchDB `configurations` doc, not env vars.
46
+
-`gateway/` — standalone Express + WebSocket gateway with internal `chatapi` and `public` modules. It serves chat on the existing `/ml/` namespace and scoped public operations on `/api/`. Credentials/models come from the CouchDB `configurations` doc, not env vars.
47
47
-`design/` — CouchDB design documents (map/reduce views). Edit the per-db `.js` files and re-run `couchdb-setup.sh` to upload.
48
-
-`docker/` — Dockerfiles for `planet` (nginx + built Angular bundle), `planet-gateway`, and `db-init`. `docker/planet/default.conf.template` and `docker/planet/scripts/` drive the production entrypoint.
48
+
-`docker/` — Dockerfiles for `planet` (nginx + built Angular bundle), `gateway`, and `db-init`. `docker/planet/default.conf.template` and `docker/planet/scripts/` drive the production entrypoint.
49
49
-`src/environments/` — `environment.ts` (local dev), `environment.dev.ts` (generated by `dev-env.sh`, git-ignored), `environment.test.ts`, `environment.prod.ts`, plus the `environment.template` consumed by `dev-env.sh`.
50
50
-`src/i18n/messages.*.xlf` — translation catalogs; do not edit by hand outside a normal i18n extraction flow.
51
51
@@ -63,4 +63,4 @@ From `Style-Guide.md` (read it before making UI changes):
63
63
64
64
### Git workflow
65
65
66
-
Develop on feature branches off `master`; the project asks for two positive reviews before merging. Install hooks (`npm run install-hooks`) so `pre-push` enforces lint in both `./` and `planet-gateway/`.
66
+
Develop on feature branches off `master`; the project asks for two positive reviews before merging. Install hooks (`npm run install-hooks`) so `pre-push` enforces lint in both `./` and `gateway/`.
Run ```docker ps -a``` after a minute. You should see two containers running: planet-gateway and couchdb. The db-init container should have exited.
47
+
Run ```docker ps -a``` after a minute. You should see two containers running: gateway and couchdb. The db-init container should have exited.
48
48
49
49
Configure CORS for CouchDB:
50
50
```
@@ -72,13 +72,13 @@ ng serve
72
72
Visit localhost:3000 to access the Planet app.
73
73
If port 3000 is in use, try ```ng serve --port 3001```
74
74
75
-
## Planet Gateway Notes
75
+
## Gateway Notes
76
76
77
77
Configure the models (API keys & Models & Assistant settings) through the `manager dashboard -> AI Configurations` or directly in the `configurations` database in CouchDB.
78
78
79
79
Supported models: *OpenAI*, *Perplexity*, *Deepseek*, and *Gemini*
80
80
81
-
For gateway development instructions, refer to the [planet-gateway README](planet-gateway/README.md).
81
+
For gateway development instructions, refer to the [gateway README](gateway/README.md).
0 commit comments