A comprehensive decentralized travel insurance platform built on Flow blockchain
FlowTravel is a revolutionary decentralized travel insurance platform that leverages blockchain technology to provide transparent, automated, and trustless insurance coverage for travelers worldwide. Built on Flow blockchain with support for both EVM and Cadence smart contracts.
- ๐ซ NFT-Based Policies: Each insurance policy is minted as an NFT for true ownership
- ๐ค Automated Claims: Smart contract-powered automatic claim processing
- ๐ฐ Liquidity Pools: Decentralized insurance pools with yield generation
- ๐ฎ Oracle Integration: Real-time data feeds for flight delays, weather, and more
- ๐ Analytics Dashboard: Comprehensive admin interface for pool management
- ๐ Multi-Network Support: Deploy on Flow EVM or Cadence networks
- โก Real-time Updates: Live data synchronization with Supabase
- Contract Address (Testnet):
0x5FbDB2315678afecb367f032d93F642f64180aa3 - Contract Address (Mainnet):
0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
- Contract Address (Testnet):
0x045a1763c93006ca - Contract Address (Mainnet):
0x1d7e57aa55817448
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS v4, shadcn/ui components
- Blockchain: Flow EVM & Cadence smart contracts
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Wallet Integration: Flow FCL (Flow Client Library)
- Charts: Recharts for analytics visualization
- Deployment: Vercel
- Node.js 18+ and npm/yarn/bun
- Flow CLI (for Cadence deployment)
- Hardhat (for EVM deployment)
-
Clone the repository ```bash git clone https://github.com/your-username/flowtravel-insurance.git cd flowtravel-insurance ```
-
Install dependencies ```bash npm install
bun install ```
-
Environment Setup ```bash cp .env.example .env.local ```
-
Configure environment variables ```env
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
NEXT_PUBLIC_FLOW_NETWORK=testnet NEXT_PUBLIC_FLOW_CONTRACT_TYPE=evm NEXT_PUBLIC_FLOW_WALLET_DISCOVERY=https://fcl-discovery.onflow.org/testnet/authn
NEXT_PUBLIC_FLOW_EVM_TESTNET_CONTRACT=0x5FbDB2315678afecb367f032d93F642f64180aa3 NEXT_PUBLIC_FLOW_EVM_MAINNET_CONTRACT=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 NEXT_PUBLIC_FLOW_CADENCE_TESTNET_CONTRACT=0x045a1763c93006ca NEXT_PUBLIC_FLOW_CADENCE_MAINNET_CONTRACT=0x1d7e57aa55817448 ```
-
Database Setup ```bash
npm run db:setup ```
-
Start development server ```bash npm run dev ```
Visit http://localhost:3000 to see the application.
The application uses the following main tables:
- users: User profiles and authentication
- policies: Insurance policy records
- claims: Claim submissions and processing
- pools: Insurance pool management
- oracles: Oracle data feeds and status
- transactions: Blockchain transaction records
-
Configure Hardhat ```bash
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox ```
-
Deploy to testnet ```bash npm run deploy:evm:testnet ```
-
Deploy to mainnet ```bash npm run deploy:evm:mainnet ```
-
Install Flow CLI ```bash
brew install flow-cli
sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" ```
-
Deploy to emulator ```bash npm run deploy:cadence:emulator ```
-
Deploy to testnet ```bash npm run deploy:cadence:testnet ```
- Real-time policy metrics
- Pool performance analytics
- Claims processing status
- Oracle health monitoring
- Create new travel insurance policies
- View active and expired policies
- NFT-based policy ownership
- Automated premium calculations
- Liquidity pool creation and management
- Yield farming opportunities
- Risk assessment and pricing
- Pool performance tracking
- Automated claim validation
- Oracle-based verification
- Smart contract payouts
- Claims history and analytics
- Flight delay monitoring
- Weather condition tracking
- Real-time data feeds
- Oracle reliability scoring
``` flowtravel-insurance/ โโโ app/ # Next.js app directory โ โโโ admin/ # Admin dashboard pages โ โโโ auth/ # Authentication pages โ โโโ api/ # API routes โโโ components/ # React components โโโ contracts/ # Smart contracts โ โโโ FlowTravelInsurance.cdc # Cadence contract โ โโโ FlowTravelInsuranceEVM.sol # Solidity contract โโโ lib/ # Utility libraries โ โโโ contracts/ # Contract configurations โ โโโ supabase/ # Database client โ โโโ flow/ # Flow blockchain utilities โโโ scripts/ # Deployment and utility scripts โโโ public/ # Static assets ```
```bash
npm run dev # Start development server npm run build # Build for production npm run start # Start production server
npm run db:setup # Setup database schema npm run db:seed # Seed sample data npm run db:reset # Reset database
npm run deploy:evm:testnet # Deploy EVM contract to testnet npm run deploy:evm:mainnet # Deploy EVM contract to mainnet npm run deploy:cadence:emulator # Deploy Cadence to emulator npm run deploy:cadence:testnet # Deploy Cadence to testnet
npm run lint # Run ESLint npm run type-check # TypeScript type checking ```
GET /api/policies- List all policiesPOST /api/policies- Create new policyGET /api/policies/[id]- Get policy detailsPUT /api/policies/[id]- Update policy
GET /api/claims- List all claimsPOST /api/claims- Submit new claimPUT /api/claims/[id]- Update claim status
GET /api/pools- List insurance poolsPOST /api/pools- Create new poolGET /api/pools/[id]/performance- Pool analytics
- Smart Contract Auditing: Contracts follow best practices and security patterns
- Access Control: Role-based permissions for admin functions
- Data Encryption: Sensitive data encrypted at rest and in transit
- Oracle Security: Multiple oracle sources for data verification
- Wallet Security: Non-custodial wallet integration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Flow Documentation
- Discord: Flow Discord Community
- Issues: GitHub Issues