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

51
server/routes/modules.ts Normal file
View File

@@ -0,0 +1,51 @@
import { Router, Request, Response, NextFunction } from 'express';
import * as moduleService from '../services/moduleService';
import { ok } from '../types/index';
export const modulesRouter = Router();
modulesRouter.put('/:id', async (req: Request, res: Response, next: NextFunction) => {
try {
const { name, uPosition, uSize, manufacturer, model, ipAddress, notes } = req.body as {
name?: string;
uPosition?: number;
uSize?: number;
manufacturer?: string;
model?: string;
ipAddress?: string;
notes?: string;
};
res.json(
ok(
await moduleService.updateModule(req.params.id, {
name,
uPosition,
uSize,
manufacturer,
model,
ipAddress,
notes,
})
)
);
} catch (e) {
next(e);
}
});
modulesRouter.delete('/:id', async (req: Request, res: Response, next: NextFunction) => {
try {
await moduleService.deleteModule(req.params.id);
res.json(ok(null));
} catch (e) {
next(e);
}
});
modulesRouter.get('/:id/ports', async (req: Request, res: Response, next: NextFunction) => {
try {
res.json(ok(await moduleService.getModulePorts(req.params.id)));
} catch (e) {
next(e);
}
});