COSC 499 Capstone Project
a MobileFriendly website to automate the process of obtaining campfire wood
This automation process looks like:
(1) user views advertisement on Facebook or any other site;
(2) clicks link/hotspot and is directed to our wood sales web site (to be created as part of this project);
(3) chooses their general location ie. West Kelowna, Mission, Rutland etc... and number of bags of firewood desired;
(4) purchaser receives an invoice that is produced based on pricing and quantity desired,
(5) Payment is processed Receipt is generated automatically.
(6) instructs purchaser on address where firewood is available for pickup;
Zach Prenovost
Aidan Murphy
Cam Wilson
Karlen Speiser
Check out our Gantt chart here
Download Node.js from here
In your Node server file(backend), create new package.json file with:
npm init -y
Use npm to install the following dependencies:
npm install express cors mongoose dotenv axios jsonwebtoken joi joi-password-complexity bcrypt
Express: middleware for MERN stack, provides robust functions for Node.js
Cors: permits AJAX requests from the remote host
Mongoose: helps node server interact with MongoDB
Dotenv: help loading environment variables
Install nodemon, which auto restarts node app during development:
npm install -g nodemon
See MERN Scripts/backend for use of the libraries
In your main project folder(MERN Scripts), create React.js application:
npx create-react-app mern-emsystem
Navigate to mern-emsystem directory, start the web server:
npm start
To link the database to your Node.js server, create a .env in the Node server file
Use the connection string with the appropriate username and password to connect
To handle credit and debit purchases, the following must be installed:
npm install react-square-web-payments-sdk
npm install square
click here for node mailer documentation
In the backend folder, install nodemailer
npm install nodemailer
npm install express-pino-logger
npm install twilio --save-dev
npm install --save @sendgrid/mail
npm install promise
You will need to add necessary token to .env file
click here for info from developers
npm install --save-dev jest
create test files using naming convention:
name.test.js
format package.json file appropriately
{
"scripts": {
"test": "jest"
}
}
run
npm test
in code directory
navigate to the root directory of your project ('MERN Scripts'), which should contain the 'Backend' and 'mern-emsystem' folders, and start another node project:
npm init
install the package: Concurrently
When prompted, otherwise press return for all other prompts.
Run the react project and launches the node server with one command:
npm run dev
Links to create developer accounts for each API:
- Square: https://squareup.com/signup?v=developers&country_code=ca&lang_code=en-CA
- Twilio: https://www.twilio.com/try-twilio
- SendGrid: https://signup.sendgrid.com/
The following document contains BSON which will be used to create a new document in the Employees collection inside of the MongoDB database.