booksvc

command module
v0.0.0-...-67f085a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 1 Imported by: 0

README

Book Service API

Book Service API is another implementation of DDD written in Golang. This project was inspired by Marko Milojevic's Medium post series about "Practical DDD in Golang"

How to run it?

I will only tell you how to run it inside Docker. Hence the following software is required:

  • docker
  • docker-compose

To start running the service, all you need to do is running the docker-compose up -d command. But, YOU'RE NOT DONE YET. As you can see on the log, it fails to connect to the database. That's because you don't have necessary user and privileges to do so.

To solve this issue, you can log into mongosh inside the docker by running:

docker-compose exec -it database mongosh

After you logged in, create new user and setup necessary privileges.

use admin

db.createUser({
    user: "bookkeeper",
    pwd: "123456",
    roles: [
        { role: 'userAdminAnyDatabase', db: 'admin' },
        { role: 'readWriteAnyDatabase', db: 'admin' },
        { role: 'dbAdminAnyDatabase', db: 'admin' }
    ]
})

Then, go ahead restart the application by running

docker-compose restart app
docker-compose logs -f app

License

This code is licensed under the MIT License.

Documentation

Overview

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL