Initial scaffold: full-stack RackMapper application

Complete project scaffold with working auth, REST API, Prisma/SQLite
schema, Docker config, and React frontend for both Rack Planner and
Service Mapper modules. Both server and client pass TypeScript strict
mode with zero errors. Initial migration applied.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 21:48:56 -05:00
parent 61a4d37d94
commit 231de3d005
79 changed files with 12983 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { Request, Response, NextFunction } from 'express';
import { AppError, err } from '../types/index';
export function errorHandler(
error: Error,
_req: Request,
res: Response,
_next: NextFunction
): void {
const statusCode = error instanceof AppError ? error.statusCode : 500;
const code = error instanceof AppError ? error.code : 'INTERNAL_ERROR';
const message =
process.env.NODE_ENV === 'production' && statusCode === 500
? 'Internal server error'
: error.message;
if (statusCode === 500 && process.env.NODE_ENV !== 'production') {
console.error('[ErrorHandler]', error);
}
res.status(statusCode).json(err(message, code ? { code } : undefined));
}