⚠️ ALPHA SOFTWARE - This project is in active development and is considered experimental. Use at your own risk. Features may not work as expected and APIs may change without notice.
A decentralized ride-sharing application showcasing blockchain integration using the Clutch Hub SDK.
Created and maintained by Mehran Mazhar
- Store public and private keys securely
- Option to remember keys between sessions
- Visual feedback for active profile
- Interactive map to select pickup and dropoff locations
- Simple fare input
- Automatic transaction signing when keys are stored
- Visual feedback during transaction processing
- Records all ride requests (successful and failed)
- Collapsible interface to save space
- Persistent storage tied to user's public key
- Private keys are optionally stored in the browser's localStorage
- Warning is displayed about the risks of storing private keys
- Keys are never transmitted to any server except during transaction signing
- All blockchain interactions happen client-side
This application demonstrates several key blockchain principles:
- User sovereignty: Users own and control their keys
- Transparency: All transactions are recorded and visible
- No central authority: Ride requests are processed by the blockchain network
- Trustless operations: Smart contracts enforce the rules without third-party oversight
- Clone the repository
- Install dependencies with
npm install - Start the development server with
npm run dev - Visit
http://localhost:5173in your browser
- React for UI components
- Leaflet for interactive maps
- Clutch Hub SDK for blockchain interactions
The application uses the following localStorage keys:
clutchPublicKey: User's public keyclutchPrivateKey: User's private key (if "remember keys" is enabled)clutch_tx_[publicKey]: Transaction history for a specific user
The application follows blockchain best practices:
- Minimizes private key exposure
- Uses client-side signing
- Keeps transaction history for transparency
- Provides clear feedback on transaction status
clutch-hub-demo-app/
├── public/
├── src/
│ ├── components/
│ │ └── RideForm.jsx // Ride request form component
│ ├── App.jsx // Main app component
│ ├── main.jsx // React entry point
│ └── config.js // API config (e.g., export const API_URL)
├── package.json
├── vite.config.js
├── README.md
└── .gitignore
This demo app uses the published clutch-hub-sdk-js npm package from the registry.
- Configuration:
"clutch-hub-sdk-js": "^1.3.0" - Benefits: Gets latest features and fixes automatically
- Usage: Perfect for demos and development
- Configuration:
"clutch-hub-sdk-js": "1.3.1"(pinned version) - Benefits: Maximum stability, no unexpected updates
- Usage: Critical for production deployments
# Development
npm run dev # Start with latest SDK features
npm run update:sdk # Update to latest SDK version
npm run check:sdk # Check current SDK version
# Production Deployment
.\scripts\deploy-prod.ps1 # Deploy with pinned versions
.\scripts\restore-dev.ps1 # Restore development config"clutch-hub-sdk-js": "^1.3.0" // Gets: 1.3.0 → 1.x.x (latest features)"clutch-hub-sdk-js": "1.3.1" // Gets: Exactly 1.3.1 (maximum stability)"clutch-hub-sdk-js": "~1.3.1" // Gets: 1.3.1 → 1.3.x (bug fixes only)- Development: Test with
^1.3.0(latest features) - Validation: Verify everything works correctly
- Production: Pin to specific version
1.3.1 - Monitoring: Watch for new SDK releases
- Update: Test new version, then update production
- Latest Stable:
1.3.1(recommended for production) - Latest Features:
^1.3.0(recommended for development) - Canary:
@canary(bleeding edge, for testing only)
# Check available versions
npm view clutch-hub-sdk-js versions --json
# Install specific version
npm install [email protected]
# Install canary (latest features)
npm install clutch-hub-sdk-js@canaryStay true to the philosophy of decentralization and blockchain.
Mehran Mazhar
- GitHub: @MehranMazhar
- Website: MehranMazhar.com
- Email: [email protected]
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.