Giter VIP home page Giter VIP logo

code_challenge_pg_sql's Introduction

Code Challenge - Week 4 (SQL Databases and Server Integration)

Overview

Your front-end developer has created all of the client-side code necessary to view and add treats from the treats database. In fact, said developer even styled the entire application and put in a couple of hard-coded examples of what the view will look like.

Remember

A friendly reminder that this is simply a way for us to see how you are individually doing with the technology. If this is no problem, great. If you are struggling with it, get done what you can and still submit. Just relax and show us what you know!

Thanks and good luck!

Instructions

  1. Fork and clone this repository.
  2. Run npm install The package.json file does NOT include all the npm modules you will need.
  3. You will not need to change the client side code (HTML, CSS, nor JavaScript);
  4. Design and create the database. Be sure to commit the create table syntax in the create_database.sql file.
  5. Build out the server routes described below.
  6. Once you are complete, check your work into a new repo and post it on GitHub. Submit this link with your assignment.

Database

Create a treats table with the following columns:

  • id (this will be your primary key)
  • name (short string)
  • description (lots of text)
  • pic (this is a string URL to a supplied image for this treat)

It may be helpful to insert some rows into your new table so your GET route is easier to make.

INSERT INTO treats (name, description, pic)
VALUES ('Cupcake', 'A delicious cupcake', '/assets/cupcake.jpg'),
('Donuts', 'Mmmm donuts', '/assets/donuts.jpg');

Required Mode

Build out these routes on your server:

  • GET /treats returns a list of potential treats (e.g. cupcakes, goldfish, etc) and their image URLs.
  • POST /treats expects a treat type, description, and the path/url for the image. Take a look at the /server/public/assets folder for which images we have to work with.

Hard Mode

Still have time? Build out the Update and Delete features. You will need to change the client side markup and JS.

code_challenge_pg_sql's People

Contributors

kdszafranski avatar chadsundberg avatar lukeschlangen avatar

Watchers

James Cloos avatar

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.