Skip to content

OSEH-svg/lifedrops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project Lifedrops

Lifedrops is an open-source platform that enables lactating mothers to donate breastmilk safely and securely while earning Bitcoin rewards. What comes naturally to women shouldn't be undervalued. Breast milk is life-saving, and we're here to make sure it's celebrated, not stigmatized.

At LifeDrops, we believe women should be able to earn from something so natural, while supporting babies and families who need it most.

By partnering with certified hospitals and rewarding donors in sats, we ensure safety, transparency, and dignity in breast milk donation.

LifeDrops is more than a platform. It is a movement to normalize giving, earning, and saving lives through the most natural gift of all.

Note: This project is built as a minimal viable product (MVP).


🌟 Features

For Donors

  • πŸ’° Dashboard with SAT Balance: View real-time balance in SAT (Satoshis) and approximate USD value
  • ⚑ Lightning Withdrawals: Withdraw earnings directly to personal Bitcoin Lightning wallet via Bitnob
  • πŸ“Š Donation History: Track all past donations with status, volume, and payment details
  • πŸ† Achievements & Gamification: Earn badges for completing milestones (First Drop, Quality Champion, Emergency Hero)
  • πŸ“… Schedule Donations: Easily schedule upcoming donations with hospital, time, and location
  • πŸ”’ Anonymous Donor IDs: Privacy-first approach with anonymous identification
  • πŸ₯ Hospital Verification: All donations verified by certified hospital partners

Platform Features

  • πŸ“± Responsive Design: Works seamlessly on mobile, tablet, and desktop
  • 🎨 Modern UI/UX: Beautiful, intuitive interface with smooth animations
  • πŸ” Secure Authentication: User login and registration system
  • πŸ’³ Lightning Network Integration: to enable fast bitcoin payments

πŸ— MVP Architecture

The system uses Next.js 14 for frontend and backend (API routes), with Bitnob API as the Lightning Network service provider.

graph TD
  A[Donor Dashboard] -->|Clicks Withdraw| B[Next.js API Route]
  B -->|POST /api/lightning/withdraw| C[Bitnob Lightning API]
  C -->|Lightning Network| D[Donor's Personal Wallet]
  D -->|Payment Confirmed| C
  C -->|Response| B
  B -->|Update UI| A[Balance Updated to 0]
  
  E[Hospital] -->|Verifies Donation| F[Creates Lightning Invoice]
  F -->|Payment| G[Bitnob Receives]
  G -->|Webhook| H[/api/webhooks/bitnob]
  H -->|Update Database| I[Donor Balance Increased]
  I -->|Real-time Update| A
Loading

Payment Flow

  1. Hospital Verification: Hospital verifies milk donation (quality, volume)
  2. Payment Creation: Hospital creates Lightning invoice via Bitnob
  3. Lightning Settlement: Payment settles instantly on Lightning Network
  4. Webhook Notification: Bitnob sends webhook to backend
  5. Balance Update: Donor's balance updated in real-time
  6. Dashboard Refresh: UI shows new balance automatically

πŸš€ Tech Stack

Frontend

  • Next.js 14 (App Router)
  • React 18
  • TypeScript
  • Tailwind CSS
  • Lucide Icons

Backend

  • Next.js API Routes
  • Axios (HTTP client)
  • Bitnob Lightning API

Payment Infrastructure

  • Bitnob

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ and npm/yarn
  • Bitnob account and API keys
  • Git

Steps

  1. Clone the repository
git clone https://github.com/yourusername/lifedrops.git
cd lifedrops
  1. Install dependencies
npm install
# or
yarn install
  1. Set up environment variables

Create a .env.local file in the root directory:

# Bitnob API Configuration
BITNOB_API_KEY=your_api_key_here
BITNOB_SECRET_KEY=your_secret_key_here
BITNOB_WEBHOOK_SECRET=your_webhook_secret_here

# App Configuration
NEXT_PUBLIC_API_URL=http://localhost:3000
  1. Run the development server
npm run dev
# or
yarn dev
  1. Open your browser Navigate to http://localhost:3000

πŸ”§ Configuration

Bitnob Setup

  1. Create Bitnob Account: Sign up at bitnob.com
  2. Generate API Keys: Navigate to Settings β†’ API Keys
  3. Configure Webhook: Set webhook URL to https://yourdomain.com/api/webhooks/bitnob
  4. Fund Wallet: Add test sats to your Bitnob wallet for testing withdrawals

Environment Variables

Variable Description Required
BITNOB_API_KEY Your Bitnob API key Yes
BITNOB_SECRET_KEY Your Bitnob secret key Yes
BITNOB_WEBHOOK_SECRET Webhook verification secret Yes
NEXT_PUBLIC_API_URL Your app's base URL Yes

πŸ“± Usage

For Donors

  1. Sign Up: Create an account and receive your anonymous donor ID
  2. View Dashboard: See your SAT balance and donation history
  3. Schedule Donation: Book appointments with partner hospitals
  4. Complete Donation: Visit hospital and donate milk
  5. Receive Payment: Balance updates automatically after hospital verification
  6. Withdraw Earnings: Cash out to your Lightning wallet anytime

Withdrawal Process

  1. Click "Withdraw" button on dashboard
  2. Enter your Lightning address (e.g., donor@bitnob.com)
  3. Confirm withdrawal amount
  4. Sats sent instantly via Lightning Network
  5. Balance updates to reflect withdrawal

πŸ”Œ API Endpoints

Lightning Endpoints

Create Invoice (Hospital Use)

POST /api/lightning/create-invoice
Content-Type: application/json

{
  "amount": 10000,
  "description": "Donation payment for 150ml",
  "donorId": "1BvBMxxxxnVVN2",
  "donationId": "don_123"
}

Withdraw to Lightning

POST /api/lightning/withdraw
Content-Type: application/json

{
  "lightningAddress": "donor@bitnob.com",
  "amount": 10242,
  "donorId": "1BvBMxxxxnVVN2"
}

Get Balance

GET /api/lightning/balance

Webhook Endpoint

POST /api/webhooks/bitnob
X-Bitnob-Signature: <signature>

{
  "event": "invoice.paid",
  "invoice": {
    "id": "inv_123",
    "amount": 10000,
    "status": "paid",
    "metadata": {
      "donor_id": "1BvBMxxxxnVVN2",
      "donation_id": "don_456"
    }
  }
}

🎯 Roadmap

Phase 1: MVP (Current)

  • βœ… Basic dashboard with balance display
  • βœ… Lightning withdrawal integration
  • βœ… Donation history tracking
  • βœ… Authentication system
  • βœ… Responsive design

Phase 2: Enhanced Features

  • ⏳ Real-time notifications
  • ⏳ Mobile app (React Native)
  • ⏳ Hospital admin dashboard
  • ⏳ Advanced analytics
  • ⏳ Multi-language support

Phase 3: Scale

  • ⏳ Database integration (PostgreSQL/MongoDB)
  • ⏳ Email notifications
  • ⏳ SMS reminders
  • ⏳ Referral program
  • ⏳ Community features

🀝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with πŸ’ for mothers and babies everywhere

About

Give life, Gain value

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages