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.
- Node.js and npm should be installed on your machine.
- MySQL Command Line Client and Workbench should be installed in your machine.
- Clone the repository/Unzip the repo:
- Navigate to the project directory:
-There are two ways to setup the database.
-If you have MySQL Workbench installed, open the application and select the connection as shown below.
-Provide the authentication details.
-On the Navigator Tab to the Left, in the Management section, click on "Data Import/Restore"
-Choose the "Import from Self Contained File" option from the current window. Choose the "sqlDumps.sql" file from the project directory.
-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.
-Click on "Import Progress Tab" and click on "Start Import" at the bottom of the window. The database will be setup.
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));
-
Open a terminal in the backend folder and install the libraries:
npm install
-
Create a env file and store the posgres login password with variable name:- "DB_PASSWORD"
-
Start the NodeJS backend server:
nodemon
or
node index.js
The server will run at http://localhost:3005
.
-
Open a terminal in the Frontend's "src" folder and install the frontend dependencies using "npm i":
-
Start the React development server:
The app will be available at http://localhost:3000
.
- 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
.