GithubHelp home page GithubHelp logo

full-stack-donuts's Introduction

Code-Along Workshops

Introduction

Quickly work through all major areas of the full stack so you can see it all come together:

  • Client-side a.k.a. Frontend (React)
  • Server-side a.k.a Backend (Express, and Database (MySQL).

Goal

After working through this practice repo, you should be able to quickly build and work in any ExpressJS application.

Building a basic CRUD app should be mostly muscle memory.

Getting started

How to perform this activity:

In class, we will work through parts 1-2 in the back-end workshop, and parts 3-4 in the front-end workshop.

NOTE: The code written in class has many different styles (ES5 functions, ES6 functions, async callbacks, promises, etc) to show a variety of ways to handle the same functionality.

Once we have finished, you should delete everything and start over for yourself!

On the second rebuild: Do not reference code you already wrote for this assignment! Instead, rely on DOCUMENTATION and your CHEATSHEET. If you have completed part 4 in a timely manner, proceed to part 5.

Part 1: Server API

Objectives (read this carefully):

  • Create a server that responds to the specified RESTful routes
  • Each route should respond back with dummy data for now

Technologies:

  • Node
  • Express
  • NPM
  • Git

ROUTES (PART 1)

METHOD PATH DESCRIPTION
GET /api/donuts respond with string "all the donuts"
GET /api/donuts/:id respond with string "single donut"

Part 2: MySQL Queries

  • Connect your server to your database using MySQLJS (mysql javascript)
  • Complete the server routes outlined in the route table below (use the queries.js helper functions)

Technologies:

  • MySQL
  • MySQLJS
  • Postman

ROUTES:

METHOD PATH DESCRIPTION
GET /api/donuts respond with all the donuts from the database
GET /api/donuts/:id respond with single donut, based on req.params.id

Part 3: ReactJS (Using Dummy Data)

In your frontend folder:

Using the given donuts dummy data (exampleDonuts.js):

  • Refactor the given React code to do the following:
    • Dynamically view all the donuts (using the provided React components during rep 1 and creating your own during rep 2)
    • Enter a donut id to the form and view that selected donut

Part 4: ReactJS (Refactor using Data From Your Server API)

In your frontend folder:

Using the donut data from your server API routes:

  • Update your React app to:
    • View all donuts from the server
    • View a specific donut from the server

HINT: You will need to use AJAX (Fetch, Axios, etc) to allow your client side code to talk to your server.

You've already created the endpoints below, now you need to use AJAX to communicate to them and get the info you need to the client-side code:

METHOD PATH DESCRIPTION
GET /api/donuts respond with all the donuts
GET /api/donuts/:id respond with single donut, based on req.params.id

Part 5: Bonus - Full CRUD

(DO THIS ONLY ON THE SECOND RUN)

Handle these additional routes in your server, they should modify the database accordingly:

METHOD PATH DESCRIPTION
POST /api/donuts inserts new donut record from req.body
PATCH /api/donuts/:id update a donut record from req.body
DELETE /api/donuts/:id delete a donut record

Create the appropriate interface in your React app so that users can make AJAX (e.g. Axios, Fetch, $.Ajax, etc) requests to the routes above and then see the changes render in their web browser.

full-stack-donuts's People

Contributors

kosticus 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.