I will create a burger logger with MySQL, Node, Express, Handlebars and a homemade ORM (yum!). I followed the MVC design pattern; using Node and MySQL to query and route data in my app, and Handlebars to generate the HTML
- Description
- Development
- User Story
- Installation
- Schema
- Dependencies
- Tests
- Built With
- Questions
- Demo
- License
- Acknowledgments
- CopyRight
This is a full stack web app. From HTL, CSS, Jquery to Node.js, Express, JAWSDB and Heroku
Created the MVC structure first and worked upon each element required, starting from the node.js, using terminal and running npm i
, installing all the required dependencies, and started by creating the schema.sql and seeds.sql, preparing the database, credentials and being able to connect to it
Below some links of interest:
- node.js - https://nodejs.org/en/
- heroku-cli NPM Package - https://www.npmjs.com/package/heroku-cli
- express NPM Package - https://www.npmjs.com/package/express
- path NPM Package - https://www.npmjs.com/package/path
-
Eat-Da-Burger! is a restaurant app that lets users input the names of burgers they'd like to eat.
-
Whenever a user submits a burger's name, your app will display the burger on the left side of the page -- waiting to be devoured.
-
Each burger in the waiting area also has a Devour it! button. When the user clicks it, the burger will move to the right side of the page.
-
My app will store every burger in a database, whether devoured or not.
To use this application locally:
- Clone the GitHub repository at:
- You will to install all the dependencies, see Dependencies for the complete list
- Using
npm install
, install all the dependcies - Using MySQL or MSSQL database, create the DB using the schema.sql file, you can reciew the database schema on the Sql schema file
- Using the seeds.sql file to popluate the DB
- Once you have all the above created, you can edit the server.js file where the password is and add your password to access your local DataBase.
- You can then open a terminal or cmd prompt, navigate to the folder where server.js is located and type:
node server.js
- Once the server is running, open a browser and navigate to localhost:8080 or the port you have selected
- Enjoy creating your burgers and eating them!
Using one table for the app to work, only 3 columns, id, burger_name and devoured. See below syntax
DROP DATABASE IF EXISTS burgers_db;
CREATE DATABASE burgers_db;
USE burgers_db;
CREATE TABLE burgers
(
id int NOT NULL AUTO_INCREMENT,
burger_name VARCHAR(110) NOT NULL,
devoured BOOLEAN DEFAULT false,
PRIMARY KEY (id)
)
"express": "^4.17.1"
"express-handlebars": "^4.0.4"
"mysql": "^2.18.1"
Work in progress. Ran out of time to implement these, I will get back to this project at a later date to finalize these
- VScode - The editor of choice
- Notepad++ - My second editor
- Gitbash - What would we do without our bash?
-
How can I run the application?
You just need to follow the instructions on the installation section, where it is explained -
What if I get an error?
Ensure that you have install all the dependencies required for this to work. See Dependencies section -
Can I refractor the code in the any of the files file? Yes, you can modify and refractor the code
- John Merchan
To my 2 sons, who give me the power I need to keep going. To Agustin, mentor in my learnings.
Copyright 2020 ยฉ John Merchan
๐ฆ๐บ
Table of Content --- Back to Top --- Installation