albertbahia / groupOnClone

create and purchase coupons as a company or customer - express, handlebars, MySQL, jQuery

Home Page:https://afternoon-sierra-47024.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GroupOn Clone

steps to deploy

  1. create a MySQL database + populate it with db/schema.sql + seed it

be in the root of your application in your terminal

if you have no password on your local mysql database:

mysql -u root 
CREATE DATABASE groupon_db;
USE groupon_db;
source db/schema.sql;
source db/seeds.sql
  1. update config/connection.js to match your own database credentials (note: Windows machines probably won't be 3306)
  2. push all code to github
  3. push repo to heroku (do not include a index.php and composer.json file)
  4. login to the heroku website
  5. click on the app that you made on the heroku website. If you forgot what your app is - then you can run heroku open in your terminal in your app directory. The url of your app is the app name on the heroku website.
  6. add jawsdb to your heroku app.
  7. click on the jawsdb app on the heroku website.
  8. using the credentials listed, login to your mysql database like this in your terminal. Be sure to be in the root of your application folder in the terminal.

Don't forget to take off the < > brackets

There is no space after u and p. This is not a typo.

mysql -h <database url goes here> -u<username goes here> -p<password goes here>

run SHOW DATABASES; then USE yourDBNameGoesHere then source db/schema.sql; then do control + c to get out of the mysql console.

  1. heroku logs to debug things

synoposis

This is an app where there are two types of users, companies and customers. Companies can create coupons and Customers can buy coupons.

Technologies used: Express.js (routing), Handlebars (templating), jQuery (ajax, interactivity), MySQL (database)

In controllers/couponsController.js you will see basic authorization (which users can see what in the app).

In views/layouts/main.handlebars, you will see the layout file for the application.

In views/partials/coupons, you will see the partial views (snippets of html that can be used in other view files) that are used in the views/coupons files.

In controllers/usersController.js there is user authentication implemented (login, registration) leveraging the bcrypt npm package.

In the db/schema.sql file there is the database architecture of the application (the tables).

to do

- comment the hell out of this
- make videos explaining different parts of this app
	- go over authentication 
		* authentication
		* authorization 
		* hitting a route via ajax
		* hitting a route via a form
		* handlebars

Completed Routes

get route 
	companies can see 
		all the coupons that the users have purchased from their company

get route 
	-> for user to see all the coupons that they have bought

get route 
	customers can see 
		all the coupons 
			-> button that says buy now
				-> post request to insert into the user_coupons table

get route 
	form to create a coupon

About

create and purchase coupons as a company or customer - express, handlebars, MySQL, jQuery

https://afternoon-sierra-47024.herokuapp.com/


Languages

Language:JavaScript 65.1%Language:HTML 32.8%Language:CSS 2.1%