Engineering & Coding Standards
1. TypeScript & Type Safety
- Enable strict mode (strict: true) in sconfig.json.
- Avoid using ny; prefer explicit interfaces, unions, or unknown with type guards.
- Share core types across frontend and backend when applicable.
2. Backend (Moleculer.js & Node.js)
- Service Isolation: Keep Moleculer service actions idempotent and lightweight.
- Error Handling: Throw standardized MoleculerClientError or custom application errors with actionable error codes.
- Database Transactions: Wrap multi-table operations in Prisma $transaction blocks.
- Use functional components with typed props.
- Group state management by domain module using Redux Toolkit slices and Sagas.
- Avoid prop drilling; use dedicated component selectors.