apps/web/is the Next.js App Router app. Key areas:src/app(routes),src/modules(feature modules),src/features(domain features),src/server(Hono API logic),content/(MDX), andpublic/(static assets).packages/contains shared workspace packages:config(feature flags/settings),lib(Prisma schema, auth, i18n), andui(shared components).docs/anddevdocs/hold documentation;scripts/contains repo utilities;openspec/hosts specs and change docs.
Use pnpm (Node.js >= 20). From repo root:
pnpm devstarts the dev server via Turbo (runsapps/web).pnpm buildbuilds for production;pnpm startruns the production server.pnpm lint/pnpm lint:fixrun Biome linting;pnpm formatformats with Biome.pnpm type-checkruns TypeScript checks.pnpm e2e/pnpm e2e:cirun Playwright end-to-end tests.pnpm db:generate,pnpm db:push,pnpm db:migrate,pnpm db:studiomanage Prisma workflows.
- Indentation: tabs, size 4, LF line endings (see
.editorconfig). - TypeScript strict mode; prefer
interfaceovertype; avoidenum(use const objects). - Naming:
camelCasefor variables/functions,PascalCasefor components/types,UPPER_SNAKE_CASEfor constants,kebab-casefilenames. - Tailwind-first styling; keep class order layout -> spacing -> color -> border -> effects.
- Import order: React/Next, third-party, internal aliases (
@/,@community/*), then relative.
- Unit tests live under
**/__tests__/and use*.test.ts(x)naming. - Strategy: Jest + Testing Library for unit tests and Playwright for E2E; unit coverage target is 80%+ (see
DEVELOPMENT.md). - Run E2E with
pnpm e2e. For new unit tests, follow patterns in existing__tests__folders.
- Prefer Conventional Commits:
type(scope): description(e.g.,feat(auth): add WeChat login). - Branch naming:
feature/...orfix/..., branched fromdevelop. - PRs target
develop(ormainfor hotfixes) and should include a clear summary, test checklist, linked issues, and UI screenshots when relevant.
- Copy
apps/web/.env.exampletoapps/web/.env.localand update values. - Prisma schema:
packages/lib-server/src/database/prisma/schema.prisma.
- When adding new components / UI, please read STYLE_GUIDE.md
- The project uses a single codebase for both desktop and mobile (responsive design via Tailwind breakpoints, no separate mobile app). Use
lg:hiddenfor mobile-only components andhidden lg:blockfor desktop-only. Key mobile components:TabBar(bottom nav) andMobileCategoryNav(top category scroll nav). - Mobile navigation rule:
MobileCategoryNav(global categories like 活动/作品/组织/任务/动态) should appear on list pages (e.g./events,/projects,/orgs,/tasks,/posts) and also on organization detail pages (/orgs/[slug]) in mobile. - Organization detail uses its own top tabs (
overview/events/members, query param?tab=) and can coexist with global mobile top category nav when required by product behavior. MobileCategoryNav"组织" tab behavior: if the user has joined organizations, navigate to their preferred/last visited organization page (/orgs/{preferredSlug}); otherwise navigate to/orgsdiscovery.- On
/orgs/[slug], keep an explicit way to return to discovery (/orgs) and support organization switching for users who belong to multiple organizations.
- If using AI assistance, read
CLAUDE.md. For proposals/spec changes, start withopenspec/AGENTS.md.