Giter Club home page Giter Club logo

hishop's Introduction

Online shopping platform

Building eCommerce website from scratch.

Preview of the website: Link

Structure of the project

Using MEARN stack for managing front-end, back-end and database.

structure

Usage

We use ECMAScript Modules in the back-end for this project. Be sure to have at least Node v15.0+.
When import a new file (not a module) in the backend, be sure to include .js at the end.

Example:

import abc from "./dir/somefile.js";

Env Variables

Creating a .env file in the root and add the following feature:

# Define the enviroment
NODE_ENV = development

# Define the port for running server
PORT = 5000

# Define URL of your mongodb
MONGO_URI = your mongodb uri

# Salt for jwt hashing
JWT_SECRET = your choice

# Integrate paypal
PAYPAL_CLIENT_ID = your papal client id

If you want to see the production build. You can set NODE_ENV to production

Install Dependencies (front-end & back-end)

# Install necessary package for the whole app (make sure to do this step at the root directory)
npm install

# Install  necessary package for the frontend side (make sure to do this step in /frontend dir)
cd frontend
npm install

Run

# Run both front-end (at port 3000) & backend (at port 5000) at the same time
# Run at the root dir
npm run dev

# Run the server only
npm run server

Build

# Create frontend production build (make sure to go to /frontend)
cd frontend
npm run build

Seed dummy data for usage

If you add new data to /data folder and run the script, all your current data will be over-written.

# Import data
npm run data:import

# Destroy data
npm run data:destroy
# Sample account for testing

# Admin account
[email protected]
123456

# User account
[email protected]
123456

[email protected]
123456

hishop's People

Contributors

hades42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.