The startup death clock tells you what day your startup will run out of money.
This is a micro-services example for the Seneca toolkit.
This systems consists of four services:
- doc-srv: JSON document store
- hist-srv: history story to record document updates over time
- real-srv: live business statistics on usage of the website
- index: the web server
The web server is provided in four alternative versions, one each for
This shows you how to integrate seneca into each web framework.
This is a Node.js app, using the Seneca toolkit.
You will need to install Redis (for pub-sub messages) and beanstalk (for queued messages). Just run the basic servers with default configuration.
- See giant killing with beanstalkd for intro to beanstalkd
You will also need Docker to run the full deployment scenario. However you can run without it.
The service implementations are wrapped as Seneca plugins and placed in the lib folder. This is where your main business logic goes
The service processes are in the srv folder. These are small scripts to configure the connections between processes. In a production system you will have many of these and they will change over time.
To demonstrate integration with a number of different Node.js web frameworks, integrations are provided for express, kraken, hapi, and sails in their respectively named folders.
To test the system, you can run the test app. This app includes all the services into one process for convenience:
$ node test-app.js
Or with full logging (see seneca logging):
$ node test-app.js --seneca.log.all
Or just action logging:
$ node test-app.js --seneca.log=type:act
Once running, you can access the api end points:
http://localhost:3000/api/1.0/live
To run each service separately, use separate terminal windows and run:
$ node srv/doc-srv.js --seneca.log.all
$ node srv/hist-srv.js --seneca.log.all
$ node srv/real-srv.js --seneca.log.all
The run your framework of choice:
$ cd express
$ node index.js --seneca.log.all
$ cd kraken
$ node index.js --seneca.log.all
$ cd hapi
$ node index.js --seneca.log.all
$ cd sails
$ node index.js --seneca.log.all
And access the main site at: