admin-service is a microservice responsible for privileged user management and administrative operations for the AIOutlet platform. It provides secure endpoints for admin users to manage user accounts, roles, and statuses across the platform.
- List all users (admin only)
- View user details by ID
- Update user profile, roles, and status (activate/deactivate)
- Change user password (admin-initiated)
- Delete user accounts
- Robust input validation and error handling
- Structured logging for audit and traceability
- Forwards admin JWT to user-service for all privileged actions
This service is built with Node.js and Express, using Mongoose for MongoDB object modeling and Axios for inter-service communication with the user-service.
The microservice is designed to be deployed independently and can run locally, via Docker, or in Kubernetes (AKS).
- Node.js v16+
- MongoDB instance (local, Docker, or cloud)
- A running user-service instance (for user management APIs)
Create a .env file in the root with the following variables:
# .env.example for admin-service
USER_SERVICE_URL=http://localhost:5000/users
USER_SERVICE_SECRET=your-shared-secret
GET /admin/users— List all usersGET /admin/users/:id— Get user by IDPATCH /admin/users/:id— Update user profile/roles/statusPOST /admin/users/:id/password/change— Change user passwordDELETE /admin/users/:id— Delete user account
All endpoints require a valid admin JWT in the Authorization header.
Contributions are welcome! Please open issues or submit pull requests.
MIT License
For questions or support, reach out to the AIOutlet dev team.