Fix issue #33: Try to remove ecosystem
All checks were successful
Test / test (push) Successful in 2s

This commit is contained in:
Gitea OpenCode Agent
2026-10-14 17:50:31 +00:00
parent e11c6fc4f3
commit 1d3d978cda
3 changed files with 42 additions and 27 deletions

View File

@@ -26,15 +26,20 @@ self-hosted Gitea; `.gitea/workflows/deploy.yml` builds and deploys Docker image
keeps corepack from asking in non-interactive shells.
```bash
npm install --prefix backend && npm install --prefix frontend # root `npm install` = concurrently only
npm run dev # backend :5000 + frontend :3000 + discord-bot + scripts/run-foundry.js
npm --prefix backend run dev # or --prefix frontend run dev | build | preview
npm test
pnpm install # whole workspace, one lockfile (`-r` / `--filter <pkg>` for a single one)
pnpm dev # backend :5000 + frontend :3000 + discord-bot + scripts/run-foundry.js
pnpm dev:backend # or dev:frontend | dev:discord-bot
pnpm --filter ./frontend run build # or preview
pnpm test
```
No `start` script in backend/frontend and no lint command. Verification = run the dev server and
exercise the flow (`GET /api/test` returns a JSON hello).
There is no PM2 and no `ecosystem.config.js`: `pnpm dev` starts every dev process at the same time
through the workspace (`concurrently` only labels them and kills them together), and production runs
from the compose images (`CMD` of each `Dockerfile`).
Env: `backend/.env` (`PORT` is read but ignored, `DB_URI`), `frontend/.env` (`NUXT_PUBLIC_API_BASE_URL`),
both gitignored; the `.env.production` files are committed. `backend/src/index.js` loads `.env.$NODE_ENV`
when `NODE_ENV` is set, otherwise `.env`. The server always listens on **5000**.
@@ -217,7 +222,7 @@ new string to all three locales.** Namespaces in use: `general`, `login`, `regis
4. `POST /api/note/delete` has **no ownership check** (any authenticated user can delete any note id); the other `note.js` handlers and `folder.js` do check.
5. `/api/user/*` is mounted before the JWT guard: new routes there are public unless they authenticate inline (`/api/discord` is also before it, but every route there is gated by `requireBot`, the shared bot-secret header). `services/middleware.js`'s `isAdmin` is imported but applied to no route.
6. `composables/useEmitter.ts` reads `$emitter` from `useNuxtApp()` and no plugin provides it — use `~/services/Emitter`.
7. App-wide CORS only whitelists `http://localhost:3000`; `.env.production` files are committed with internal hosts; `ecosystem.config.js` runs `npm start`, which backend/frontend do not define (PM2 is dead, compose + nginx is the real deploy).
7. App-wide CORS only whitelists `http://localhost:3000`; `.env.production` files are committed with internal hosts.
8. `Windows.js`: `getComponent` caches `defineAsyncComponent` per type for the whole process (restart the dev server if a new window misbehaves), `SetupHandle` attaches `document` mouse listeners per window and never removes them, and `ClearAll()` iterates `Object.keys(windows)` instead of `windows.value`.
9. The frontend treats the JWT as the user cache: `settings` changes need `GetUserSetting`/`SetUserSetting` round-trips, the token payload goes stale.