Skip to content

DSRoden/node-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Developing Microservices - Node, React, and Docker

![Build Status](https://travis-ci.org/DSRoden/node-microservices.svg?bran ch=master)

Architecture

Name Service Container Tech
Web Web web React, React-Router
NGINX Nginx nginx NGINX
Api-gateway '' '' Node, Express
Authentication Auth auth Node, Express, JWT
Movies API Movies movies Node, Express
Movies DB Movies movies-db Postgres
Swagger Movies swagger Swagger UI
Users API Users users Node, Express
Users DB Users users-db Postgres
Functional Tests Test n/a TestCafe

This project uses MHerman's movies-microservice project as starting point. Definitely check it out!

Check out the blog post.

Want to use this project?

Setup

  1. Fork/Clone this repo

  2. Download Docker (if necessary)

  3. Make sure you are using a Docker version >= 17:

    $ docker -v
    Docker version 17.03.0-ce, build 60ccb22

Build and Run the App

Set the Environment variables

$ export NODE_ENV=development

Fire up the Containers

Build the images:

$ docker-compose build

Run the containers:

$ docker-compose up -d

Migrate and Seed

With the apps up, run:

$ sh init_db.sh

To access, get the container id from docker ps and then open psql:

$ docker exec -ti <container-id> psql -U postgres
(6) Functional Tests

With the containers up running and TestCafe globally installed, run:

$ sh test.sh

Access Swagger docs at the above URL

Commands

To stop the containers:

$ docker-compose stop

To bring down the containers:

$ docker-compose down

Want to force a build?

$ docker-compose build --no-cache

Remove images:

$ docker rmi $(docker images -q)

About

Node, Docker, React, Knex, Postgresql, Swagger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published