2.2 KiB
2.2 KiB
AGENTS.md
APLP LMS frontend. React 19 + Vite 8 + React Router 7 + Tailwind v4. Plain JS/JSX (no TypeScript).
Commands
npm run dev— Vite dev servernpm run lint— ESLint (flat config,eslint.config.js); this is the only checknpm run build— production build- No test suite and no typecheck. Do not claim tests pass; verify with
npm run lintandnpm run build.
Architecture
- Entry:
src/main.jsx→src/App.jsx. All routes are declared inApp.jsx; sidebar entries insrc/config/navigation.js. Add both when adding a page. @is aliased tosrc(vite.config.js). Use@/services/...,@/lib/....- API layer:
src/lib/api.jsis a shared axios instance. Base URL =VITE_API_BASE_URL, defaulthttp://localhost:8080..envis gitignored and there is no.env.example. - Feature data access lives in
src/services/<name>Service.js(courseService,lessonService,sectionService). Follow that shape:api+BASE_PATH = '/api/<resource>'+getAll/getById/create/update/delete. Add a new service rather than callingaxios/apidirectly from a page. - Pages:
src/pages/<feature>/. Layout/nav shell:src/layouts/MainLayout.jsx.
Tailwind v4
- No
tailwind.config.js. Config is CSS-first in the@themeblock ofsrc/App.css, which is the file that@import 'tailwindcss'(imported fromApp.jsx, notindex.css). - Use the semantic tokens, not raw Kraken hex:
bg-app-primary,hover:bg-app-primary-dark,bg-app-surface-muted,text-app-text,text-app-text-muted,border-app-border,shadow-app-panel,shadow-app-micro. - Visual rules (colors, type, radii, do/don't) are in
DESIGN.md— read it before styling.
UI components
src/components/ui/*are hand-rolled shadcn-style primitives (cva + Radix +cn()fromsrc/lib/utils.js). There is no shadcn CLI orcomponents.json; extend these files by hand.- Icons come from
react-icons/hi2.
Gotchas
App.jsximports./pages/Course/*but the directory on disk issrc/pages/course/. This only works on case-insensitive macOS; use the lowercase path to stay safe on Linux/CI.- Imports are mixed: some relative (
../../components/...), some aliased (@/services/...). Match the surrounding file.