- Node, NPM, loopback-v3 (nodejs framework), pm2 (process manager for Node.js) and MongoDB should be installed on the system.
- Clone - Clone this repo
- Install server dependencies - change directory to the server folder and run
npm install
command. This will install all the server dependencies. - Verify MongoDB is active - MongoDB is by default not started every time the system is restarted / booted. Verify MongoDB server is active / running with command
service mongod status
. If not active, start the MongoDB with commandsudo service mongod start
. - Import temporary data - Instructions
- Start loopback server - run command
node .
to start the server on local machine. To start loopback in background run commandpm2 start server/server.js
. To verify server is running, run commandpm2 list
, it should show server online. - Once the server is active, one can access
http://localhost:3002/explorer
URL to add application data (Such as Menu, Widget, WidgetAssignment, Source) using post service from loopback. refer Database Design Diagram for more clarification on relationship between the collections. - Install Angular dependencies - Next, change directory to the web folder and run
npm install
command to install the Angular dependencies. - Start Angular application - run command
ng serve --open
and check running application onhttp://localhost:4200
.
- link - https://docs.google.com/document/d/1cin9yFF5QIiw02xFJVsFWsmwnbd5cHSquZ-HUIuxzDQ/edit?usp=sharing
- link - Database design
- MongoDB Compass - Something similar to phpMyAdmin but is for MongoDB.
- PM2 - Advanced, production process manager for Node.js
- https://github.com/angular/angular-cli/wiki/stories-budgets
- https://blog.angularindepth.com/super-charging-an-angular-cli-app-fc496a6c100
- Open terminal in directory (unite-framework/temp-data/sunbird) and execute the following commands.
sudo mongoimport --db umongodb --collection Menu --file menu.json
sudo mongoimport --db umongodb --collection Widget --file widget.json
sudo mongoimport --db umongodb --collection Source --file source.json
sudo mongoimport --db umongodb --collection WidgetAssignment --file widgetassignment.json
sudo mongoimport --db umongodb --collection Route --file route.json
- Above commands will import the collections
Menu, Widget, Source, WidgetAssignment and Route
inside theumongodb
database, which can be verified with theCompass explorer
.