Imported from XinHu98/seed_sys (
AGENTS.md). Install upstream withnpx skills add XinHu98/seed_sys. Copyright stays with the author.
Repository Guidelines
Project Structure & Module Organization
server/: Express + Prisma API in TypeScript (src/routes/services/middleware), compiled todist/; env config lives in.envwith sample.env.example; file uploads land inuploads/.client/: Vite + React admin UI (components/,pages/,services/,contexts/,types/,utils/); entry atApp.tsxandindex.tsx.customer/: Vite + React customer portal (Tailwind) with a similar layout.shared/: Cross-app TypeScript types; import via@shared/*.docs/: Product, design, and audit references; update when flows change.
Build, Test, and Development Commands
npm run install:allinstalls root/client/server deps; run once after cloning.npm run devruns API and admin UI together (dev:server+dev:client).npm run dev --prefix customerruns the portal locally.npm run buildbuilds client and server;npm run startserves compiled API (server/dist/index.js).- Prisma:
npm run db:generate|db:migrate|db:push|db:seed|db:studio --prefix serverfor schema updates, migrations, seeding, and the studio UI. - Health check:
curl http://localhost:3001/api/healthafter the server starts.
Coding Style & Naming Conventions
- TypeScript/ESM everywhere; server
tsconfigisstrict. Prefer 2-space indent, trailing semicolons, and readable arrow functions. PascalCaseReact components and type aliases;camelCasevariables/functions;SCREAMING_SNAKE_CASEenv keys.- Keep React logic in
components/and page wiring inpages/; reuse types fromshared/types.ts. - Server routes live in
server/src/routes/; keep auth/validation middleware inmiddleware/; favor explicit input validation before DB calls.
Testing Guidelines
- No formal test suite yet; at minimum run
npm run build --prefix serverandnpm run build --prefix clientto catch type errors. - For new features, add lightweight Vitest/Jest + Supertest coverage under
server/src/__tests__/and component tests underclient/src/__tests__/; document any manual steps (e.g., portal link generation, uploads).
Commit & Pull Request Guidelines
- Use Conventional Commits (
feat:,fix:,chore:,docs:) and keep messages scoped to one change. - PRs should describe intent, impacted endpoints/pages, and testing done; attach screenshots for UI tweaks and list any migration or env var changes.
- When Prisma schema changes, include migration SQL or regeneration steps and note required data/backfill work.
Security & Configuration Tips
- Keep secrets in
server/.envand UI env hints inclient/.env.local; never commit them. EnsureDATABASE_URL,JWT_SECRET, andPORTAL_URLare set before running. - Uploaded files under
server/uploads/are served statically; avoid committing generated assets and clear sensitive data before sharing logs.