Recommendation: Integrate error tracking for production:
// packages/logger/src/sentry.ts
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
tracesSampleRate: 1.0,
});Create: packages/trpc/src/middleware/request-id.ts
import { v4 as uuidv4 } from "uuid";
export function addRequestId() {
return async ({ ctx, next }: { ctx: any; next: any }) => {
const requestId = uuidv4();
return next({
ctx: {
...ctx,
requestId,
},
});
};
}Recommendation: Add query timeouts to prevent hanging queries:
// packages/drizzle/src/index.ts
export const db = drizzle(sql, {
maxRetries: 3,
retryDelay: 1000,
});Issue: No Husky or lint-staged configuration to enforce code quality before commits.
Recommendation:
- Install Husky and lint-staged
- Configure pre-commit hooks for:
- Linting
- Type checking
- Formatting
- Test running (optional)
Action: Set up Husky with lint-staged configuration.