A microservices sample with nodejs/React/Postgres, monitored by New Relic and deployed on EKS.
This repository is a stripped down version from https://github.com/mjhea0.
| Name | Service | Container | Tech |
|---|---|---|---|
| Web | Web | web | React, React-Router |
| Movies API | Movies | movies | Node, Express |
| Movies DB | Movies | movies-db | Postgres |
| Users API | Users | users | Node, Express |
| Users DB | Users | users-db | Postgres |
- Fork/Clone this repo
Build the images:
$ docker-compose buildRun the containers:
$ docker-compose up -dTest out the following services...
(1) Users - http://localhost:3002
| Endpoint | HTTP Method | CRUD Method | Result |
|---|---|---|---|
| /users/ping | GET | READ | pong |
| /users/register | POST | CREATE | add a user |
| /users/login | POST | CREATE | log in a user |
| /users/user | GET | READ | get user info |
(2) Movies - http://localhost:3004
| Endpoint | HTTP Method | CRUD Method | Result |
|---|---|---|---|
| /movies/ping | GET | READ | pong |
| /movies/user | GET | READ | get all movies by user |
| /movies | POST | CREATE | add a single movie |
(3) Web - http://localhost:4000
| Endpoint | HTTP Method | CRUD Method | Result |
|---|---|---|---|
| / | GET | READ | render main page |
| /login | GET | READ | render login page |
| /register | GET | READ | render register page |
| /logout | GET | READ | log a user out |
| /collection | GET | READ | render collection page |
If Docker then get the container id from docker ps and then open psql:
$ docker exec -ti <container-id> psql -U postgresIf Kubernetes then get the pod id from kubectl get pods and then open psql:
$ kubectl exec -ti <pod-id> psql -U postgresTo stop the containers:
$ docker-compose stopTo bring down the containers:
$ docker-compose downTo force a build:
$ docker-compose build --no-cacheTo stop all containers:
$ docker container stop $(docker container ls -aq)To remove all containers:
$ docker container rm $(docker container ls -aq)To remove all images:
$ docker rmi $(docker images -q)To recover space:
$ docker system prune --volumes