Ng2NodeMongoCore - application core based on NodeJS, MongoDB and Angular.
./app
- server./app/config
- configurations./app/models
- db models./app/routes
- routes./app/utils
- utilities
./public
- client./public/app
- main module and routes./public/app/components
- components' scripts (development)./public/app/modules
- modules' scripts (development)./public/app/scss
- stylesheets (development)./public/app/services
- services' scripts (development)./public/app/views
- components' templates
./public/css/
- bundled styles (production)./public/img/
- images./public/js/
- bundled scripts (production)
./test
- client/server tests./test/client
- client tests./test/e2e
- end to end tests./test/server
- server tests
In order to run your own copy of Ng2NMC, you must have the following installed:
To install Ng2NMC execute the below command in the terminal window while in your projects folder:
git clone https://github.com/rfprod/ng2nmc.git
This will install the Ng2NMC components into the ng2nmc
directory in your projects folder.
Create a file named .env
in the root directory. This file should contain:
MONGO_FILE_PATH=/path/to/mongo/data/directory
MONGO_URI=mongodb:https://localhost:27017/ng2nmc
PORT=8080
APP_URL=https://localhost:8080/
MAILER_HOST=smtp.gmail.com
MAILER_PORT=465
[email protected]
MAILER_CLIENT_ID=dummy-client-id.apps.googleusercontent.com
MAILER_CLIENT_SECRET=dummy-client-secret
MAILER_REFRESH_TOKEN=dummy-refresh-token
[email protected]
If MONGO_FILE_PATH
is not set, database will be created in ~/mongo/
To start the app, execute in the terminal while in the project folder (dependencies installation check will be performed before)
npm start
Now open your browser and type in the address bar
https://localhost:8080/
Ng2NMC is up and running.
To test the server execute the following command in the terminal window while in your project's folder when the server is running:
$ npm run server-test
HeadlessChrome
: in initial configuration for client unit tests to work you will have to export an environment variable for headless Chrome by appending it to ~/.bashrc
, its value should be set to one of the following options, depending on what you have installed: chromium-browser, chromium, google-chrome
export CHROME_BIN=chromium-browser
To test the client execute the following command in the terminal window while in your project's folder:
for continuous testing
$ npm run client-test
for single test
$ npm run client-test-single-run
$ npm run protractor
To lint the code execute the following command in the terminal window while in your project's folder:
$ npm run lint
TODO
TODO