Skip to content

AkankshShigwan/admin-service

 
 

Admin Service

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.


Features

  • 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

Architecture

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).


Getting Started

Prerequisites

  • Node.js v16+
  • MongoDB instance (local, Docker, or cloud)
  • A running user-service instance (for user management APIs)

Environment Variables

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

API Endpoints

  • GET /admin/users — List all users
  • GET /admin/users/:id — Get user by ID
  • PATCH /admin/users/:id — Update user profile/roles/status
  • POST /admin/users/:id/password/change — Change user password
  • DELETE /admin/users/:id — Delete user account

All endpoints require a valid admin JWT in the Authorization header.


Contributing

Contributions are welcome! Please open issues or submit pull requests.


License

MIT License


Contact

For questions or support, reach out to the AIOutlet dev team.

About

Provides back-office tools for managing users, products, analytics, and system configuration

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 95.8%
  • Dockerfile 4.2%