A decentralized peer-to-peer car rental mobile app built with React Native (Expo) and Filecoin FEVM, using stablecoin payments (USDFC).
Owners (Lenders) mint car NFTs and pay storage fees; renters book & pay in USDFC. All media (photos, videos, logs) lives on IPFS/Filecoin via Web3.Storage.
Your phone acts as a DePIN node.
- Car NFTs: Mint and list cars as ERC‑721 tokens on Filecoin FEVM.
- Stablecoin Payments: All fees (listing, rental) paid in USDFC for predictable, USD‑pegged billing.
- Decentralized Storage: Car metadata and rental logs stored on IPFS/Filecoin via Web3.Storage (or Lighthouse).
- Rental Workflow: Approve & pay rental fee, automated escrow, and on-chain settlement to owner.
- Log Uploads: Renters can upload trip videos, damage photos, or receipts with on-chain CID tracking.
- Owner Dashboard: Withdraw collected USDFC, view listings & rental history.
- In-app Chat: Renters and owners can coordinate via built-in chat.
- Map-based Discovery: Find cars near you using an interactive map.
- Wallet, Email & Civic Auth: Authenticate with AppKit (by Reown) for seamless wallet connection, email login, or Civic Auth (OIDC/OAuth2).
- DePIN Node: Your phone acts as a decentralized infrastructure node, enabling true peer-to-peer rentals.
0x022FC1A0058321b5d6ceDD82fFf027256aA59EaA
| Layer | Technology |
|---|---|
| Frontend | React Native (Expo) |
| Wallet Integration | AppKit (by Reown, wagmi & viem) |
| Storage Onramp | Web3.Storage / Lighthouse |
| Blockchain | Filecoin FEVM (Calibration Testnet) |
| Smart Contracts | Solidity (OpenZeppelin, ERC‑721) |
| Stablecoin | USDFC (ERC‑20) |
| State Management | React Context |
| UI Styling | Tailwind CSS via nativewind |
| Data Fetching | @tanstack/react-query |
- Node.js ≥ 16, npm or Yarn
- Expo CLI (
npm install -g expo-cli) - MetaMask Mobile or AppKit-compatible wallet
- Filecoin Calibration tFIL & tUSDFC in your test wallet
- Hardhat or Remix to deploy smart contracts
- Clone the repo
git clone https://github.com/raveesh146/PeerCar.git cd PeerCar - Install dependencies
npm install
- Add polyfills (in
./app/_layout.tsx):import "react-native-url-polyfill/auto"; import { Buffer } from "buffer"; global.Buffer = Buffer; import process from "process"; global.process = process;
- Environment Variables: Create a
.envfile at project root:EXPO_PUBLIC_RPC_URL=https://api.calibration.node.glif.io/rpc/v1 EXPO_PUBLIC_CHAIN_ID=314159 EXPO_PUBLIC_USDFC_ADDRESS=<USDFC_TOKEN_ADDRESS> EXPO_PUBLIC_CONTRACT_ADDRESS=<CarRental_CONTRACT_ADDRESS> EXPO_PUBLIC_LISTING_FEE=<LISTING_FEE_IN_USDFC_UNITS> WEB3STORAGE_TOKEN=<YOUR_WEB3STORAGE_API_TOKEN> # Civic Auth integration EXPO_PUBLIC_CIVIC_AUTH_URL=https://auth.civic.com/oauth EXPO_PUBLIC_APP_SCHEME=civicauthmobile EXPO_PUBLIC_CLIENTID=<YOUR_CIVIC_CLIENT_ID>
- Run the app
Scan the QR code with Expo Go or run on simulator/emulator.
expo start
- Open
contracts/CarRental.soland confirm constructor args:USDFC_TOKEN_ADDRESSlistingFee
- Compile & deploy to Calibration testnet (chainId 314159) via Hardhat or Remix.
- Copy deployed contract address into
.envasEXPO_PUBLIC_CONTRACT_ADDRESS.
├── app/
│ ├── config/
│ │ └── wallet.ts
│ ├── contexts/
│ │ ├── CarDataContext.tsx
│ │ └── WalletContext.tsx
│ ├── _layout.tsx
│ ├── auth.tsx
│ ├── car-listing.tsx
│ ├── chat.tsx
│ ├── home.tsx
│ ├── index.tsx
│ ├── marketplace.tsx
│ ├── rental-flow.tsx
│ └── renter-map.tsx
├── assets/
│ ├── fonts/
│ └── images/
├── contracts/
│ ├── abi.ts
│ └── CarRental.sol
├── metadata/
│ └── metadata/
│ └── honda-civic.json
├── app.json
├── babel.config.js
├── eas.json
├── eslint.config.js
├── index.js
├── package.json
├── package-lock.json
├── tsconfig.json
├── LICENSE.md
└── README.md
- NFTs: Each car is an ERC-721 NFT. Metadata and logs are stored as CIDs on IPFS.
- Smart Contract: Handles minting, listing, renting, and log uploads.
- Storage: All car data, images, and logs are pinned to IPFS via Web3.Storage.
- Wallet Integration: AppKit provides a unified wallet connection experience for users, abstracting away direct WalletConnect or MetaMask integration.
- Stablecoin Payments: All payments and fees are in USDFC (ERC-20), ensuring predictable, USD-pegged billing.
- DePIN Node: Your phone acts as a decentralized infrastructure node, enabling true peer-to-peer rentals.
- Connect wallet (via AppKit).
- Navigate to Marketplace → List New Car.
- Fill in car details & price per day.
- Approve
listingFeeUSDFC and confirm. - Images and documents are uploaded to IPFS/Filecoin; metadata CID is minted as NFT.
- Browse listed cars.
- Select car & choose rental duration.
- Approve
price × daysUSDFC and confirm. - Rental is processed on-chain; payment is handled via wallet.
- Upload trip logs (optional) after rental. Each log is uploaded to IPFS and the CID is recorded on-chain via
uploadLog(carId, cid).
- View your listed cars, rental history, and withdraw collected USDFC.
- Coordinate with renters/owners via chat.
- Use the map to find cars near your location.
- ERC-721 NFT: Each car is a unique NFT
- Key Functions:
mintCar(carId, metadataCID)— Mint a new car NFT with metadata CIDlistCar(carId)— List a car for rentrentCar(carId, duration)— Rent a car for a perioduploadLog(carId, cid)— Upload a rental log (CID)getLogs(carId)— View all log CIDs for a car
- Events: CarMinted, CarListed, CarRented, LogUploaded
- Stablecoin Integration: All payments are in USDFC (ERC-20). Listing and rental fees are enforced on-chain.
{
"name": "Honda Civic 2021",
"description": "Available for rent in Delhi. Well maintained.",
"image": "ipfs://bafybeib123.../civic.jpg",
"attributes": [
{ "trait_type": "Location", "value": "Delhi" },
{ "trait_type": "Availability", "value": "Yes" },
{ "trait_type": "Fuel Type", "value": "Petrol" },
{ "trait_type": "Transmission", "value": "Automatic" }
]
}- Add retrieval‑fee logic for pay‑per‑download.
- Integrate access control & encryption (Lighthouse).
- Build on mainnet with gas sponsorship or paymaster.
- Enhance UI: reviews, ratings, calendar availability.
See LICENSE.md for details. This project is strictly for hackathon evaluation and may not be reused, copied, or resubmitted elsewhere without explicit written consent.
For questions, feedback, or collaboration, contact: Raveesh Gulati (raveeshgulati15@gmail.com)





