Giter Club home page Giter Club logo

Thomas Carpenter's Projects

burger icon burger

DB Setup Inside your burger directory, create a folder named db. In the db folder, create a file named schema.sql. Write SQL queries this file that do the following: Create the burgers_db. Switch to or use the burgers_db. Create a burgers table with these fields: id: an auto incrementing int that serves as the primary key. burger_name: a string. devoured: a boolean. date: a TIMESTAMP. Still in the db folder, create a seeds.sql file. In this file, write insert queries to populate the burgers table with at least three entries. Run the schema.sql and seeds.sql files into the mysql server from the command line Now you're going to run these SQL files. Make sure you're in the db folder of your app. Start MySQL command line tool and login: mysql -u root -p. With the mysql> command line tool running, enter the command source schema.sql. This will run your schema file and all of the queries in it -- in other words, you'll be creating your database. Now insert the entries you defined in seeds.sql by running the file: source seeds.sql. Close out of the MySQL command line tool: exit. Config Setup Inside your burger directory, create a folder named config. Create a connection.js file inside config directory. Inside the connection.js file, setup the code to connect Node to MySQL. Export the connection. Create an orm.js file inside config directory. Import (require) connection.js into orm.js In the orm.js file, create the methods that will execute the necessary MySQL commands in the controllers. These are the methods you will need to use in order to retrieve and store data in your database. selectAll() insertOne() updateOne() Export the ORM object in module.exports. Model setup Inside your burger directory, create a folder named models. In models, make a burger.js file. Inside burger.js, import orm.js into burger.js Also inside burger.js, create the code that will call the ORM functions using burger specific input for the ORM. Export at the end of the burger.js file. Controller setup Inside your burger directory, create a folder named controllers. In controllers, create the burgers_controller.js file. Inside the burgers_controller.js file, import the following: Express burger.js Create the router for the app, and export the router at the end of your file. View setup Inside your burger directory, create a folder named views. Create the index.handlebars file inside views directory. Create the layouts directory inside views directory. Create the main.handlebars file inside layouts directory. Setup the main.handlebars file so it's able to be used by Handlebars. Setup the index.handlebars to have the template that Handlebars can render onto. Create a button in index.handlebars that will submit the user input into the database. Directory structure All the recommended files and directories from the steps above should look like the following structure: . ├── config │ ├── connection.js │ └── orm.js │ ├── controllers │ └── burgers_controller.js │ ├── db │ ├── schema.sql │ └── seeds.sql │ ├── models │ └── burger.js │ ├── node_modules │ ├── package.json │ ├── public │ ├── assets │ │ ├── css │ │ │ └── burger_style.css │ │ └── img │ │ └── burger.png │ └── test.html │ ├── server.js │ └── views ├── index.handlebars └── layouts └── main.handlebars

culvercityterrace icon culvercityterrace

Vanity website for Culver City Terrace. This app uses language HTML, CSS, Bootstrap, Javascript.

forkify icon forkify

The app is a project from Udemy Im that current completing. This app has ability uses an API call to 3 different food topics that displays 30 recipes. The user can select a recipe that appears in the body of the page. The use can also customize recipe to accomindate the thier desired number of serving. Plus can like the recipes.

friendfinder icon friendfinder

In this activity, you'll build a compatibility-based "FriendFinder" application -- basically a dating app. This full-stack site will take in results your users' surveys, then compare their answers with those from other users. The app will then display the name and picture of the user with the best overall match. FriendFinder - app - data - friends.js - public - home.html - survey.html - routing - apiRoutes.js - htmlRoutes.js - node_modules - package.json - server.js Instructions Your survey should have 10 questions of your choosing. Each answer should be on a scale of 1 to 5 based on how much the user agrees or disagrees with a question. Your server.js file should require the basic npm packages we've used in class: express, body-parser and path. Your htmlRoutes.js file should include two routes: A GET Route to /survey which should display the survey page. A default USE route that leads to home.html which displays the home page. Your apiRoutes.js file should contain two routes: A GET route with the url /api/friends. This will be used to display a JSON of all possible friends. A POST routes /api/friends. This will be used to handle incoming survey results. This route will also be used to handle the compatibility logic. You should save the data in your app as an array of objects. Each of these objects should roughly follow the format below. { "name":"Ahmed", "photo":"https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/064/1bd/3435aa3.jpg", "scores":[ 5, 1, 4, 4, 5, 1, 2, 5, 4, 1 ] } Determine the user's most compatible friend using the following as a guide: Convert each user's results into a simple array of numbers (ex: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1]). With that done, compare the difference between current user's scores against those from other users, question by question. Add up the differences to calculate the totalDifference. Example: User 1: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1] User 2: [3, 2, 6, 4, 5, 1, 2, 5, 4, 1] Total Difference: 2 + 1 + 2 = 5 Remember to use the absolute value of the differences. Put another way: no negative solutions! Your app should calculate both 5-3 and 3-5 as 2, and so on. The closest match will be the user with the least amount of difference. Once you've found the current user's most compatible friend, display the result as a modal pop-up. The modal should display both the name and picture of the closest match. FriendFinder - app - data - friends.js - public - home.html - survey.html - routing - apiRoutes.js - htmlRoutes.js - node_modules - package.json - server.js Instructions Your survey should have 10 questions of your choosing. Each answer should be on a scale of 1 to 5 based on how much the user agrees or disagrees with a question. Your server.js file should require the basic npm packages we've used in class: express, body-parser and path. Your htmlRoutes.js file should include two routes: A GET Route to /survey which should display the survey page. A default USE route that leads to home.html which displays the home page. Your apiRoutes.js file should contain two routes: A GET route with the url /api/friends. This will be used to display a JSON of all possible friends. A POST routes /api/friends. This will be used to handle incoming survey results. This route will also be used to handle the compatibility logic. You should save the data in your app as an array of objects. Each of these objects should roughly follow the format below. { "name":"Ahmed", "photo":"https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/064/1bd/3435aa3.jpg", "scores":[ 5, 1, 4, 4, 5, 1, 2, 5, 4, 1 ] } Determine the user's most compatible friend using the following as a guide: Convert each user's results into a simple array of numbers (ex: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1]). With that done, compare the difference between current user's scores against those from other users, question by question. Add up the differences to calculate the totalDifference. Example: User 1: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1] User 2: [3, 2, 6, 4, 5, 1, 2, 5, 4, 1] Total Difference: 2 + 1 + 2 = 5 Remember to use the absolute value of the differences. Put another way: no negative solutions! Your app should calculate both 5-3 and 3-5 as 2, and so on. The closest match will be the user with the least amount of difference. Once you've found the current user's most compatible friend, display the result as a modal pop-up. The modal should display both the name and picture of the closest match.

hw-12-flashcard-generator icon hw-12-flashcard-generator

This application allows the users to test their skills on the American Civil War by using flash card. The front card will display a question and the back card will display the answer to the question. Once the test comes to an end the result will be displayed.

hw-6-giphyapi icon hw-6-giphyapi

This Project has buttons that are created dynamically from an array. Pressing the buttons will call the API and will display ten still GIF's. Once a GIF is pressed the GIF will play and when clicked a second time the GIF will stop playing. Also the user can create an unlimited number of buttons by entering the name of a movie title and after the enter button is click a new button is created and label the movie title by the same title entered by the user.

hw-7-metro icon hw-7-metro

This app will allow users to monitor Metro transportation by name, destination, frequency (min), next arrival time, and minutes away.

hw-7-metro-time icon hw-7-metro-time

This app will allow users to monitor Metro transportation by name, destination, frequency (min), next arrival time, and minutes away.

hw-hangman-game icon hw-hangman-game

homework 3, hangman game. User has 9 chances to guess the name of a 90's hip hop group.

liri-node-app icon liri-node-app

Liri is a language interpretation and recognition interface. Liri will be a command line node app that takes in parameters and gives you back data.

nytreactserach icon nytreactserach

A React.js based application that search's and save New York Times Articles using Mongo.db.

sequelizedburger icon sequelizedburger

The goal of this application is to convert my Burger application that is using MySQL to Sequelize.

triviagame icon triviagame

This trivia game will test your knowledge about the TV show "The Walking Dead". If you know death then you know this game.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.