A liver version of the open inventory system server can be found in https://open-inventory-system.herokuapp.com/
Install postgresql in the local machine and setup correctly. Then use following command to login to the psql shell.
psql -U postgresThen enter below commands in order to create the role from which the server will access the database.
CREATE ROLE openinventoryuser WITH LOGIN PASSWORD 'password';
CREATE DATABASE openinventorydatabase;
GRANT ALL PRIVILEGES ON DATABASE openinventorydatabase TO openinventoryuser;
\qThen you should be able to login to psql as openinventoryuser.
psql -U openinventoryuser openinventoryuserInstall NodeJS. This program was tested with NodeJS 12.16.1 LTS.
On arch based systems,
sudo pacman -S nodejs-lts-erbium
sudo pacman -S npmAfter that cd to the project directory and run npm install.
cd directory/project
npm installThen create a .env file in the project directory with following content.
You have to set the database user/password/secret as you wish.
PORT=8000
NODE_ENV=development
DATABASE_URL=postgres://smartlab:roJaGdNZgqNpLQcq@localhost:5432/smartlab
SALT_ROUNDS=10
JWT_SECRET=helloguys
LOG_LEVEL=info
[email protected]
[email protected]
ETHEREAL_PASSWORD=E6NyGYDJCgrCr9QKYN
[email protected]
GMAIL_PASSWORD=jHm33JhqdhWKuknB
SITE_API=http://localhost:3000/web-frontend/#
DB_INIT=false
[email protected]
SENDGRID_API_KEY=key
Then use nodemon or node to serve the pages.
npm run dev # to run using nodemon
npm start # otherwiseNow visit http://localhost:3000/ and confirm that site is running.
After initial run, set DB_INIT as false in the .env file.
