This document serves as a shared guideline for all team members when using Claude Code in this opensource LMRing repository.
- Framework: Next.js 16, React 19, TypeScript 6.0+
- Build System: Turborepo with pnpm workspaces
- UI: shadcn/ui, Tailwind CSS 4
- State: Zustand
- Database: PostgreSQL, DrizzleORM
- Auth: Better-Auth
- Testing: Vitest, Playwright
- Linting: Biome
- i18n: i18next, react-i18next (en, fr, zh)
- AI: Vercel AI SDK
lmring/
├── apps/web/ # Next.js application
└── packages/ # Shared packages
├── ai-hub/ # AI provider integration
├── auth/ # Authentication
├── config/ # Shared config (biome, tailwind, typescript, vitest)
├── database/ # DrizzleORM schemas
├── env/ # Environment variable management
├── i18n/ # Internationalization
├── model-depot/ # AI model definitions
├── storage/ # File storage (S3, Supabase)
├── theme/ # Theme engine, tokens, presets, CSS variable generation
├── ui/ # UI components
└── video-runtime/ # Video generation runtime
- Use rebase for git pull
- Git commit message should prefix with gitmoji
- Git branch name format:
<type>/<feature-name> - Use
.github/pull_request_template.mdfor PR description - PR titles starting with
✨ feat/or🐛 fixtrigger release workflow
- Use
pnpmas the primary package manager - Workspace packages reference each other as
workspace:*
Commands:
- Web:
pnpm --filter @lmring/web test '[file-path-pattern]' - Packages:
pnpm --filter @lmring/<package> test '[file-path-pattern]'
Important:
- Wrap file paths in single quotes
- Never run
pnpm test(runs all tests, takes significant time) - Stop and ask for help if test fails twice
- Prefer
vi.spyOnovervi.mock - Tests must pass type check:
pnpm check:types
pnpm check:types- Check all packagespnpm --filter <workspace> check:types- Check specific package
pnpm lint- Check errorspnpm lint:fix- Auto-fix errors
- Keys: Add to
apps/web/src/locales/{locale}.json - Dev: Translate all three locale files (en, fr, zh)
- Supported locales:
en,fr,zh
pnpm db:generate- Generate migrationspnpm db:migrate- Run migrations (requires env vars)pnpm db:studio- Open Drizzle Studio
pnpm dev # Start dev server
pnpm build # Build all packages
pnpm check:types # Type check
pnpm lint:fix # Lint and fix
pnpm test # Run tests (avoid, use filtered tests)
pnpm test:e2e # Run E2E testsPre-commit: Runs lint-staged (executes lint:fix and check:types on staged files)
Commit-msg: Validates conventional commits via commitlint
- Node.js: v24.11.1+
- Package Manager: pnpm 10.34.0
- Dev Server: Turbopack