/Product-Supply-And-Transport-Dashboard

A Web Dashboard that provides communication between two differnt users: Transporter and Manufacturer for professional services. It is developed using ReactJS, NodeJS, MySQL and Socket.io. The backend is written in TypeScript and follows MVC framework.

Primary LanguageJavaScript

Product-Supply-And-Transport-Dashboard

A Web Dashboard that provides communication between two differnt users: Transporter and Manufacturer for professional services. It is developed using ReactJS, NodeJS, MySQL and Socket.io. The backend is written in TypeScript and follows MVC framework.

image

image

image

image

Prerequisites

  • Node.js and npm should be installed on your machine.
  • MySQL Command Line Client and Workbench should be installed in your machine.

Getting Started

  1. Clone the repository/Unzip the repo:
  2. Navigate to the project directory:

Database Setup

-There are two ways to setup the database.

A) Via MySQL Workbench

-If you have MySQL Workbench installed, open the application and select the connection as shown below.

image

-Provide the authentication details.

image

-On the Navigator Tab to the Left, in the Management section, click on "Data Import/Restore"

image

-Choose the "Import from Self Contained File" option from the current window. Choose the "sqlDumps.sql" file from the project directory.

image

-In the same window, click on the "New" Button near the "Default Target Schema" and type "threeway_studio" as the schema/database name in the "Create Schema" Dialog Box.

image

-Click on "Import Progress Tab" and click on "Start Import" at the bottom of the window. The database will be setup.

image

B) Via MySQL Command Line Client

Step1:- Open MySQL Command Line Client Client and provide password.
        create database threeway_studio;
        use threeway_studio;

to create Manufacturer Table:
    create table manufacturer(
        m_id int auto_increment primary key,
        name varchar(70),
        address varchar(1000),
        username varchar(50) unique,
        password varchar(100));

to create Transporter Table:
    create table transporter(
        t_id int auto_increment primary key,
        name varchar(70),
        username varchar(50) unique,
        password varchar(100));

to create Orders Table:
    create table orders(
        id int auto_increment primary key,
        o_id varchar(10),
        from_address varchar(1000),
        to_address varchar(1000),
        qty double,
        pickup varchar(1000),
        m_id int,
        t_id int,
        price double,
        foreign key(m_id) references manufacturer(m_id),
        foreign key(t_id) references transporter(t_id));

to create Chats Table:
    create table chats(
        c_id int auto_increment primary key,
        message varchar(1000),
        o_id int,
        sender_category varchar(20),
        foreign key(o_id) references orders(id));

Backend Setup

  1. Open a terminal in the backend folder and install the libraries:

    npm install
    
  2. Create a env file and store the posgres login password with variable name:- "DB_PASSWORD"

  3. Start the NodeJS backend server:

     nodemon
    

    or

     node index.js
    

The server will run at http://localhost:3005.

Frontend Setup

  1. Open a terminal in the Frontend's "src" folder and install the frontend dependencies using "npm i":

  2. Start the React development server:

The app will be available at http://localhost:3000.

Usage

  • Access the React app by visiting http://localhost:3000 in your web browser.
  • The app interacts with the Express backend running at http://localhost:3005.