Skip to content

Lakshan-Banneheke/Supply-Chain-Management-System

Repository files navigation

Supply-Chain-Management-System

Database setup

Install postgresql in the local machine and setup correctly. Use following command on terminal to login to the psql shell as postgres user.

psql -U postgres

Then enter below commands.

CREATE ROLE db_app WITH LOGIN PASSWORD 'password';
CREATE DATABASE supply_chain_db;
GRANT ALL PRIVILEGES ON DATABASE  supply_chain_db TO db_app;
\q

Then login to psql as db_app. Enter 'password' as given in the previous step when prompted for the password.

psql -U db_app supply_chain_db

Download database directory from this repo and then in the shell, import the schema. Here give the full path to the schema

\i 'C:/Users/.../database/schema.sql'
\q

Now the database is set up. Check if the database exists through the terminal or by logging into to pgAdmin.

Node.js setup

First clone this project directory.

git clone https://github.com/Lakshan-Banneheke/Supply-Chain-Management-System.git

Install

After that go to the project directory and run npm install.

cd directory/project
npm install

Create a .env file in the root to store the environment variables.

DATABASE_URL=postgres://db_app:password@localhost:5432/supply_chain_db

SESSION_SECRET=database
PORT=3000
SERVER_ADDRESS=127.0.0.1

Then use nodemon or node to serve the pages.

nodemon start # If nodemon is installed
node index.js # otherwise

Now visit http://localhost:3000/ and confirm that site is running.

An entry for the admin will be inserted in the database by default. After users registers themselves, the admin can log in to the system using the following credentials and approve or disapprove the users. Email: [email protected] Password: admin123

Note: Email and password can be changed by the admin after logging in as above

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published