Skip to content

DaniloVlad/ShoppingCart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShoppingCart

Node/expressjs backend with react frontend. The sites checkout is fully integerated with paypal payments. Only the webhook listener needs to be done for updating the db after purchase.

Usage

Install

  1. Install nodejs and npm (nodes package manager) on Ubuntu:
root@server:~$ curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
root@server:~$ sudo apt-get install -y nodejs

Note: If node was installed using apt (ie: sudo apt install nodejs) then you must also run sudo apt install npm to install npm. Also if apt was used the installed executable will be called nodejs instead of node. The command to run the server would become nodejs app rather than node app

  1. Configure and install mysql (This step will create your mysql user)
root@server:~$ sudo apt install mysql-server
root@server:~$ mysql_secure_installation
  1. Import Mysql database schema (Replace username with database user: for security purposes avoid using root)
root@server:~$ mysql -u <user-name> -p 
Enter password:
Welcome to MySQL monitor....
mysql> CREATE DATABASE <database-name>;
mysql> copy & past the schema.sql file here

Note: If you already have the database created use mysql -u root -p <db-name> < server/models/schema.sql

  1. Install all the dependencies
root@server:~$ cd client && npm install
root@server:~$ cd server && npm install
  1. Edit the server/models/connection_template.js file and update the host/port/user/password & change its name.
root@server:~$ vi server/models/connection_template.js
root@server:~$ mv server/models/connection_template.js server/model/connection.js
  1. Edit the server/middlewares/helper/paypal_settings_template.js file and update the CLEINT-ID/SEED & change its name.
root@server:~$ vi server/middlewares/helper/paypal_settings_template.js
root@server:~$ mv server/middlewares/helper/paypal_settings_template.js server/middlewares/helper/paypal_settings.js

Run

root@server:~$ cd client && npm start
root@server:~$ cd server && node app

For the total Javascript project line run the count_lines binary (Ubuntu). ./count_lines > line_count Check the details here

Server

  1. Routes: Folder contains all the app routes.
  2. Middlewares: Folder contains all logic for handling various requests on the routes
  3. Models: Folder contains all of the sql queries

Client

The client was stitched together for display purposes. Has a lot of refactoring and reorganization that needs to be done. All the react components are found in src/. The structure here is very messy.

Screen Shots

Image 1

Image 6

Image 2

Image 4

Image 3

Image 5

Releases

No releases published

Packages

No packages published