Giter Site home page Giter Site logo

startupdeathclock's Introduction

The Startup Death Clock

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.

Requirements

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.

You will also need Docker to run the full deployment scenario. However you can run without it.

Structure

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.

Running the Test App

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

Running the services in development

To run each service separately, use separate terminal windows and run:

$ node src/doc-srv.js --seneca.log.all
$ node src/hist-srv.js --seneca.log.all
$ node src/real-srv.js --seneca.log.all

The run your framework of choice:

express

$ cd express
$ node index.js --seneca.log.all

kraken

$ cd kraken
$ node index.js --seneca.log.all

express

$ cd hapi
$ node index.js --seneca.log.all

express

$ cd sails
$ node index.js --seneca.log.all

And access the main site at:

http://localhost:3000

startupdeathclock's People

Contributors

rjrodger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.