• Stars
    star
    254
  • Rank 160,264 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Microservices case study with cote.js

Microservices case study with cote.js

This project aims to show a microservices architecture built with cote.js, an auto-discovery mesh network framework for building fault-tolerant and scalable applications.

It's an example e-commerce application with a complete feature set from admin interface to end user interface, and 4 different microservices for dealing with payments, products, purchases and user management.

The admin interface is implemented on a REST server to demonstrate how cote.js would work within an existing express-based application. Product, user and purchase management is done via REST calls to the admin server, where they are then forwarded to respective microservices.

The client interface is implemented entirely in cote; the server only serves a single index.html. It's a breakthrough implementation, which basically means you can host your website statically (on for example, S3), and have all the benefits of a server and the microservices architecture.

Installation

Run the following commands:

git clone https://github.com/dashersw/cote-workshop
cd cote-workshop
npm install
node init-db.js

Getting the system up and running

There are four backend services, an admin interface and an end-user interface.

Quickstart

For the quickest start, have PM2 installed globally and then just type:

pm2 start cote-workshop.json

This will run all the 6 services you need, and you can monitor your services with pm2 monit or use any pm2 commands at your disposal.

Admin interface will be available in http://localhost:5000

End user interface will be available in http://localhost:5001

Monitoring will be available in http://localhost:5555

Navigate to the admin and (multiple) end user interfaces and add / delete / buy some products to see everything updating in real time!

Manual start

Run the admin interface:

node admin/server

Admin interface will be available in http://localhost:5000

Run the end user interface in a separate terminal window (or tab):

node end-user/server

End user interface will be available in http://localhost:5001

Now run the services in separate terminal windows (or tabs):

node services/payment-service
node services/product-service
node services/purchase-service
node services/user-service

Navigate to the admin and (multiple) end user interfaces and add / delete / buy some products to see everything updating in real time!

Monitoring

There's a built-in monitor service which lets you visualize the connections between microservices. The monitoring service is automatically started via pm2, or if you want to manually start it, run:

node monitor.js

It's a simple monitoring GUI, and will be available in http://localhost:5555

Running locally with host names

This repo includes a proxy service which binds on port 80 to host the application via certain host names.

The proxy supports these virtual hosts;

http://local-admin.cotejs.org for the admin interface and redirects requests to localhost:5000.

http://local-end-user.cotejs.org for the end user interface and redirects requests to localhost:5001.

http://local-monitoring.cotejs.org for the monitoring interface and redirects requests to localhost:5555.

Then you have to modify your /etc/hosts file to include 127.0.0.1 local-admin.cotejs.org local-end-user.cotejs.org local-monitoring.cotejs.org. Now when you visit either of these addresses in your browser, you will be redirected to the respective service.

Docker installation

This repository includes a full-featured docker-compose.yml to start all the necessary services including a PostgreSQL database via Docker.

Run the following to launch all services;

docker-compose up

This will build necessary local images and then launch a cluster of services. If you edit your /etc/hosts file to accomodate the given domain names, you can interact with the application via your browser.

More Repositories

1

cote

A Node.js library for building zero-configuration microservices.
JavaScript
2,302
star
2

pedalboard.js

Open source JavaScript framework for developing audio effects for guitars using the Web Audio API.
JavaScript
830
star
3

mogollar

A MongoDB UI built with Electron
JavaScript
279
star
4

erste

Your first choice for hybrid mobile applications
JavaScript
270
star
5

brain-bits

A P300 online spelling mechanism for Emotiv headsets. It's completely written in Node.js, and the GUI is based on Electron and Vue.
JavaScript
168
star
6

biri

A unique, static client ID generator for browser applications
JavaScript
139
star
7

brain-monitor

A terminal app written in Node.js to monitor brain signals in real-time
JavaScript
133
star
8

recht

A concise rule engine to express and enforce rules for selections, permissions and the like
JavaScript
103
star
9

wits

A Node.js library that reads your mind with Emotiv EPOC EEG headset
C++
90
star
10

docker-node-pm2

A pm2 application container for docker.
Shell
75
star
11

stack

A starter repository for MongoDB, Node.js, and Vue.js, with a local environment based on Docker.
JavaScript
57
star
12

microservices-workshop

An example microservices implementation with Node.js and Docker
JavaScript
54
star
13

regie

An observable state management tool for vanilla JS applications based on Proxies
JavaScript
49
star
14

vuelve

A declarative syntax for the Composition API in Vue 3.
JavaScript
46
star
15

hakki

An opinionated, modern, and scalable alternative to node_acl.
JavaScript
35
star
16

docker-nextjs

JavaScript
29
star
17

tombala

A simple tombola game
JavaScript
27
star
18

geneJS

Code generator for PlantUML
JavaScript
24
star
19

vue-node-starter

JavaScript
20
star
20

erste-demo

A sample app that showcases how to use erste
CSS
18
star
21

vue-starter

Vue
16
star
22

plantuml

Git mirror of plantuml's SVN repo. Updated seldomly, whenever I need the new source.
Java
13
star
23

aktivite-akis-ornegi

Node.js ile aktivite akış ârneği
JavaScript
10
star
24

jira-bot

Jira bot is a library that bridges Jira and XMPP chat.
JavaScript
10
star
25

hax.js

Haxball clone with JavaScript; Canvas and Node.js
JavaScript
8
star
26

puckjs-automatic-page-turner

An automatic page turner BLE HID Peripheral for Puck.js
JavaScript
8
star
27

dockercloud-microservices

An example workflow to build & deploy Node.js microservices to Docker Cloud.
JavaScript
7
star
28

kotelett

Simplest microservices ever.
JavaScript
7
star
29

mindy

JavaScript
6
star
30

wtmbjs-4

JavaScript
6
star
31

midi-experiments

JavaScript
6
star
32

dashMVC

MVC doodlings with Javascript
JavaScript
5
star
33

node-scale

Examples for Scaling Node.js applications with Redis, RabbitMQ and cote.js
JavaScript
5
star
34

cote-examples-currency-conversion

An example microservices application with cote
JavaScript
5
star
35

use-the-force-luke

A brain-wave app that lets you use the force
JavaScript
4
star
36

erste-starter

A starter repository for erste
CSS
4
star
37

BoilerPlate

Shell
4
star
38

IT537

JavaScript
4
star
39

epocx-experiments

Experiments with Emotiv EPOC X headset
3
star
40

wtmbjsa

JavaScript
3
star
41

fse-visualizer

A visual engine for footballSimulationEngine
JavaScript
3
star
42

node-closure-compiler

JavaScript
3
star
43

ibwturkey

JavaScript
3
star
44

wain

A topic-based news aggregator with AI.
JavaScript
3
star
45

docker-node-pm2-keymetrics

A docker image for PM2 and Keymetrics
Shell
3
star
46

node-webinar-examples

Examples for the webinar Scaling and Managing Node js Applications with Microservices
JavaScript
3
star
47

berlin-nodejs-meetup-cote

Examples for the talk "Implementing Microservices With Cote"
JavaScript
2
star
48

wtmjs

CSS
2
star
49

PapazKacti

2
star
50

docker-spa-server

2
star
51

angular-seed

2
star
52

wtmbjsa-3

Bridging APIs
JavaScript
2
star
53

tartjs-presentation

JavaScript
2
star
54

baking-soda-paste

The definitive solvent for disgusting rubber-band scrolling on iOS.
2
star
55

politburo

A micro library for building applications with Vieux architecture
JavaScript
2
star
56

docker-nodejs-build-tools

A docker image that includes various build tools for Node.js projects.
2
star
57

nodeRemote

2
star
58

Spicefinder

JavaScript
1
star
59

existing-repo

1
star
60

fs2017-microservices

Microservices example used in FullStack 2017 microservices workshop
JavaScript
1
star
61

multi-host-docker-cloud

JavaScript
1
star
62

docker-cloud-multicast

C
1
star
63

multicast-problem

JavaScript
1
star
64

rabbit-fn

JavaScript
1
star
65

wtmbjsa-5

MongoDB examples
JavaScript
1
star
66

devopspro-workshop

JavaScript
1
star
67

erste-boilerplate

HTML
1
star
68

google-maps-tsp-solver

Automatically exported from code.google.com/p/google-maps-tsp-solver
JavaScript
1
star
69

closure-test

JavaScript
1
star
70

gitfstest

1
star
71

docker-cote-monitoring-tool

Docker image for cote monitoring GUI
JavaScript
1
star
72

nomadcommerce

creative.nmdapps
CSS
1
star
73

web

JavaScript
1
star
74

colors

Rethinking Colors in Design Systems: A CSS Approach to Idiomatic Design
HTML
1
star