Coder Social home page Coder Social logo

ashtonkbailey / byob Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 99 KB

US Music Festivals API - Are you building a tourism, vacation or music events/performances app? This API allows you to find data on all major 2019 music festivals happening in over 20 states. Data is stored with a PostgresSQL database and the backend is built with Node.js, Express, and Knex.js.

JavaScript 100.00%

byob's Introduction

BYOB- US Music Festivals API

Are you building a tourism, vacation or music events/performances app? This API allows you to find data on all major 2019 music festivals happening in over 20 states. Data is stored with a PostgresSQL database and the backend is built with Node.js, Express and Knex.js.

API Endpoints

States

GET /api/v1/states // get all states
--> returns an array of state objects

POST /api/v1/states // create a new state 

GET /api/v1/states:stateID // get a specific state 
--> returns an array with a specific state 

GET  /api/v1/states?state_id=1 // get a specific state
--> returns an array with a specific state 

PUT /api/v1/states/:stateID // update a specific state's data

DELETE /api/v1/states/:stateID // delete a state

2019 Music Festivals

GET /api/v1/festivals // get all festivals
--> returns an array of festival objects

POST /api/v1/festivals // create a new festival

GET /api/v1/states/:stateID/festivals // get all festivals in a specific state
--> returns an array of festival objects in a  state

GET /api/v1/festivals/:festivalID // get a specific festival
--> returns an array with a specific festival 

PUT /api/v1/festivals/:festivalID // update a specific festival's data 

DELETE /api/v1/festivals/:festivalID // delete a festival

Sample Responses

All States Response

Status: 200 OK
Link: <http://localhost:3000/api/v1/states>
---
[
  {
  "id": 128,
  "state": "Arizona",
  "major_airport": "Phoenix Sky Harbor International Airport",
  "number_of_music_festivals": 10,
  "created_at": "2019-01-31T20:17:06.679Z",
  "updated_at": "2019-01-31T20:17:06.679Z",
  "tourism_website": "https://www.visitarizona.com"
  },
  {
  "id": 129,
  "state": "California",
  "major_airport": "Los Angeles International Airport",
  "number_of_music_festivals": 38,
  "created_at": "2019-01-31T20:17:06.683Z",
  "updated_at": "2019-01-31T20:17:06.683Z",
  "tourism_website": "https://www.visitcalifornia.com"
  },
  {
  "id": 131,
  "state": "Florida",
  "major_airport": "Miami International Airport",
  "number_of_music_festivals": 17,
  "created_at": "2019-01-31T20:17:06.687Z",
  "updated_at": "2019-01-31T20:17:06.687Z",
  "tourism_website": "https://www.visitflorida.com"
  },
  {
  "id": 132,
  "state": "Georgia",
  "major_airport": "Hartsfield–Jackson Atlanta International Airport",
  "number_of_music_festivals": 8,
  "created_at": "2019-01-31T20:17:06.689Z",
  "updated_at": "2019-01-31T20:17:06.689Z",
  "tourism_website": "https://www.exploregeorgia.org"
  },
  {
  "id": 134,
  "state": "Louisiana",
  "major_airport": "Louis Armstrong New Orleans International Airport",
  "number_of_music_festivals": 4,
  "created_at": "2019-01-31T20:17:06.690Z",
  "updated_at": "2019-01-31T20:17:06.690Z",
  "tourism_website": "https://www.louisianatravel.com"
  },
  {
  "id": 136,
  "state": "Massachusetts",
  "major_airport": "Logan International Airport",
  "number_of_music_festivals": 5,
  "created_at": "2019-01-31T20:17:06.692Z",
  "updated_at": "2019-01-31T20:17:06.692Z",
  "tourism_website": "https://www.massvacation.com"
  }
]

All Festivals Response

Status: 200 OK
Link: <http://localhost:3000/api/v1/festivals>
---
[
  {
  "id": 763,
  "festival_name": "Made Up Music Festival",
  "start_end_dates": "6/1/19-6/2/19",
  "image": "https://exampleimage/123.jpg",
  "city": "Nowhere",
  "state_id": 128,
  "created_at": "2019-01-31T21:25:09.052Z",
  "updated_at": "2019-01-31T21:25:09.052Z"
  },
  {
  "id": 577,
  "festival_name": "Arizona Roots",
  "start_end_dates": "2/9/19-2/10/19",
  "image": "https://1b7ta73fjmj23201tc3suvsi-wpengine.netdna-ssl.com/wp-content/uploads/2016/10/California-Roots-Hero-Pic-600x400.jpg",
  "city": "Chandler",
  "state_id": 128,
  "created_at": "2019-01-31T20:17:06.704Z",
  "updated_at": "2019-01-31T20:17:06.704Z"
  },
  {
  "id": 587,
  "festival_name": "Noise Pop",
  "start_end_dates": "2/25/19-3/3/19",
  "image": "https://1b7ta73fjmj23201tc3suvsi-wpengine.netdna-ssl.com/wp-content/uploads/2016/04/Music-Festival-Wizard-Treefort-2016-37-600x400.jpg",
  "city": "San Francisco",
  "state_id": 129,
  "created_at": "2019-01-31T20:17:06.710Z",
  "updated_at": "2019-01-31T20:17:06.710Z"
  }
]

Technologies Used

  • Node.js
  • Express
  • Knex.js
  • Heroku

For testing:

  • Mocha
  • Chai
  • Chai HTTP

To Contribute to this Project

  1. Follow the steps in the SETUP file to get app running locally on your machine.

  2. Check out our list of github issues here. Please use these issues as a helpful guidance for any contributions you would like to make.

  3. We would love to have you contribute to our project! Read our CONTRIBUTING file to see how we like our pull requests.

Project Specs

This project was designed as a build-your-own-backend (BYOB) challenge at Turing School of Software & Design.

Database and Backend designed and created by lead developers Tanjie McMeans and Ashton Bailey.

byob's People

Contributors

tmcmeans avatar ashtonkbailey avatar

Watchers

 avatar

byob's Issues

Post to tests ERROR

keep getting a 500 error. possibly an issue with truncating ids while reseeding the db before each test. Leta mentioned she would look into this. We refactored the endpoint to not require the stateID, and instead require it in the request body.

Add logic to API search query endpoint

We have an idea for GET /api/v1/states?state_id=1 but need to figure out logic for implementing search query params in server.js file. Looking in Express docs but might need more clarification on this.

Incorporate linter

We don't have ESLINT installed. Could be an easy fix for a contributor.

Create 4 GET endpoints

  • 2 GET endpoints for all of one resource (i.e. /api/v1/merchants)

  • 2 GET endpoints for a specific resource (i.e. /api/v1/merchants/:merchant_id)

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.