Skip to content

SebastianStovall/API-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirStay

AirStay is an online marketplace and hospitality platform that connects people seeking accommodations with those offering lodging, allowing travelers to book stays and experiences

Technologies Used

Backend

  • Node.js
  • Express
  • PostgresSQL

Frontend

  • React
  • Redux
  • HTML
  • CSS

Home Page

AirStay Splash Page

Spot Details

Airstay Spot Details

Features

Spots

  • Logged in AND logged out users can view a spot's details
  • Logged in users can create a new spot
  • Logged in users can edit their own spots
  • Logged in users can delete their own spots

Reviews

  • Logged in AND logged out users can view a user's reviews on a spot
  • Logged in users can create a new review
  • Logged in users can edit their own reviews
  • Logged in users can delete their own reviews

Bookings

  • Logged in AND logged out users can view a spot's current bookings
  • Logged in users can create a new booking for a spot
  • Logged in users can edit their own bookings
  • Logged in users can delete their own bookings

Endpoints

Request Purpose Response
GET /api/users Returns the information for one user {
"user": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1",
"email": "demo@user.io",
"username": "Demo-lition"}
}
GET /api/users/:id Returns the information for all users [{
"user": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1",
"email": "demo@user.io",
"username": "Demo-lition"}
},
{...}]

Sessions

Request Purpose Response
GET /api/auth Returns the information for the logged in user {
"user": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1",
"email": "demo@user.io",
"username": "Demo-lition"}
}
POST /api/auth/signup Signs a new user up {
"user": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1",
"email": "demo@user.io",
"username": "Demo-lition"}
}
POST /api/auth/login Logs in a user {
"user": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1",
"email": "demo@user.io",
"username": "Demo-lition"}
}
DELETE /api/auth Logs out a user { message: 'success' }

Spots

Request Purpose Response
GET /api/spots/ View all spots {
"Spots": [
{"id": 1,
"ownerId: 1,
"address": "123 Main St",
"city": "Austin", "state": "TX",
"country": "United States",
"lat": 30.2672,
"lng": 97.7431, "name": "FakeNameOne",
"description": "Welcome to Austin, Texas. This charming residence offers a comfortable and inviting atmosphere, perfect for a relaxing getaway.",
"price": 200,
"avgRating": 5,
"previewImage": "https://fakepreviewimg.jpg" } ]
}
POST /api/spots/ Create new spot {
"ownerId": 1,
"address": "123 fake street",
"city": "Austin",
"state": "TX",
"country": "United States",
"lat": -12.92,
"lng": 34.93,
"name": "FakeSpot",
"description": "fake description",
"price": 123.34
}
PUT /api/spots/:spotId Edit a spot's details {
"ownerId": 1,
"address": "123 fake street",
"city": "Austin",
"state": "TX",
"country": "United States",
"lat": -12.92,
"lng": 34.93,
"name": "FakeSpot",
"description": "fake description",
"price": 123.34
}
DELETE /api/spots/:spotId Delete a spot { message: 'success' }

Reviews

Request Purpose Response
GET /api/reviews/current Get all of a signed in user's reviews {
"Reviews": [
{ "id": 1,
"userId": 1,
"spotId": 1,
"review": "It has okay but had a leaky roof. oh well guess thats fine...",
"stars": 5,
"createdAt": "2023-08-23T22:58:01.426Z",
"updatedAt": "2023-08-25T00:12:05.908Z",
"User": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1"
},
"Spot": {
"id": 1,
"ownerId": 1,
"address": "123 Main St",
"city": "Austin",
"state": "TX",
"country": "United States",
"lat": 30.2672,
"lng": 97.7431,
"name": "FakeNameOne",
"price": 200,
"previewImage": "https://www.rocketmortgage.com/resources-cmsassets/RocketMortgage.com/Article_Images/Large_Images/TypesOfHomes/types-of-homes-hero.jpg"
},
"ReviewImages": [
{ "id": 1,
"url": "https://interiordesign.net/wp-content/uploads/2022/02/Interior-Design-Beachhouse-Bates-Masi-and-Architects-Amagansett-idx220101_boy_Res_BeachHouse01_2-2-1024x684.jpg" } ] } ] ...
}
POST /api/spots/:spotId/reviews Create a new review for a spot {
userId: 1,
"spotId": 4,
"review": "this is a nice spot",
"stars": 4
}
PUT /api/reviews/:reviewId Edit a review's details {
userId: 1,
"spotId": 4,
"review": "this is a nice spot",
"stars": 4
}
DELETE /api/reviews/:reviewId Delete a review { message: 'success' }

Bookings

Request Purpose Response
GET /api/spots/:spotId/bookings Get all of a spot's current bookings {
"Bookings": [
{ "id": 1,
"spotId": 1,
"userId": 1,
"startDate": "2024-06-03",
"guests": 1,
"endDate": "2024-08-09",
"createdAt": "2023-08-23T22:58:01.518Z",
"updatedAt": "2023-08-23T22:58:01.518Z",
"User": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1"
} } ]
}
GET /api/bookings/current Get all of of the current user's bookings {
"Bookings": [
{ "id": 1,
"spotId": 1,
"userId": 1,
"startDate": "2024-06-03",
"guests": 1,
"endDate": "2024-08-09",
"createdAt": "2023-08-23T22:58:01.518Z",
"updatedAt": "2023-08-23T22:58:01.518Z",
"User": {
"id": 1,
"firstName": "Demo1",
"lastName": "User1"
} } ]
}
POST /api/spots/:spotId/bookings Create a booking for a spot {
spotId: 1,
userId: 1,
guests: 3,
startDate: 2023-08-23T22:58:01.518Z,
endDate: 2023-08-26T22:58:01.518Z
}
PUT /api/bookings/:bookingId Edit a booking's details {
spotId: 1,
userId: 1,
guests: 3,
startDate: 2023-08-23T22:58:01.518Z,
endDate: 2023-08-26T22:58:01.518Z
}
DELETE /api/bookings/:bookingId Delete a booking { message: 'success' }

Future Implementation Goals

  • Users can sign in with O-Auth (google, facebook, etc.)
  • Integration of google maps API with create spot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published