GithubHelp home page GithubHelp logo

byob's Introduction

Brews BYOB: Build Your Own Backend

Built by Amy Rippeto

As a student in the Front-End Engineering Program at Turing school of software and design, this was my first project working in the back-end. This was an opportunity to become familiar with building a database with Express, Knex and PostgreSQL and a well documented RESTfulAPI. The focus was on working with a one-to-many relational database schema design as well as using appropriate status codes and error handling.

I created the seed dataset for Breweries, giving each of them an array of relevant beers. This allowed me to implement two seperate tables, related by the brewery id.

Endpoints

Purpose URL Verb Request Body Sample Success Response
Get all breweries /api/v1/breweries GET none Array of Breweries [{"id": 31, "name": "New Belgium Brewery", "year_est": 1991, "num_locations": 2, "created_at": "2019-11-22T16:12:15.936Z", "updated_at": "2019-11-22T16:12:15.936Z"}]
Get all beers /api/v1/beers GET none { beers: [array of beers]}
Get a random /api/v1/beers/random GET none A single random beer: {"id": 127, "beer": "Dunkel", "style": "German-Style Dark Lager", "abv": "5.6", "ibu": 24, "brewery_id": 50, "created_at": "2019-11-22T16:12:16.010Z", "updated_at": "2019-11-22T16:12:16.010Z"}
Get all beers for a given brewery /api/v1/beers/:brewery_id :brewery_id should be replaced with integer id of selected brewery GET none {[array of beers]}
Add a brewery /api/v1/breweries POST Requires: name(string), year_est(integer), num_locations(integer) Status Code 201 & { id: added_brewery_id }
Add a beer /api/v1/beers POST Requires: beer(string), style(string), abv(integer), ibu(integer), brewery_id(integer) 201 Status Code & { id: added_beer_id }
Delete a beer /api/v1/beers/:id :id should be replaced with integer id of selected beer DELETE none 202 Status Code & { message: 'Successfully deleted the beer.'}
Delete a brewery and all of its beers /api/v1/breweries/:id :id should be replaced with integer id of selected brewery DELETE none 202 Status Code & { message: 'Successfully deleted brewery and its beers.'}

Cheers!

byob's People

Contributors

aripp2 avatar

Watchers

James Cloos avatar  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.