Live Version: http://mf.dev.cdhsc.org/home
- Node version 8.5.0 or higher
- NPM version 5.3.0 or higher
- Angular CLI version 1.4.4 or higher (should be saved in devDependencies)
npm install -g @angular/cli@latest
- MongoDB
- Nodemon
npm install -g nodemon
-
Clone this repo
git clone https://github.com/CDH-SC/mf.git
-
Install Prerequisites (Check the above section)
-
cd <path>/mfcd mf-api/npm install
cd mf-angular/npm install
-
Note: If the npm install throws an error:
- If it says a module is not installed, run
npm install --save <module name> - If it says that an invalid character was read at the end of the line, delete the node_module folder and the package-lock.json file and try the
npm installcommand again - If its an npm permission error see here
- If it says a module is not installed, run
-
Create a local database
- A binary BSON dump of the database can be found: mf/mf-database/dump
- Ensure Mongo has been started on your local machine:
- Linux:
$ sudo service mongod startor$ sudo service mongod restart- Mac (if mongodb was installed via homebrew):
brew services start mongodb- to restart:
brew services stop mongodbbrew services start mongodb
-
Use mongorestore to restore the dump file to your local machine
-
MongoDB default port number: 27017
$ mongorestore <path to the backup>
-
Example:
$ mongorestore mf/mf-database/dump
-
Troubleshooting assitance can be found here
- Please refer to README found here
-
Installing Git LFS
- Mac:
- To use Homebrew, run
brew install git-lfs - To use MacPorts, run
port install git-lfs - Verify install with
git lfs install
- To use Homebrew, run
- Linux:
- Download Git LFS from https://git-lfs.github.com/
- Unzip the file and cd into the folder.
- Install the file with
$ ./install.sh - Verify installation by running
$ git lfs install
- Mac:
-
Using Git LFS
- To save time when cloning the project LFS is configured to ignore all of the notebook images by default.
- Cache your GitHub password
- Ref: https://help.github.com/articles/caching-your-github-password-in-git/
- Cache it by running a git command before running a git lfs command.
- To download all the images:
$ git lfs fetch --alland$ git lfs checkout
- To only download a specific notebook:
$ git lfs fetch -I mf-angular/src/images/<notebook wanted>$ git lfs checkout mf-angular/src/images/<notebook wanted>/*
- To get notebook images to appear on the site:
- First build project with
$ ng build --watch - Then copy the images with
$ cp -R mf-angular/src/images mf-angular/dist/images - Any notebooks that are downloaded should now have images on the site.
- First build project with
- 3 Terminal Setup
- Terminal 1 : Runs the mongo database
mongodorsudo mongod
- Terminal 2 : Runs the Express server
cd <path>/mf/mf-api/nodemon server- If cannot find module
npm install --save <module>
- Terminal 3 : Builds the webapp to the dist directory to be served by the Express server
cd <path>/mf/mf-angular/ng build --watch
- The Michael Field application should now be available at http://localhost:3000/home
- Install compdoc package
npm i -g @compodoc/compodoc
- Create the documentation for Angular
cd <path>/mf/mf-angular/npm run doc:buildandserveOpen broswer at http://localhost:8080
- Run
ng testto execute the unit tests via Karma. - To execute unit tests for Angular
cd <path>/mf/mf-angular/npm testwhich runs the tests found in the directory<path>/mf/mf-angular/spec/
- Fork the repo
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
Note: Be sure to merge the latest from "upstream" before making a pull request!:
-
Component
ng g component my-new-component -
Service
ng g service my-new-service -
Module
ng g module my-new-module -
IF YOU DON'T KNOW WHERE SOMETHING GOES... ASK
-
npm install [packages] --save or --save-dev for development only
- Pierce Matthews
- Tyler Moon
- Lawton Mizell
- Jerrod Mathis
- Caleb Kitzmann
- Samyu Comandur
MIT