521 B
521 B
Code Patterns
Project Conventions
TypeScript Guidelines
- Use strict mode
- No
anytypes - Use interfaces for object shapes
- Use type guards for narrowing
- Export types from
types/index.ts
API Patterns
- Use middleware for cross-cutting concerns
- Validate all input
- Return consistent error responses
- Use proper HTTP status codes
- Log all requests
Error Handling
- Always catch and handle errors
- Log errors with context
- Return user-friendly messages
- Never expose internal details