Mechanic Setu Backend
Express, PostgreSQL, JWT authentication, RBAC, and profile APIs for Mechanic Setu.

Mechanic Setu is a backend platform for customers, mechanics, and administrators. The current documented modules cover password-based authentication, refresh-token rotation, role-based authorization, and authenticated user profile management.
Modules
Authentication
Register, login, refresh tokens, logout, current-user loading, JWT strategy, and RBAC.
User Profile
Read and update the authenticated user's name, email, and profile image.
API Reference
See the documented route groups, authentication requirements, and response shape.
Backend Shape
The backend uses a feature-folder Express architecture:
- Routes define paths and middleware.
- Controllers translate HTTP input and output.
- Services enforce business rules.
- Repositories own SQL.
- DTOs shape public responses and prevent sensitive data leaks.
Main Capabilities
- Password-based registration and login for
CUSTOMERandMECHANICusers. - JWT access tokens and rotating JWT refresh tokens.
- Refresh-token reuse detection with token-family revocation.
- Role-based authorization with
CUSTOMER,MECHANIC, andADMINroles. - Authenticated user profile read and update APIs.
- PostgreSQL migrations for auth tables and profile columns.