https://github.com/kunaldhongade/aptos-micro-insurance-products
Micro insurance is a type of insurance designed to be affordable for low-income individuals or groups, providing coverage for specific risks such as health, life, or property
https://github.com/kunaldhongade/aptos-micro-insurance-products
aptos aptos-move aptos-sdk move react typescript
Last synced: about 2 months ago
JSON representation
Micro insurance is a type of insurance designed to be affordable for low-income individuals or groups, providing coverage for specific risks such as health, life, or property
- Host: GitHub
- URL: https://github.com/kunaldhongade/aptos-micro-insurance-products
- Owner: kunaldhongade
- License: apache-2.0
- Created: 2024-10-08T12:37:22.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-19T08:32:28.000Z (7 months ago)
- Last Synced: 2025-02-04T19:18:09.451Z (3 months ago)
- Topics: aptos, aptos-move, aptos-sdk, move, react, typescript
- Language: TypeScript
- Homepage: https://aptos-micro-insurance-products-orcin.vercel.app
- Size: 719 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Micro-Insurance System - Frontend
Welcome to the **Micro-Insurance System** frontend, a decentralized application built on the **Aptos Blockchain**. This platform enables users to purchase micro-insurance policies, request claims, and receive payouts seamlessly through secure smart contracts. Policy creators can manage insurance policies, verify claims, and ensure quick payouts for customers.
---
## π Links
- **Live Demo**: [Micro-Insurance System](https://aptos-micro-insurance-products-orcin.vercel.app/)
- **Smart Contract Explorer**: [Aptos Explorer](https://explorer.aptoslabs.com/account/0x2abb1ab290cb828323bf6da71a3f36011d59cd7aa576474f19dbcae50521e056/modules/code/MicroInsuranceSystem?network=testnet)---
## β¨ Key Features
- **Browse Insurance Policies**: Users can explore available policies and their details, including premiums and claim amounts.
- **Purchase Policies**: Customers can buy policies using Aptos native tokens (**APT**) via integrated wallets.
- **Submit Claim Requests**: Users can request claims on active policies when necessary.
- **Verify and Payout Claims**: Policy creators review claims and process payouts directly through the blockchain.
- **Policy Management**: Policy creators can add, manage, and verify customer policies and requests with ease.
- **Blockchain Transactions**: All policy transactions, purchases, and payouts are securely handled via smart contracts on the Aptos blockchain.---
## π Prerequisites
Ensure you have the following installed:
- **Node.js** (v16 or higher)
- **npm** or **yarn**
- **Aptos Wallet** (e.g., **Petra Wallet**) for blockchain interactions---
## βοΈ Setup Instructions
### 1. Clone the Repository
Clone the project repository to your local machine and navigate to the project folder:
```bash
cd micro-insurance-system
```### 2. Install Dependencies
Install the required dependencies:
```bash
npm install
```### 3. Configure Environment Variables
Create a `.env` file in the project root and add the following configuration:
```bash
PROJECT_NAME=MicroInsuranceSystem
VITE_APP_NETWORK=testnet
VITE_MODULE_ADDRESS=0x2abb1ab290cb828323bf6da71a3f36011d59cd7aa576474f19dbcae50521e056
```Replace `` with the address where your smart contract is deployed.
### 4. Run the Development Server
To start the project in development mode:
```bash
npm run dev
```The app will be available at `http://localhost:5173`.
### 5. Deploy the Smart Contract
To deploy the smart contract:
1. Install **Aptos CLI**.
2. Update the **Move.toml** file with your wallet address:- Add you Wallet Address from Petra here
```bash
sys_addrx = "0xca10b0176c34f9a8315589ff977645e04497814e9753d21f7d7e7c3d83aa7b57"
```- Add your Account addr here for Deployment
```bash
my_addrx = "2abb1ab290cb828323bf6da71a3f36011d59cd7aa576474f19dbcae50521e056"
```3. Create your new Address for Deployment
```bash
aptos init
```4. Compile and publish the contract:
```bash
aptos move compile
aptos move publish
```---
## π How to Use the Platform
### 1. Connect Wallet
When the application opens, connect your Aptos wallet (e.g., Petra Wallet) to interact with the platform. This allows you to buy policies, submit claims, and receive payouts seamlessly.
### 2. Browse Insurance Policies
Navigate to the **Policies** section to view available policies. Each policy lists the following details:
- Policy description
- Premium amount
- Maximum claimable amount
- Payment type (one-time or yearly)
- Policy creator information### 3. Purchase Policy
To buy a policy:
- Select the desired policy.
- The platform will prompt you to pay the premium in **APT** through your connected wallet.
- After purchase, the policy will be listed under **My Policies**.### 4. Request Insurance Claim
To file a claim:
- Go to the **My Policies** section and choose the policy.
- Click on **Request Claim** to initiate the claim request.
- The claim will be sent to the policy creator for verification.### 5. Claim Verification and Payout
For policy creators:
- Navigate to the **Manage Policies** section to review incoming claims.
- Select the relevant policy and verify the claim.
- Once verified, the payout will be automatically transferred to the customerβs wallet using the predefined claim amount.---
## π Scripts
- **`npm run dev`**: Start the development server.
- **`npm run build`**: Build the project for production.
- **`npm test`**: Run tests to ensure the project works as expected.---
## π Dependencies
- **React**: UI library for building user interfaces
- **TypeScript**: Typed JavaScript for better development experience
- **Aptos SDK**: SDK for blockchain interaction
- **Ant Design / Tailwind CSS**: Modern and responsive UI components
- **Petra Wallet Adapter**: Wallet integration for the Aptos blockchain---
## π Available View Functions
- **View All Policies**: Lists all available insurance policies.
- **View Policies by Creator**: Displays all policies created by a specific business.
- **View User Claims**: Shows all submitted claims by a customer.
- **View Claim Requests**: Lists all pending claim requests for verification.---
## π‘ Security and Transparency
- **Smart Contracts**: All transactions are processed securely on the blockchain.
- **No Intermediaries**: Payments and claims are managed directly between the users and policy creators.
- **Real-Time Tracking**: Users can monitor policy purchases and claim statuses in real-time.---
## π Common Issues and Solutions
1. **Wallet Connection Issues**: Ensure your Aptos wallet (e.g., Petra) is installed and connected.
2. **RPC Rate Limits**: Use **private RPC providers** to avoid rate-limited public nodes.
3. **Transaction Failures**: Check wallet permissions and ensure sufficient funds are available for transactions.---
## π Scaling and Deployment
If deploying on **Vercel** or similar platforms:
- Use **third-party RPC providers** such as **Alchemy** or **QuickNode**.
- Implement **request throttling** to handle high traffic efficiently.
- Use **WebSockets** for real-time updates to improve user experience.---
## π Conclusion
The **Micro-Insurance System** provides a decentralized and transparent way to manage insurance policies, claims, and payouts. With secure smart contracts and easy-to-use features, businesses and customers can seamlessly interact on the Aptos blockchain. This platform offers an efficient way to handle micro-insurance, ensuring trust and transparency for all participants.