node.js
npm
⚠️ If you are deploying app on VPS: update VUE_APP_BASE_URL and SERVER_PORT in install.sh
...
# For example:
SERVER_PORT=5000
VUE_APP_BASE_URL="http://165.227.141.103:5000"
...
Do not forget to create .env files with connection parameteres
(see example in .env section of manual install)
Script install.sh
will install and deploy the application using default parameters
# Production version (recommended):
./install.sh --prod
# Development version:
./install.sh
Install all necessary packages (run in the root of repository)
npm --prefix ./client install
npm --prefix ./server install
Frontend part is stored in client
directory.
Before building/deploying frontend you should create .env
file that contains:
VUE_APP_BASE_URL="backend's URL"
# For example:
VUE_APP_BASE_URL="http://165.227.141.103:5000"
npm run build
# This command will put all necessary files in dist folder.
npm run serve [--port portNumber]
# By default frontend part is started on 8080 port.
Backend part is stored in server
directory.
Before starting application you should create .env
file
containing following variables:
# Port for backend:
PORT = 5000
PROD_DIST_FOLDER = "Path to the dist folder"
# Connection parameters by string structure:
# PREFIX://USER:PASSWORD@HOSTS`
DB_USER = "USER"
DB_PSWD = "PASSWORD"
DB_PREFIX = "PREFIX" # e.g. "mongodb"
DB_HOSTS = "HOSTS"
⚠️ If you changed default port of app: do not forget to update value in client's .env file
npm run start
# This command will use node to run application
npm run devser
# This command will use nodemon to run application
After deploying the app, go to http://localhost:{port}
or URL you specified
API consist of the following methods:
// Client API
getClients()
addClient(client)
getClient(id)
updateClient(client)
deleteClient(id)
// Provider API
getProviders()
addProvider(provider)
getProvider(id)
updateProvider(provider)
deleteProvider(id)
// Page API
getPage(page, limit)
getSortedPage(page, limit, key, asc)
Go to SwaggerHub for detailed information about them.