Giter Club home page Giter Club logo

node_dice's Introduction

Demo site: http://neohe.com
Donation: 1ANFLKVy37ZMnbzhYHEqhgHcxEbFnQh7kE

The site is built on

  • Backend: node.js + socket.io + mongodb
  • Frontend: bootstrap + jquery + react.js

Before you run this site, please set up connection to mongodb in config/developement.js or production.js.

  • 2015-02-24: First commit; Basic features added.
  • 2015-03-11: Add chat functionality. Chat messages can be saved to database and kept for a week(using mongodb TTL index).
  • 2015-03-18: Get bitcoin address from Blockchain.info and can be saved to user account.
  • 2015-03-21: Update balance for deposit every 30 seconds once BTC address is generated; User name has to be unique(using unique index of mongodb);
  • 2015-03-22: Bitcoin faucet implemented. Use google reCaptcha to verify user is not rebot.
    Amount of faucet and interval can be adjusted in config file.
  • 2015-03-29: Move to ubuntu and use nginx as web server.
  • 2017-01-25: Start rewriting in ES6 and react. Use babel to transform ES6 to ES5. Node.js acts as restful api/socket.io server and does not render front-end html any more. Will use docker to host application in the future.
  • 2017-04-07: Use docker containers to deploy a working beta.
  • 2018-01-15: Support multiple languages.
  • 2018-01-21: Add user management, forget pasword, country blocker, 2FA, back office and more features. Send me email for back office access.
  • 2018-02-01: Bug fixes.

The whole site uses three docker containers. One is for front-end, hosted by nginx images. The second one is for back-end, hosted by node 7.8 and socket.io. The third one is using mongo db images. You can see three containers in docker-compose.yml.

How to setup the site?

NOTE: If you are on windows to build docker container, read below before setting up the site.

Before step 1, you may need to disable IIS or change the port mapping of web section in docker-compose.yml. eg.

80:80 -> 8080:80

Before step 3, you may need to open up docker settings and set the share drive. And may need to comment out volumes for mongo in docker-compose.yml

	volumes:
      - ./mongodb/db:/data/dbvolumn
      

Steps:

  1. Install node.js and npm
  2. Install docker
  3. Go to the root folder of source code where docker-compose.yml resides.
  4. Build client: cd client && npm run prod && cd ..
  5. Build server: cd server && npm run prod && cd ..
  6. docker-compose build
  7. docker-compose up -d
  8. Open browser: http://localhost

Or just run build.bat. It does steps 3-6 for you.

How to update the site?

The physical files are not actually in the containers, as you can see volumes in each section of docker-compose.yml. volumes maps host path to the internal path of container. So you just need to update files in host. After you test and build your local souce code by using npm run prod for client or server, push the changes to github. Then in your host machine, just type git pull and get the changes from github. That's it. You update you site.

If you have any questions, contact me at: [email protected].

node_dice's People

Contributors

popmanhe avatar

Watchers

James Cloos avatar Joedel Lopez Dalioan 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.