Welcome to the Rental Agreement System frontend, a decentralized application built on the Aptos Blockchain. This platform empowers landlords and tenants to securely manage rental agreements, rent payments, security deposits, and damage deductions through smart contracts.
- Live Demo: Rental Agreement System
- Smart Contract Explorer: Aptos Explorer
- Create Rental Agreements: Landlords can create agreements with rent, security deposit, and contract duration.
- Make Rent Payments: Tenants can make rent payments using Aptos tokens (APT).
- Manage Security Deposits: Security deposits are held in smart contracts and refunded after approval.
- Propose & Approve Deductions: Landlords propose deductions for damages; tenants can approve or dispute them.
- Track Rental History: View rent payment history, deductions, and agreement status through a user-friendly interface.
- Blockchain Security: All operations are executed securely on the Aptos blockchain through smart contracts.
Ensure the following are installed:
- Node.js (v16 or higher)
- npm or yarn
- Aptos Wallet (e.g., Petra Wallet) for blockchain interactions
First, clone the project repository and navigate to the project directory:
cd rental-agreement-system
Run the following command to install all required dependencies:
npm install
Create a .env
file in the root of the project and add the following variables:
PROJECT_NAME=RentalAgreementSystem
VITE_APP_NETWORK=testnet
VITE_MODULE_ADDRESS=0x44e4bfdbe756654c954112a24d3eab079f9acf2f6ec8c64b2a8bfd7c99ec70ed
Update the VITE_MODULE_ADDRESS with the deployed contract address.
To start the development server:
npm run dev
The application will be available at http://localhost:5173
.
To deploy the smart contract:
-
Install Aptos CLI.
-
Update the Move.toml file with your wallet address:
- Add you Wallet Address from Petra here
sys_addrx = "0xca10b0176c34f9a8315589ff977645e04497814e9753d21f7d7e7c3d83aa7b57"
-
Create your new Address for Deployment
aptos init
- Add your Account addr here for Deployment
my_addrx = "6d1adc4ecf58b8d7f4cc72cca9922fd61af7078f42976f59a8e6de467d34572f"
-
Compile and publish the contract:
aptos move compile aptos move publish
Connect your Aptos Wallet (e.g., Petra Wallet) to interact with the blockchain. This allows you to create agreements, make payments, and manage deposits securely.
Landlords can:
- Navigate to the Create Agreement section.
- Enter the tenantβs wallet address, rent amount, security deposit, and contract duration.
- Submit the agreement, which will be recorded on the blockchain.
Tenants can:
- Go to My Agreements and select the agreement.
- Submit the security deposit through their connected wallet.
Tenants can pay rent by:
- Navigating to the Pay Rent section.
- Selecting the agreement and entering the payment amount.
- Confirming the payment through the wallet.
Landlords can:
- Navigate to the Deductions section.
- Select the agreement and enter the damage details and deduction amount.
- Submit the proposal for tenant approval.
Tenants can:
- View deductions in My Agreements.
- Approve or dispute deductions.
- Once approved, request the refund of the remaining deposit.
npm run dev
: Start the development server.npm run build
: Build the project for production.npm test
: Run unit tests.
- React: Library for building user interfaces.
- TypeScript: A superset of JavaScript for type-safe coding.
- Aptos SDK: JS/TS SDK for interacting with the Aptos blockchain.
- Ant Design / Tailwind CSS: For responsive UI design and layout.
- Petra Wallet Adapter: For seamless wallet connection and blockchain interaction.
- View All Rentals: Lists all created rental agreements.
- View Rental by ID: Displays details of a specific agreement.
- View Rentals by Landlord: Shows agreements created by a landlord.
- View Rentals by Tenant: Lists agreements where the tenant is involved.
- View Active Rentals: Displays ongoing rental agreements.
- View Rent Payment History: Shows rent payment history for an agreement.
- View Deductions: Displays proposed deductions for damages.
- Smart Contracts: All operations are executed securely on-chain.
- No Intermediaries: Transactions occur directly between landlords and tenants.
- Real-Time Updates: View rent history, deductions, and agreement status in real-time.
- Wallet Connection Issues: Ensure the wallet extension is installed and active.
- RPC Rate Limits: Use private RPC providers to avoid network limits.
- Transaction Errors: Verify wallet balances and permissions before transactions.
Considerations for scaling:
- Use third-party RPC providers like Alchemy or QuickNode.
- Implement request throttling to prevent overload.
- Utilize WebSockets for real-time updates.
The Rental Agreement System provides a decentralized, transparent way for landlords and tenants to manage rental contracts and payments. With secure smart contracts and real-time tracking, the platform ensures a seamless rental experience for all users.