endpoints
~25
Project Detail
Express.js REST API that implements core garage operations: user (employee/customer) management, vehicle registry, service catalog CRUD, order lifecycle (create/assign/complete/delete), and transactional email notifications. Implements aut...
endpoints
~25
models
5
estimated_loc
~1.2k
httpOnly cookies prevent client JavaScript access (mitigates simple XSS extraction). Easier to integrate with browser-based clients and same-site policies.
Trade-off: Increases CSRF surface unless additional CSRF protections are added; requires correct sameSite/secure settings for cross-site use; cookie approach is stateful from a browser perspective (but token itself is stateless).
Mongoose simplifies schema definition, population of refs, and common query patterns used across services.
Trade-off: Adds abstraction overhead and can hide inefficient queries; harder to fine-tune raw queries vs native driver.
Simpler implementation with immediate feedback during dev/test; production safety avoids runtime failures due to expired refresh tokens.
Trade-off: Synchronous calls increase latency for write operations; no background retries or delivery guarantees beyond Nodemailer response; real production should use a queue or transactional outbox.
Provides a single back-end service to operate an auto-repair shop workflow (register customers, add vehicles, create service orders, assign employees, notify customers) and administrative staff management.
Monolithic single-process Node.js application (Express) with a layered code organization (middleware → controllers → services → models) and direct integration to MongoDB via Mongoose. Packaged with Docker for deployment.
Key measurable signals: endpoints (~25), models (5), estimated_loc (~1.2k).
| Dimension | Selected Option | Impact | Compromise |
|---|---|---|---|
| Authentication storage | httpOnly JWT cookie | Reduced exposure to JS-based token theft (XSS), seamless browser integration | Requires CSRF mitigations; cookie policies must be correct for cross-site scenarios |
| Email delivery model | Synchronous sends in service layer, short-circuit in production | Simple implementation and immediate developer feedback in dev/test | Adds latency to write operations and has no retry/DLQ; not robust under load |
Add an asynchronous job queue (Redis + BullMQ or RabbitMQ) for email and other long-running side effects; include retry/backoff and dead-lettering.
Add structured logging, metrics and tracing (e.g., Winston/Elastic or Prometheus + Grafana) and an error aggregation tool (Sentry) to produce measurable telemetry.