RideChain is a decentralized cab app built using React Native with Expo for the frontend, and Next.js with Solidity on the Ethereum blockchain for the backend. This project aims to provide a decentralized, trustless, and efficient platform for cab services.
- Backend hosted at Link
- Contract Deployed at sepolia test net at address 0x256A8E43D1ED57D2E19a818960ba3089D457b8cb
- Introduction
- Features
- Technologies Used
- Getting Started
- Project Structure
- Smart Contracts
- API Endpoints
- Contributing
- License
- Acknowledgements
RideChain is a decentralized application (dApp) for cab services, leveraging the power of blockchain technology to ensure transparency, security, and efficiency. By using Ethereum smart contracts, RideChain eliminates the need for intermediaries, allowing direct interaction between drivers and passengers.
- Decentralized booking and payment system
- Secure and transparent transactions using Ethereum blockchain
- Real-time ride tracking
- User authentication and profile management
- Rating and review system for drivers and passengers
-
Frontend:
- React Native
- Expo
-
Backend:
- Next.js
- Solidity
- Ethereum blockchain
-
Others:
- Web3.js
- IPFS for decentralized storage
- Node.js and npm installed
- Expo CLI installed
- Metamask extension for Ethereum transactions
- Truffle or Hardhat for smart contract development
-
Clone the repository:
git clone https://github.com/yourusername/RideChain.git cd RideChain
-
Install frontend dependencies:
cd frontend npm install
-
Install backend dependencies:
cd ../backend npm install
-
Start the Expo development server:
cd frontend expo start
-
Deploy the smart contracts:
cd ../contracts truffle migrate --network development
-
Start the Next.js server:
cd ../backend npm run dev
RideChain/
├── frontend/ # React Native Expo app
├── backend/ # Next.js API server
├── web3/ # Solidity smart contracts
└── README.md # Project README file
The smart contracts for RideChain are written in Solidity and manage the core functionality of the app, including:
- Booking management
- Payment processing
- User authentication
To deploy the smart contracts, use Truffle or Hardhat. Ensure you have a local Ethereum node running or use a service like Infura.
truffle migrate --network development
Use Web3.js to interact with the deployed contracts in your frontend and backend code.
The Next.js backend provides several API endpoints for interacting with the app:
- POST /api/register - Register a new user
- POST /api/book - Book a ride
- GET /api/rides - Get ride history
- POST /api/review - Submit a review
We welcome contributions to RideChain! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes.
- Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize the README further based on your specific project details and requirements.