This is the final project for COMP3005 at Carleton University. The basic outline of the project is described below:
Brief: Design and implement an application for an online bookstore (Look Inna Book)
Feature List:
Feature Name | Permission Level |
---|---|
Browse books | Anyone |
View a book | Anyone |
Add books to your cart | Anyone |
Login / Register | Anyone |
Checkout | Logged in users |
Track order | Logged in users |
Add new books | Admin |
Remove books | Admin |
View publisher info | Admin |
View sale reports | Admin |
Order new books | Server |
- Clone the project
- Create a
.env
file and insert the values according to the.env.example
file - Install XAMPP control panel
- Start both the Apache and MySQL services and go to the MySQL Admin page
- Update the localhost user according to your
.env
username and password (User accounts tab)
- If changes in MySQL were made, update your phpMyAdmin/config.inc.php file (
$cfg['Servers'][$i]['password']
) - Create a new database with the same name as the value of
dev_database
in your.env
file - Run the following commands in a terminal from the root directory of this project
npm init
npm install <dependency_name> # list all dependencies in requirements.txt
npm install -g nodemon # to run the server
nodemon app.js
- Head to http://localhost:3000/db/init to create all the tables
- Restart the server
- Head to http://localhost:3000/db/insert to insert all the values
- Head to http://localhost:3000
Problem: The site http://localhost:3000 can't be reached
Potential fixes:
- Is app.js running on port 3000? Check to see that
DEV_MODE
is set totrue
inroot/public/constants/basic.js
.
Problem: No books are being displayed.
Potential fixes:
- Did you initialize the database and insert data into the database by using the method above?
- Is XAMPP control panel still running?
Problem: Database connection can't be made and/or tables cannot be created.
Potential fixes:
- Did you set up your
.env
file correctly? Double check the values in the database against your values in.env
file. - Is XAMPP control panel still running?
- Karl Damus
- Roy Cheruiyot