This file provides guidance to Claude Code when working with this repository.
This repository is the current SAST Link Frontend V2 implementation, not a generic starter template. It combines:
- Next.js 16 App Router
- React 19
- TypeScript
- Tailwind CSS v4
- shadcn/ui-style primitives
- Zustand for client-side state
- Axios + SWR for frontend data access patterns
/account switcher and quick-login entry/logintwo-step login/registerthree-step registration/resetpassword reset/oauth/callbackthird-party OAuth login landing page (exchanges the login code, or forwards new accounts to register)
/homeuser homepage overview/settingsaccount settings and profile overview/settings/editprofile editing and avatar upload/cropping/oauth/bind/lark//oauth/bind/githubthird-party bind callbacks (frontend assembles the authorize URL; the provider bounces back here)
/admin/usersuser search, filtering, editing, deletion, and restoration/admin/oauth-clientsOAuth client registration and status management/admin/audit-logsaudit log filtering and pagination
admin can access all three routes. lecturer has read-only access to user management.
- Web mode:
pnpm dev - Static-export build:
pnpm build
pnpm dev
pnpm build
pnpm start
pnpm lint
pnpm test
pnpm test:watch
pnpm test:coverage
pnpm exec tsc --noEmit
pnpm dlx shadcn@latest add <component-name>app/App Router routes, layouts, providers, and page testscomponents/shared UI and feature-oriented componentshooks/shared hooks such asuse-fetch-profilelib/api/Axios client plus auth/user/oauth wrapperslib/validations/form validation rulesstore/Zustand stores for auth, accounts, panels, and profile statemocks/MSW bootstraptests/shared test helpers and higher-level tests
next.config.tsusesoutput: "export"
- Tailwind CSS v4 via PostCSS
- shared CSS variables in
app/globals.css tw-animate-css- shadcn/ui-style component patterns in
components/ui/
This repository already has an active Jest setup.
- Test runner: Jest 30
- Environment:
jest-fixed-jsdom - Coverage command:
pnpm test:coverage - Config:
jest.config.ts - Setup files:
jest.setup.ts,jest.polyfills.ts
Tests currently exist across:
app/components/hooks/lib/store/
@/* maps to the repository root.
Common imports:
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { useAuthStore } from "@/store/use-auth-store";- Always use
pnpm. - Do not assume this repo is still a starter; inspect the real route groups and state/API modules first.
NEXT_PUBLIC_API_BASE_URLis the backend base URL — local dev points straight at the backend (e.g.http://localhost:8080), no/apisprefix.- The npm package name still uses starter-style naming; treat current code/config as source of truth rather than marketing labels.
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.