Skip to content

palowenstein/big-fernand-burger-logger-mysql-orm-hb

Repository files navigation

#13-big-fernand-node-express-handlebars-orm

Project license

Big Fernand Burger logger enabled via MySQL, Node, Express, Handlebars and a custom made ORM.

Github Repository Page: https://github.com/palowenstein/big-fernand-node-express-handlebars-orm

Heroku Deployment Page: https://still-bayou-56367.herokuapp.com/

Table of Contents

GIF

Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Application Demo (GIF)

Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Application Demo (GIF)

Overview

  • The French themed Big Fernand Burger enables 2 types of action:
    1. Adding a burger via the input field window.
    2. Moving an available burger (left column) to the "devoured" section (right column) by clicking on its name.
  • The application uses a Model View Controller (MVC) targetting the Handlebars templating language in its Express version.
  • A custom made ORM (Object-relational Mapper) is used to connect the object code to the MySQL relational database, creating a defacto virtual object database.
  • Overall, the program is powered via Node.js, vanilla javascript, Express for GET/POST Requests between REST APIs, a MySQL relational database (either local or remote via an heroku add-on) to hold the burger information, and the previously mentioned MVC, Handlebars, ORM technologies.
  • The MySQL database, stored in the db folder as schema.sql, can be initiated via Terminal or, more simply, via MySQL Workbench.
  • In addition of the database schema, the db folder also contains a seeds.sql file which will populate the database so that the application doesn't show empty when run at first.

Details

  • A .gitignore file is present at the root level to prevent the upload of node_modules, sensitive database information, Macintosh .DS_Store files.
  • For this application to execute properly:
    1. Oracle's MySQL must be locally installed and running in the background as seen in the following System Preferences photo. The application will not run correctly otherwise. Please make note of the password associated with your MySQL install as it will be required by the application. Newcomers to MySQL will gain information from reading the following article: https://www.thoughtco.com/installing-mysql-on-mac-2693866
    2. For the application to execute under Heroku, it has to be specifically compiled for Heroku deployment. CLEAR_DB or JAWS_DB_MARIA, both MySQL based and available at no cost to the user, must be installed as a Heroku add-on to substitute for the local database. Either will have to be configurated and the config/connection.js file will need to be updated with the proper remote database information (lines 9-13).
    3. The end user must first execute the package.json file located in the root folder of the application. This can be done in Apple's Terminal via the npm install command and will install the required dependencies (MySQL, Express, Express-Handlebars, Handlebars) needed for the program to run.

MySQL Employee Management Tracker Application — MySQL Background Execution / Mac OSX System Preferences (PNG)

MySQL runs in the background as seen in the MySQL maintenance panel located in System Preferences (Apple Macintosh).

Instructions

  • Makes sure MySQL is properly installed, password initiated and running in the background as seen in the screenshot above.
  • In MySQL Workbench, load the schema.sql file, located in the application db folder, then initiate it by clicking on the lightning bolt
  • Still in MySQL Workbench, locate the seeds.sql file in the application db folder then, as in the prior step, initiate it by clicking on the lightning bolt.
  • In the Application folder, open config/connection.js in a text / code editor, add your MySQL Password on line 21.
  • In Terminal, locate the application folder and enter into it via the 'cd' command: cd big-fernand-burger-logger-mysql-orm-hb
  • Run the 'npm install' command to install the necessary node modules from the package.json.
  • Run the 'node server.js' command to launch the application. If executed locally, it will appear as localhost:4000 in your browser.
  • When run initially, the application will show a selection of 5 burgers ready to be eaten and 1 burger already devoured.
  • New burgers can be added via the input field window.
  • Burgers available for consumption will be moved to the "devoured" section when clicked onto.

Screenshots

Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Running the Application at Startup (JPG)

Fig. 1. Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Running the Application at Startup (JPG)


Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Adding 'Le Passy' burger via the input field (JPG)

Fig. 2. Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Adding 'Le Passy' burger via the input field (JPG)


Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Compiling the application for Heroku deployment (PNG)

Fig. 3. Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) — Compiling the application for Heroku deployment (PNG)

Video

Big Fernand Burger Logger (MVC, ORM, SQL, Handlebars) - Application Demo (MP4)

References

  • ORM Object–Relational Mapping
  • MySQL Relational Database Structure.
  • Node.js Javascript Library.
  • Express for GET/POST/DELETE Requests between REST APIs.
  • Handlebars Templating Language
  • Package.JSON / NPM for installing dependencies
  • Heroku Install: JAWS_DB or CLEAR_DB SQL Database

License

MIT License | Copyright © [2021] Pierre André Lowenstein

Contributions

  • Pull/Fork from master.
  • Create your own branch.
  • Add your own code (must be tested).
  • Push your branch.
  • Request a pull.

Please use the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md)

For major changes, please open an issue beforehand to discuss the changes.

Contact

[www] pierreandrelowenstein.com  |  [e-mail] Send me a 'courriel'

About

French themed Big Fernand Burger logger enabled via MySQL, Node, Express. Organized as a MVC (Model View Controller) targetting Handlebars, plus using a homemade ORM (Object-relational Mapper).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published