Simple microservice based dashboard
1.3K
Although I started all the services in this single repo, it quickly became obvious that it can get hard to maintain them all in one. Thus I moved the whole project to https://github.com/deshboard
This is a simple, microservice-based dashboard application.
Normally all services should be in a separate repo, but for simplicity all of them are here. That said, they are completely separated (database, migrations, etc), so they can easily be extracted to their own repositories.
Running the following commands should set up the environment with an admin user (with password admin).
The frontend should be available at http://localhost:8080.
To make sure there are no colliding ports, you should stop all other Docker containers
(or configure the mapped ports in docker-compose.override.yml)
$ cp docker-compose.override.yml.example docker-compose.override.yml
$ make setup start
$ curl -i -X POST localhost:52481 -H "Host: service.model.user" -H "Content-Type: application/json" -d '{"username": "admin", "password": "admin"}'
Note: Depending on which images are already available locally (and on your download speed), this could take some time from a few minutes to a standard coffee break.
Create a docker-composer.override.yml file based on the example to expose the necessary ports.
Then run the following commands:
$ make setup
$ make start
The setup target will:
Sometimes it makes sense to update the images of the project:
$ make update
$ make start
You might even want to get a clean environment and update your Docker Compose override config.
The gateway is responsible for publishing the specific Microservice endpoints.
Some internal services are (of course) not published, but in order to make development easier,
these are available under the service's host service.[type].[name].
Example:
$ curl -i localhost:52481/admin -H "Host: service.model.user"
In order to use to "production" setup of the dashboard locally the port 52481 is automatically configured for the gateway. This is also configured in the frontend which will connect to your localhost on this port to communicate with the API.
Adding a new user is as simple as an HTTP call:
$ curl -i -X POST localhost:52481 -H "Host: service.model.user" -H "Content-Type: application/json" -d '{"username": "admin", "password": "admin"}'
The current configuration of port mappings is quite flexible, so you can even work on multiple projects at once. This comfort can quickly lead to having dozens of containers running which can eat up all the resources in your computer. So don't forget to stop them if you finished working:
$ make stop
Alternatively, you can call it with force to kill them all immediately:
$ make FORCE=true stop
To add new endpoints to an already running Gateway tun the following command:
$ make gateway
To apply changes to existing endpoints you have to manually delete that endpoint (for now). It can easily be done with KongDash.
Sometimes you might want to start over. Here is how you can:
$ make clean
The FORCE option works here as well to immediately kill all the running containers.
The MIT License (MIT). Please see License File for more information.
Content type
Image
Digest
Size
237.4 MB
Last updated
over 9 years ago
docker pull sagikazarmark/dashboard:model-user-migration