Skip to content

Commit a2b01ef

Browse files
committed
readme0
1 parent a70b7cc commit a2b01ef

1 file changed

Lines changed: 78 additions & 13 deletions

File tree

README.md

Lines changed: 78 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,86 @@
1-
# The nodezoo microservice demonstration architecture
1+
# nodezoo-info
22

33
This is a repository in the microservice demonstration system for
44
the [Tao of Microservices](//bit.ly/rmtaomicro) book (chapter 9). This
5-
code is live at [nodezoo.com](//nodezoo.com).
5+
code is live at [nodezoo.com](http://nodezoo.com). To get started,
6+
visit the [nodezoo/tao](//github.com/nodezoo/tao) repository.
67

7-
This system shows you how to construct a full microservice
8-
architecture. It is MIT licensed so that you can cut-and-paste to
9-
build your own system with minimal effort. The system consists of
10-
multiple repositories, and runs ten or so microservices in production
11-
([Kubernetes](//kubernetes.io)), staging ([Docker](//docker.com)), and
12-
development ([fuge](//github.com/apparatus/fuge)) modes.
8+
__This microservice provides the module information page functionality.__
139

14-
The best place to get started is
15-
the [nodezoo/tao](//github.com/nodezoo/tao) repository, which links to
16-
everything else, and has the _Getting Started_ guide.
1710

18-
## nodezoo-info
11+
## Running
1912

20-
_TODO_
13+
To run this microservice normally, use the tooling describing in
14+
the [nodezoo/tao](/nodezoo/tao) repository, which shows you how to run
15+
the entire system of microservices (of which this is only one of many) in
16+
production ([Kubernetes](//kubernetes.io)), staging
17+
([Docker](//docker.com)), and development
18+
([fuge](//github.com/apparatus/fuge)) modes.
2119

20+
To run from the terminal for testing and debugging, see
21+
the [Running from the terminal](#running-from-the-terminal) section
22+
below.
23+
24+
25+
## Message flows
26+
27+
The table shows how this microservice acts on the `Accepted` message
28+
patterns and performs appropriate business `Actions`, as a result of
29+
which, new messages are possibly `Sent`.
30+
31+
|Accepted |Actions |Sent
32+
|--|--|--
33+
|`role:info,cmd:get (SC)` |Provide module information by asking other microservices for data. |`role:info,need:part (AO)`
34+
|`role:info,collect:part (AO)` |Collect partial module information|
35+
36+
(KEY: A: asynchronous, S: synchronous, O: observed, C: consumed)
37+
38+
39+
## Running from the terminal
40+
41+
This microservice is written in [node.js](//nodejs.org), which you
42+
will need to download and install. Fork and checkout this repository,
43+
and then run `npm` inside the repository folder to install its dependencies:
44+
45+
```sh
46+
$ npm install
47+
```
48+
49+
To run this microservice separately, for development, debug, or
50+
testing purposes, use the service scripts in the [`srv`](srv) folder:
51+
52+
* [`info-dev.js`](srv/info-dev.js) : run the development configuration
53+
with hard-coded network ports.
54+
55+
```sh
56+
$ node srv/info-dev.js
57+
```
58+
59+
This script listens for messages on port 9030 and provides a REPL on
60+
port 10030 (try `$ telnet localhost 10030`).
61+
62+
A [seneca-mesh](//github.com/senecajs/seneca-mesh) version, for
63+
testing purposes, is also shown in the
64+
script [`info-dev-mesh.js`](srv/info-dev-mesh.js). For more on
65+
this, see the [nodezoo-repl](//github.com/nodezoo/nodezoo-repl)
66+
repository.
67+
68+
* [`info-stage.js`](srv/info-stage.js) : run the staging
69+
configuration. This configuration is intended to run in a Docker
70+
container so listens on port 9000 by default, but you can change
71+
that by providing an optional argument to the script.
72+
73+
```sh
74+
$ node srv/info-stage.js [PORT]
75+
```
76+
77+
* [`info-prod.js`](srv/info-prod.js) : run the production
78+
configuration. This configuration is intended to run under
79+
Kubernetes in a [seneca-mesh](//github.com/senecajs/seneca-mesh)
80+
network. If running in a terminal (only do this for testing), you'll
81+
need to provide the mesh base nodes in the `BASES` environment
82+
variable.
83+
84+
```sh
85+
$ BASES=x.x.x.x:port node srv/info-prod.js
86+
```

0 commit comments

Comments
 (0)