Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximemoreillon/user-manager-mongodb
A service to manage users and their authentication
https://github.com/maximemoreillon/user-manager-mongodb
authentication mongodb nodejs user user-management
Last synced: 2 months ago
JSON representation
A service to manage users and their authentication
- Host: GitHub
- URL: https://github.com/maximemoreillon/user-manager-mongodb
- Owner: maximemoreillon
- License: mit
- Created: 2021-04-05T00:22:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-29T23:16:48.000Z (7 months ago)
- Last Synced: 2024-06-30T07:02:33.620Z (7 months ago)
- Topics: authentication, mongodb, nodejs, user, user-management
- Language: TypeScript
- Homepage:
- Size: 1.57 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# User manager (MongoDB version)
[![pipeline status](https://gitlab.com/moreillon_ci/user_manager_mongoose/badges/master/pipeline.svg)](https://gitlab.com/moreillon_ci/user_manager_mongoose/-/commits/master)
[![coverage report](https://gitlab.com/moreillon_ci/user_manager_mongoose/badges/master/coverage.svg)](https://gitlab.com/moreillon_ci/user_manager_mongoose/-/commits/master)
![Docker Pulls](https://img.shields.io/docker/pulls/moreillon/user-manager-mongoose)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/moreillon)](https://artifacthub.io/packages/search?repo=moreillon)A user management and authentication microservice.
User data is stored in a MongoDB database and accessed using Mongoose.
Interaction with user records is achieved via a REST API, built using Express.For more information, see this [Medium article](https://moreillon.medium.com/a-pluggable-user-management-and-authentication-service-for-web-applications-a6f23ae5816b)
## API
| Route | Method | query/body | Description |
| ------------------------- | ------ | ---------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| / | GET | - | Show application configuration |
| /users | GET | limit | Get the list of users |
| /users | POST | user properties | Creates a user. Mandatory properties are username (or email_address) and password |
| /users/{user_id} | GET | - | Get the user with the given user ID. Use 'self' for user currently logged in |
| /users/{user_id} | DELETE | - | Delete user with the given user ID. Use 'self' for user currently logged in |
| /users/{user_id} | PATCH | new user properties | Update user with the given user ID. Use 'self' for user currently logged in |
| /users/{user_id}/password | PUT | current password, new_password, new_password_confirm | Update the password of user with the given user ID. Use 'self' for user currently logged in |
| /auth/login | POST | username, password | Login, returns a jwt |## Environment variables
| Variable | Description |
| ------------------------- | ----------------------------------------------------------------------- |
| MONGODB_CONNECTION_STRING | The connection string for the MongoDB database |
| JWT_SECRET | Secret used to sign Tokens |
| ADMIN_USERNAME | The default username for the administrator account, defaults to 'admin' |
| ADMIN_PASSWORD | The default password for the administrator account, defaults to 'admin' |
| ALLOW_REGISTRATION | Allows unregistered users to create an account |
| SMTP_HOST | Host of the SMTP server (only used for registration) |
| SMTP_PORT | PORT of the SMTP server (only used for registration) |
| SMTP_USERNAME | Username for the SMTP server (only used for registration) |
| SMTP_PASSWORD | Password for the SMTP server (only used for registration) |
| SMTP_FROM | E-mail from (only used for registration) |