This is a React TypeScript application for project management with a Node.js backend. We follow Domain-Driven Design principles and use a microservices architecture.
- Frontend: React 19, TypeScript 5.9, Vite, TailwindCSS 4
- Backend: Bun, Elysia, TypeScript, oRPC, Drizzle ORM
- Database: PostgreSQL 18
- Testing: Bun, happy-dom, React Testing Library, Playwright
- Infrastructure: Docker, Coolify
npm run dev: Start development server (frontend on :3000, backend on :3001)npm run build: Production build with optimizationnpm run typecheck: Full TypeScript validationnpm test: Run unit tests with coveragenpm run test:e2e: Playwright end-to-end testsnpm run db:migrate: Apply database migrationsnpm run db:seed: Seed development data
- Use functional components with hooks (no class components)
- Prefer composition over inheritance
- Follow compound component patterns for complex UI
- Use custom hooks for shared logic
- TypeScript strict mode enabled
- ESLint + Prettier for formatting
- Conventional commits (feat:, fix:, docs:, etc.)
- Feature-based folder structure (not type-based)
- Barrel exports from index.ts files (if it cause linter error, disable for the file)
- Custom hooks pattern:
useFeatureName - API layer:
packages/api/src/routers/featureName.ts - State management: Zustand for global state, React state for local
- Error boundaries for component error handling
- Write tests before implementing features (TDD)
- Focus on user behavior, not implementation details
- Use
data-testidfor element selection - Mock external dependencies, test integration at boundaries
- Aim for 75%+ code coverage
- Use Drizzle schema-first approach
- Soft deletes with
deletedAttimestamps - UUID primary keys for public-facing entities
- Created/updated timestamp tracking
- Database migrations in version control
- All API endpoints require authentication except
/health - Use
helmet.jsfor security headers - Input validation with Zod schemas
- Rate limiting on public endpoints
- CORS configured for production domains only
- Blue-green deployment strategy
- Environment-specific configs in
.envfiles - Docker multi-stage builds for optimization
- Secrets managed through Infisical
- Feature branch workflow with PR reviews
- Squash commits before merging
- Deploy to staging automatically on main branch
- Production deploys require manual approval
- Breaking changes require RFC discussion
- Never use
--no-verifywhen committing (bypasses pre-commit hooks)
- Don't use any dependencies in database migrations
- Avoid defaultProps in TypeScript components (use default parameters)
- Don't commit
.envfiles (use.env.exampleinstead) - Always handle loading and error states in components
- Don't use
anyorunknowntypes without good reason
- Lazy load route components
- Use
React.memofor expensive components - Debounce search inputs and API calls
- Optimize bundle size with
webpack-bundle-analyzer - Use CDN for static assets
- Use React DevTools and Redux DevTools
- Enable source maps in development
- Use VS Code debugger with
launch.jsonconfiguration - Log structured data for easier parsing
- Use error tracking (Sentry) in production
- Avoid adding new dependencies without team discussion
- Prefer utilities from lodash over custom implementations
- Use
date-fnsinstead ofmoment.js(bundle size) - UI components from our custom design system only
- All public functions must have JSDoc comments
- README files for each major feature
- API documentation with OpenAPI/Scalar
- Architecture Decision Records (ADRs) for major decisions