Modify the frontend¶
If you need to modify the frontend /Watcher/Watcher/frontend:
From /Watcher/Watcher/, run the command below:
npm run dev
Let this command run in background.
Now, when modifying the frontend (React 19 + TypeScript + MUI, in /Watcher/Watcher/frontend/src), Vite rebuilds it into one file (/Watcher/Watcher/frontend/static/frontend/main.js, with main.css) that Django serves.
The code is organised by page: features/<module>/ holds the API calls, the TanStack Query hooks and the components of one page (features/overview is the home page), ui/ the shared building blocks (page header, tables, inspector, world map, charts) and layouts/AppShell.tsx the sidebar.
[IMPORTANT] When commit you have to run 1 time the commands below (type check + production build, then lint):
npm run build
npm run lint