https://groundbnb.onrender.com
Welcome to GroundBnb, The Airbnb clone all about saving you money with underground deals. Caves and little known hole in the wall, ...err ground.
This is an Airbnb clone designed to allow similar options to the original. It currently feature 2 major crud for rental Spots and Reviews for those spots.
Groundbnb is currently in development and does not have is does not include all the functionality the contributors intend to add. The functions that Groundbnb currently has:
-
LogIn
using any of the included demo user accounts -
SignUp
from the signup modal and create your own account -
Create a
Spot
that you would like to post to Groundbnb for other users to see and leave aReview
on -
Navigate to any
Spot
posted to Groundbnb to see that spot's details -
Edit any
Spot
the logged in user has created -
Delete any
Spot
the logged in user created -
See all
Spots
created by the current user -
See all
Reviews
created by the current user -
Create an
Review
for aSpot
created by another user -
Delete any
Review
posted by the logged in user
#Set Up:
While we recommend using the live version hosted on render, (https://groundbnb.onrender.com)
If you really want to get started and using this locally you will want to run
git clone https://github.com/Alugibihl/AirBnb-Clone.git
cd into the containing folder, and run
npm install to install related dependencies.
cd into the backend file and create a .env file with a port.
PORT=(your port)
DB_FILE=(db file) we recommend db/dev.db
JWT_SECRET=(generate a secret)
JWT_EXPIRES_IN=(assign an expiration)
SCHEMA=(give it a schema).
then run npm install followed by,
npx dotenv sequelize db:migrate
npx dotenv sequelize db:seed:all.
Then run npm start,
CD into your front end folder and run
npm install
and then NPM start.
If you see something similar to the image at the top, you are ready to go.
HTTP Verbs | Endpoints | Action | Return Value |
---|---|---|---|
POST | /api/user/signup | To sign up a new user account | { id: #, username: '...', email: '...', password: '...' } as JSON |
POST | /api/user/login | To login an existing user account | { id: #, username: '...', email: '...', password: '...' } as JSON |
POST | /api/spots | To create a new spot | { Spots: [ {id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng: "...", name: "...", description: "...", price: #, createdAt: "...", updatedAt: "...", avgRating: "...", previewImage: "..."}, {}] } as JSON |
POST | /api/spots/:spotId/images | To create a new spot image | id: #, url: "...", preview: bool} |
POST | /api/spots/:spotId/reviews | To create a new review for a spot | { id: #, spotId: #, userId: #, review: "...", stars: #, "createdAt": "...", "updatedAt": "...", User: { id: #, firstName: "...", lastName: "..." } as JSON |
POST | /api/spots/:spotId/bookings | To create a new booking for a spot | { id: #, spotId: #, userId: #, startDate: "...", endDate: "...", "createdAt": "...", "updatedAt": "..." } as JSON |
POST | /api/reviews/:reviewId/images | To create a new image for a review | {"id": #, "url": "..."} as JSON |
GET | /api/spots/:spotId | To retrieve spots by id | {id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng: "...", name: "...", description: "...", price: #, createdAt: "...", updatedAt: "...", numReviews: #, Owner: {}, avgStarRating: "...", spotImages:[] } as JSON |
GET | /api/user/session | Gets the current User | { id: #, username: '...', email: '...', password: '...' } as JSON |
GET | /api/spots | To retrieve all spots | { Spots: [ {id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng: "...", name: "...", description: "...", price: #, createdAt: "...", updatedAt: "...", avgRating: "...", previewImage: "..."}, {}] } as JSON |
GET | /api/spots/current | To retrieve all spots of current user | { Spots: [ {id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng: "...", name: "...", description: "...", price: #, createdAt: "...", updatedAt: "...", avgRating: "...", previewImage: "..."}, {}] } as JSON |
GET | /api/reviews/current | To retrieve all reviews of current user | Reviews: [ { id: #, spotId: #, userId: #, review: "...", stars: #, "createdAt": "...", "updatedAt": "...", User: { id: #, firstName: "...", lastName: "..." }, Spot: id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng "...", name: "...", price: #, previewImage: "..."}, ReviewImages: [] }, {}] }, as JSON |
GET | /api/bookings/current | To retrieve all bookings of current user | Bookings: [ { id: #, spotId: #, userId: #, startDate: "...", endDate: "...", "createdAt": "...", "updatedAt": "...", Spot: id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng "...", name: "...", price: #, previewImage: "..."} }, {}] }, as JSON |
GET | /api/spots/:spotId/reviews | To retrieve all reviews of a spot | Reviews: [ { id: #, spotId: #, userId: #, review: "...", stars: #, "createdAt": "...", "updatedAt": "...", User: { id: #, firstName: "...", lastName: "..." }, Spot: id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng "...", name: "...", price: #, previewImage: "..."}, ReviewImages: [] }, {}] }, as JSON |
GET | /api//:spotId/bookings | To retrieve all bookings of a spot | Bookings: [ { id: #, spotId: #, userId: #, startDate: "...", endDate: "...", "createdAt": "...", "updatedAt": "...", Spot: id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng "...", name: "...", price: #, previewImage: "..."} }, {}] }, as JSON |
PUT | /api/spots/:spotId | To edit the details of a single spot | {id: #, ownerId: #, address: "...", city: "...", state: "...", country: "...", lat: "...", lng: "...", name: "...", description: "...", price: #, createdAt: "...", updatedAt: "...", numReviews: #, Owner: {}, avgStarRating: "...", spotImages:[] } as JSON |
PUT | /api/reviews/:reviewId | To edit the details of a single review | { id: #, spotId: #, userId: #, review: "...", stars: #, "createdAt": "...", "updatedAt": "...", User: { id: #, firstName: "...", lastName: "..." } as JSON |
PUT | /api/bookings/:bookingId | To edit the details of a single booking | { id: #, spotId: #, userId: #, startDate: "...", endDate: "...", "createdAt": "...", "updatedAt": "..." } as JSON |
DELETE | /api/spots/:spotId | To delete a single spot | None |
DELETE | /api/spot-images/:imageId | To delete a single spot image | None |
DELETE | /api/reviews/:reviewId | To delete a single review | None |
DELETE | /api/review-images/:imageId | To delete a single review's image | None |
I want to grow along with this project, if you have any suggestions, or want to contribute..
Reach out to me at:
GitHub: https://github.com/Alugibihl
LinkedIn: https://www.linkedin.com/in/alexander-lugibihl-2abb70169
These are some of the great resources that made this possible.
-Font Awesome
-Helmet
-BCrypt
-Morgan