Howhoworg is a versatile server build from Node.js and MongoDB. Not only updating nav and other fund data daily, automatically from several reliable sources, but also a stable API Server providing finance data.
We're using Airbnb JavaScript Style Guide without semicolons. Let us refer you to here to get eslint setup, then take a look at our .eslintrc.
So called MVC (Model-View-Controller) architecture, we have several groups in the picture above.
Entry point, start API Server and updaters to crawl market data from several sources. The production process manager we use is pm2. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
Unit Test is matter! It helps you really understand the design of the code you are working on. Keep coverage higher as you can. Test framework we use are Mocha and Chai.
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases., and Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.
Some legacy temporary data, like fund clear id list, tej csv test files, and other json files.
Schema, classes and its method we use in database would be here. About the MongoDB driver, our choice was Mongo Native Driver but Mongoose. Performance, flexibility, and learning cure are matter, here is the reason. For more, you could check this comparison and feel free to propose question if you have any better idea.
*.ejs files and web page static files. Our API docs are using open source api docs generator, called slate. Slate could helps you create beautiful, intelligent, responsive API documentation in several minutes.
Web page routing and RESTFUL API stuff, including database connecting, data handling, and request authorization. Web framework we use is Express, with a myriad of HTTP utility methods and middleware at our disposal, creating a robust API is quick and easy. You can click here to check our API Docs now.
Howhoworg has several updaters running constantly, and update market data to database everyday morning. Our database is located at East Asia, using ScaleGrid, database as a service. You're able to look more detail in scalegirdMongo.js
Legacy code, most of them are using for parsing api data and test data.
Step 1. Click the top right fork
button to fork this repository to your account.
Step 2. Clone this object on your client.
git clone https://github.com/<your_user_name>/howhoworg.git
Step 3. Check in your directory and install dependencies.
npm install
or
yarn
node app
npm test
Click here to see our API Docs.
Go to here to get alpha free trial.