Subscribe to Continue Downloading

Redirecting...
Decentralized Apartment Rentals 副本 - Decentralized Apartment Rentals: An Ethereum Smart Contract Solution

Decentralized Apartment Rentals: An Ethereum Smart Contract Solution

by Dung AIin , on August 20, 2024

Choose Your Desired Option(s)

Decentralized Apartment Rentals: An Ethereum Smart Contract Solution

House Rental Marketplace

The DappBnb project is a decentralized application built on the Ethereum blockchain. It serves as a rental marketplace where users can list, book, and review apartments. The project is centered around a smart contract written in Solidity, known as DappBnb.sol. To ensure secure and standardized development, it utilizes the OpenZeppelin library.

The core functionality of the contract is structured around three primary components: ApartmentStruct, representing an apartment; BookingStruct, representing a booking; and ReviewStruct, representing a review.

 

Decentralized Apartment Rentals 副本 - Decentralized Apartment Rentals: An Ethereum Smart Contract Solution

Key Features

  • createApartment: Enables a user to create a new apartment listing.
  • updateApartment: Allows the apartment owner to update the details of an existing apartment.
  • deleteApartment: Permits the apartment owner to remove an apartment listing.
  • getApartments: Lets users retrieve a list of all available apartments.
  • getApartment: Allows a user to view details of a specific apartment.
  • bookApartment: Enables a user to book an apartment for selected dates.
  • checkInApartment: Permits a tenant to check into an apartment and initiates the payment process.
  • claimFunds: Allows the apartment owner to claim funds after a booking is finalized.
  • refundBooking: Lets a tenant cancel a booking and receive a refund.
  • getUnavailableDates: Enables a user to view all booked dates for a particular apartment.
  • getBookings: Allows a user to retrieve all bookings for a specific apartment.
  • getBooking: Provides a user with the details of a specific booking.
  • addReview: Allows a tenant to leave a review for an apartment.
  • getReviews: Enables a user to view all reviews for a particular apartment.

 

Running the Application

Supply the following keys in your .env variable:

NEXT_PUBLIC_RPC_URL=http://127.0.0.1:8545
NEXT_PUBLIC_ALCHEMY_ID=<YOUR_ALCHEMY_PROJECT_ID>
NEXT_PUBLIC_PROJECT_ID=<WALLET_CONNECT_PROJECT_ID>
NEXTAUTH_URL=http://localhost:3001
NEXTAUTH_SECRET=somereallysecretsecret
 

YOUR_ALCHEMY_PROJECT_ID: Get Key Here WALLET_CONNECT_PROJECT_ID: Get Key Here

Follow these steps to run the application:

  1. Install the package modules by running the command: yarn install
  2. Start the Hardhat server: yarn blockchain
  3. Run the contract deployment script: yarn deploy
  4. Run the contract seeding script: yarn seed
  5. Spin up the Next.js development server: yarn dev

Now, your application should be up and running.

 

1 副本 - Decentralized Apartment Rentals: An Ethereum Smart Contract Solution

📚 Key Technologies

  • 🌐 Next.js: A React framework for building server-side rendered and static websites.
  • 📘 TypeScript: A statically typed superset of JavaScript.
  • 📦 Hardhat: A development environment for Ethereum smart contracts.
  • 🌐 EthersJs: A library for interacting with Ethereum and Ethereum-like blockchains.
  • 📚 Redux-Toolkit: A library for managing application state.
  • 🎨 Tailwind CSS: A utility-first CSS framework.

Useful links

Download Category ,
Product Version
File Type JS
File Size 4.95 MB
Developer
Documentation

Release Information

  • Released
    :

    August 20, 2024

  • Last Updated
    :

    August 20, 2024

  • Categories
    :
  • File Included
    :

    JS

  • File Size
    :

    4.95 MB

Share Your Valuable Opinions

You must log in to submit a review.

  • Sign up
Password Strength Very Weak
Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
We do not share your personal details with anyone.

Please wait a moment...

(Don't refresh or go back)