Sign inSign up

sagikazarmark/dashboard

By sagikazarmark

Updated over 9 years ago

Simple microservice based dashboard

Image
0

1.3K

sagikazarmark/dashboard repository overview

Project has been moved

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

Dashboard

Build Status

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.

Prerequisites

Quick start

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.

Installation

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:

  • Build some images
  • Start the database
  • Run migrations
  • Provision the gateway

Updating

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.

Usage

Gateway

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.

Add a new user

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"}'
Stop your containers

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

Development

Update API Gateway

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.

Clean up the mess

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.

License

The MIT License (MIT). Please see License File for more information.

Tag summary

Content type

Image

Digest

Size

237.4 MB

Last updated

over 9 years ago

docker pull sagikazarmark/dashboard:model-user-migration