https://github.com/aioutlet/user-service
Manages user accounts, profiles, and role-based access
https://github.com/aioutlet/user-service
aioutlet express microservice mongodb node
Last synced: 7 months ago
JSON representation
Manages user accounts, profiles, and role-based access
- Host: GitHub
- URL: https://github.com/aioutlet/user-service
- Owner: aioutlet
- License: mit
- Created: 2025-06-18T09:05:51.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-03T21:55:21.000Z (7 months ago)
- Last Synced: 2025-09-03T23:31:46.131Z (7 months ago)
- Topics: aioutlet, express, microservice, mongodb, node
- Language: JavaScript
- Homepage:
- Size: 604 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# User Service
The `user-service` is responsible for user data management, profile updates, and user account lifecycle for the AIOutlet platform. It is a core microservice in the authentication and user management architecture.
---
## Features
- User registration and profile management
- Secure password storage and update (local credentials)
- Social login support (Google, Facebook, Twitter, etc.)
- Role-based access control (RBAC)
- Email verification status
- Account activation/deactivation
- Structured logging and error handling
- Distributed tracing support
---
## Architecture
This service is built with Node.js and Express, using Passport.js for authentication strategies and Mongoose for MongoDB object modeling.
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)
### Environment Variables
Create a `.env` file in the root with the following variables:
```env
PORT=5000
# MongoDB connection variables
MONGODB_CONNECTION_SCHEME=mongodb
MONGODB_HOST=localhost
MONGODB_PORT=27017
MONGODB_USERNAME=
MONGODB_PASSWORD=
MONGODB_DB_NAME=user-service-db
MONGODB_DB_PARAMS=
# Logging configuration
LOG_LEVEL=info
LOG_TO_CONSOLE=true
LOG_TO_FILE=false
LOG_FILE_PATH=user-service.log
# OpenTelemetry tracing config (optional, for local dev)
OTEL_SERVICE_NAME=user-service
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
```
---
## API Endpoints
- `POST /users` — Register a new user
- `GET /users/:id` — Get user by ID
- `PATCH /users/:id` — Update user profile
- `POST /users/:id/password` — Set or reset user password
- `POST /users/:id/password/change` — Change user password (self-service)
- `DELETE /users/:id` — Delete user account
- `GET /users/findByEmail` — Find user by email
- `GET /users/findBySocial` — Find user by social login
Some endpoints require a valid 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.