Build & Develop & Deploy - Shanfang/SmartNote GitHub Wiki
- Before run our application, you need to install mongodb.
- Open the Terminal app and type
brew update. - After updating Homebrew
brew install mongodb. - After downloading Mongo, create the “db” directory. This is where the Mongo data files will live. You can create the directory in the default location by running
mkdir -p /data/db. - Make sure that the /data/db directory has the right permissions by running
sudo chown -R `id -un` /data/db.
-
Run
mongodin the terminal to start the the Mongo daemon, this step starts the Mongo server. -
Before starting the application, you need to install some dependencies. Please reference the next section for details. Run
npm run startto start the application. Navigate tohttp://localhost:4300/. The app will automatically reload if you change any of the source files. -
For Server part, go to folder
./serverbycd server/. Runnpm installandnpm run dev. -
Exit mongo service:
- To exit the Mongo shell run
quit(). - To quit the Mongo daemon, press Ctrl + C.
- Backend Testing:
- To install Mocha and Chai using
npm install -g mocha.npm install chai.npm install supertest --save-dev. And to run backend test in the folder /smartnote usingmocha test.js.
You can deploy the project on your server similar as we do on SmartNote.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.
For markdown directives, you need to install some libraries.
Install SimpleDEM and Highlight for markdown note features.
-
navigate to app root directory(./smart-note), run
npm install simplemde --saveandnpm install angular-highlightjs --saveto install dependencies for markdown functionality. -
navigate to directory
./server, runnpm install nodemon --save.
Run mocha test.js to execute the backend tests via Mocha.
Run ng test to execute the unit tests via Karma.
Before that, you need to install dependencies of karma-coverage, please run
npm install karma karma-coverage --save-dev.
Run ng e2e to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via ng serve.