Skip to main content

Identity Service

The Identity Service is the central authority for authentication and user management in the FitNexa platform.

🚀 Responsibilities

  • Authentication: Login and registration flows using JWT.
  • User Management: Profile updates, password resets, and bio/avatar management.
  • Role-Based Access Control (RBAC): Distinguishing between MEMBERS, GYM_ADMINS, and SUPER_ADMINS.
  • QR Code Generation: Generating unique check-in codes for members.

🛠️ Technical Details

  • Port: 3007
  • Database: fitnexa_identity (PostgreSQL)
  • Primary Model: User
  • Authentication: JWT (JSON Web Token) strategy.

📡 API Endpoints

Auth Routes (/auth)

  • POST /register: Create a new user account.
  • POST /login: Authenticate and receive a JWT.
  • GET /me: Get current authenticated user details.

User Routes (/users)

  • GET /users/me: Get current authenticated user details.
  • GET /users/all: List all users (Admin only).
  • GET /users/super-admins: List Super Admins (Support).
  • GET /users/:id: Get specific user profile.
  • PUT /profile: Update personal profile information.
  • POST /profile/upload: Upload a new profile picture.

💾 Model: User

FieldTypeDescription
idUUIDUnique identifier
emailStringUnique login email
roleStringMEMBER, GYM_ADMIN, or SUPER_ADMIN
gymIdString?ID of the gym the user belongs to
qrCodeString?Unique string for physical check-ins
avatarString?Path to stored profile image

Back to Services Catalog