Repository for hexp web code i.e. api and user and admin frontends.
- Install node 6.10.0 (e.g. with n),
npm i
- install dependencies,chmod +x pre-commit.sh && ./pre-commit.sh
- add pre-commit hook,cp .env.tpl .env
- create environment file and add/modify following parameters:
Parameter | Expecting | Example |
---|---|---|
NODE_ENV | 'production' or 'development' | 'development' |
SERVER_PORT | integer of port to listen on | 3000 |
DATABASE_URI | postgres db uri | postgres://hexp:hexp@localhost:5432/hexp |
npm run webpack
- Compile all of the .js files needed for the client side,npm run less
- Compile all of the .less files into the necessary .css files for the client side. Note that this keeps running watching for changes in the folder, after compiling once, exit the script (ctrl+c),npm start
- Start the server,npm run nodemon
- Alternatively, start the server in developer mode, restarting after every change madenpm run db:populate
- Populate database with random data (check out scripts/db-populate.js)
npm run nodemon
- Watch for changes in the server files (bin/www) and restart the server as the files are changednpm run webpack
- Compile all of the javascript files from the js folder and place them in /public/scriptsnpm run webpack-watch
- Same as 'npm run webpack' but watch for changes to the files and auto compile if there are any changesnpm start
- Start the server normallynpm test
- Run the tests on the projectnpm run lint
- Run the lint beautifier on the project filesnpm run less
- Watch for changes in the /less folder, and compile all of the .less files inside, outputing to /public/stylesheets
http://<server_url>/
- Main page of the website, the one used by the usershttp://<server_url>/admin
- Administration pagehttp://<server_url>/api
- Path for the public API released by the app