-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from lakhanmandloi/v2
Issue #000 fix: Update npm packages & Docs
- Loading branch information
Showing
14 changed files
with
17,755 additions
and
9,805 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
**Prerequisite for Unite** | ||
- Node, NPM, loopback-v3 (nodejs framework) and mongoDB should be installed on you system. | ||
|
||
# Unite Framework (v2) | ||
|
||
**Setup Unite on localhost** | ||
1. Clone this repo and goto the server folder and run *npm install* command it will download all the node dependencies and then run *node .* command to run the node server. | ||
|
||
2. After successfully run the server then access this *http://localhost:3002/explorer* URL in the browser and add your application data for (Menu, Widget, WidgetAssignment, Source) using post service from loopback. refer Database Design Diagram for more clarification on relations between collections. | ||
## Prerequisite | ||
|
||
- Node, NPM, loopback-v3 (nodejs framework) and MongoDB should be installed on the system. | ||
|
||
3. Next, goto the web folder and run *npm install* command after that run *ng serve --open* command and check your application run on *http://localhost:4200* . | ||
## Setup on localhost | ||
|
||
1. **Clone** - Clone this repo | ||
2. **Install server dependencies** - change directory to the server folder and run ```npm install``` command. This will install all the server dependencies. | ||
3. **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 command ```sudo service mongod start```. | ||
4. **Import temporary data** - [Instructions](#import-dummy-data-to-start-with) | ||
4. **Start loopback server** - run command ```node .``` to start the server. | ||
5. 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. | ||
6. **Install Angular dependencies** - Next, change directory to the web folder and run ```npm install``` command to install the Angular dependencies. | ||
7. **Start Angular application** - run command ```ng serve --open``` and check running application on ```http://localhost:4200```. | ||
|
||
**Unite Documentation Link** | ||
- link - https://docs.google.com/document/d/1cin9yFF5QIiw02xFJVsFWsmwnbd5cHSquZ-HUIuxzDQ/edit?usp=sharing | ||
## Unite Documentation Link | ||
|
||
|
||
**Database Design Diagram** | ||
- link - <a href="https://app.quickdatabasediagrams.com/#/schema/kgDNgaLMYESb-suRwpJeGw" target="_blank">Database design</a> | ||
- link - https://docs.google.com/document/d/1cin9yFF5QIiw02xFJVsFWsmwnbd5cHSquZ-HUIuxzDQ/edit?usp=sharing | ||
|
||
## Database Design Diagram | ||
|
||
- link - <a href="https://app.quickdatabasediagrams.com/#/schema/kgDNgaLMYESb-suRwpJeGw" target="_blank">Database design</a> | ||
|
||
![unite database design](unite-database-design.png) | ||
|
||
## Misc | ||
|
||
- [MongoDB Compass](https://www.mongodb.com/products/compass) - Something similar to phpMyAdmin but is for MongoDB. | ||
|
||
## Import dummy data to start with | ||
|
||
- Open terminal in directory (unite-framework/temp-data/sunbird) and execute the following commands. | ||
|
||
![unite database design](unite-database-design.png) | ||
``` | ||
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 the ```umongodb``` database, which can be verified with the ```Compass explorer```. |
Oops, something went wrong.