Skip to content

This is a demonstration of a user microservice with MongoDB as the datastore

License

Notifications You must be signed in to change notification settings

jackmcguire1/UserService

Repository files navigation

User Service

Go Report Card codecov

ABOUT

This repo contains a go module that exposes a User Microservice using MongoDB as a datastore

Prerequisites

SWAGGER HUB

https://app.swaggerhub.com/apis/jackmcguire1/User-Service/1.0.2

SETUP

setup your mongo connection details in docker-compose.yaml

environment:
    - MONGO_HOST=mongodb+srv://****
    - MONGO_DATABASE=***
    - MONGO_USERS_COLLECTION=users

run the docker-compose stack

docker-compose up -d && docker compose watch

Environment Variables

  • EVENTS_URL - external HTTP endpoint provided by interested services
  • LOG_VERBOSITY - warn | error | info | debug
  • MONGO_HOST - your mongo host url
  • MONGO_DATABASE - your mongo database
  • MONGO_USERS_COLLECTION - your mongo user's collection

REQUIREMENTS

The service must allow you to:

  • add a new User
  • modify an existing User
  • remove a User
  • return a list of the Users, allowing for filtering by certain criteria (e.g. all Users with the country "GB")

The service must include:

  • A sensible storage mechanism for the Users
  • The ability to send events to notify other interested services of changes to User entities

Thanks

This project exists thanks to ME!.

Donations

All donations are appreciated!

Donate

About

This is a demonstration of a user microservice with MongoDB as the datastore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published