Skip to content

LaansDole/fullstack-ecommerce-warehouse

 
 

Repository files navigation

Project Structure

./
├── .gitignore
├── LICENSE
├── README.md
├── Report.pdf
├── assets/
├── client-mall/
├── client-whadmin/
├── server/
└── database/
    ├── mysql/
    └── mongodb/
  1. .gitignore: This file tells git which files it should not track / not maintain a version history for.
  2. LICENSE: MIT License.
  3. README.md: The current file. Contains the necessary information and instructions to set up and run this project locally, the link to the video demonstration for this project, and contribution information.
  4. Database-Design-and-Implementation-Report.pdf: The Database Design and Implementation report as required on the Assessment page on Canvas.
  5. assets/: This folder contains the Project Requirement Specifications PDF file and other miscellaneous medias.
  6. client-mall/: This NodeJS project directory contains the source code for the Mall frontend client.
  7. client-whadmin/: This NodeJS project directory contains the source code for the Warehouse Administrator's frontend client.
  8. server/: This NodeJS project directory contains the source code for the Warehouse Administrator's frontend client.
  9. database/mysql: This NodeJS project folder contains the setup script (NodeJS), utilities SQL scripts, and sample data for the local MySQL database instance. See Installation - Database - MySQL below for more detail.
  10. database/mongodb: This NodeJS project folder contains the setup script (NodeJS) and sample data for the local MongoDB database instance. See Installation - Database - MongoDB below for more detail.

Technology Stack

  • Database: MySQL and MongoDB.
  • Backend API Server: NodeJS, Express, and Mongoose.
  • Frontend: Vite, React, Bootstrap, and Axios.

Dependencies

Dependency Version
NodeJS 18.*.*
MySQL Community Server 8.0.33
MySQL Shell 8.0.33
MongoDB Community Server 6.0.*

Installation

Database:

MySQL:

  1. From the project's root directory, navigate to database/mysql/ directory:

    cd database/mysql
  2. Initialize the MySQL database:

    • Without mock-data:

      npm ci
      npm run setup  # You will be prompted for your MySQL server root username and password
    • With mock-data (Optional - for testing purpose only):

      npm ci
      npm run setup-with-mock-data  # You will be prompted for your MySQL server root username and password
    • Alternatively, you can manually set up the MySQL database using MySQL Shell and our provided SQL setup scripts for more granular control:

      • Connect to your local instance of MySQL as the root user:
        mysql -u<root-username> -p
      • Execute the setup SQL scripts located in the database/mysql/ directory in the following order:
        • source reset.sql (Warning - this will wipe all existing data)
        • source init/tables.sql
        • source init/indexing.sql
        • source init/business_rules.sql
        • source init/users.sql
        • source init/mock_data.sql (Optional - for testing purpose only)

MongoDB:

  1. From the project's root directory, navigate to database/mongdodb/ directory:

    cd database/mongodb
  2. Initialize the MongoDB database:

    • Without mock-data:

      npm ci
      npm run setup
    • With mock-data (Optional - for testing purpose only):

      npm ci
      npm run setup-with-mock-data

Backend API server in server:

cd server
npm clean-install

Mall frontend in client-mall (for sellers and buyers):

cd client-mall
npm clean-install

Warehouse dashboard frontend in client-whadmin (for warehouse administrators):

cd client-whadmin
npm clean-install

Usage

  1. Make sure your local instance of MySQL is running and have been initialized according to the instructions above.
  2. Make sure your local instance of MongoDB is running and have been initialized according to the instructions above.
  3. Start API server:
    cd server
    npm run start
    This will start the API server listening at http://localhost:3000/
  4. Start Mall frontend:
    cd client-mall
    npm run dev
    This will start the Mall frontend at http://localhost:3001/
  5. Start Warehouse Dashboard frontend:
    cd client-whadmin
    npm run dev
    This will start the Warehouse Dashboard frontend at http://localhost:3002/

Video Demonstration:

Available on YouTube.

Contribution

SID Name Role
s3924826 Tran Minh Nhat Technical Writer
s3864188 Phan Thanh Loi Frontend Developer
s3963207 Do Le Long An Backend Developer
s3877562 Vo Tuong Minh (Mike) Database Admin

Developer Tools

Git Vim VS Code WebStorm Postman MySQL Workbench MongoDB Compass

TODOs:

  • Separate the FE and BE of the project and deploy it
  • Testing the concurrency control when multiple users are buying the same thing

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.0%
  • Go 15.8%
  • CSS 3.2%
  • Other 1.0%