Benchbnb is a full-stack clone of Airbnb, designed to showcase popular bench locations in cities around the world.
In this project, I've built a web application using React, Redux, Rails API, Google Maps JavaScript API, and Active Storage. The app allows users to view and rate benches, leveraging features like maps integration and photo uploads.
- Authentication: User signup, login, and logout functionality.
- Bench Index: Display a list of benches with interactive maps.
- Bench Show: View detailed information about individual benches, including ratings.
- Reviews: Users can leave reviews for benches.
- Map Integration: Utilize Google Maps API to display bench locations.
- Photo Upload: Implement photo upload functionality using Active Storage.
- Backend Setup:
- Implemented a
User
model in Rails with attributes for authentication (e.g.,username
,email
,password_digest
). - Created RESTful API endpoints (
/api/users
for signup,/api/session
for login/logout) for user authentication, utilizingbcrypt
for password encryption.
- Implemented a
- Frontend Setup:
- Developed React components for user signup and login forms, integrating form validation and API interaction.
- Configured Redux for managing user authentication state and actions.
- Implemented Google Maps API setup and rendering on bench index and show pages.
- Added custom markers and map boundaries for a better user experience.
- Created CRUD functionality for benches, allowing users to create, edit, and delete bench listings.
- Integrated Active Storage for photo uploads associated with benches.
- Implemented review functionality, enabling users to leave reviews for benches.
- Implemented CSS styling across all pages for a cohesive user interface.
- Refactored components for improved code quality and readability.
To run BenchBnB locally, follow these steps:
-
Clone this repository
-
Install Dependencies:
-
Install backend dependencies:
bundle install
-
Install frontend dependencies:
cd frontend npm install
-
-
Set Up Your Google Maps API Key:
- Create an
env.development.local
file in the frontend directory. - Open
env.development.local
and add your API key:REACT_APP_MAPS_API_KEY=<your-copied-api-key-here>
- Create an
-
Run the Servers Concurrently:
-
Start the Rails server:
# In the root directory of the project rails s
-
Start the frontend development server:
# In the frontend directory npm start
-
Now you can access BenchBnB locally by opening your web browser and navigating to the specified localhost address for the frontend server (usually http://localhost:3000
by default).