Skip to content

A creator monetization platform for receiving tips, and managing withdrawals seamlessly.

Notifications You must be signed in to change notification settings

DevAdedeji/tipcup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° TipCup

A modern creator monetization platform for receiving tips, setting fundraising goals, and managing withdrawals seamlessly.

Nuxt Vue Firebase Flutterwave


🌟 Features

For Creators

  • βœ… Custom Profile Pages - Personalized pages with your username (e.g., tipcup.adedeji.xyz/yourname)
  • βœ… Fundraising Goals - Set and track progress toward financial goals
  • βœ… Multiple Support Tiers - Create custom tip amounts with emojis and descriptions
  • βœ… Bank Account Management - Add multiple bank accounts, set primary accounts
  • βœ… Automated Withdrawals - Instant withdrawals to Nigerian bank accounts via Flutterwave
  • βœ… Earnings Dashboard - Track total earnings, current balance, and transaction history
  • βœ… Withdrawal History - Complete audit trail of all payouts

For Supporters

  • βœ… Quick & Easy Payments - Support creators with just a few clicks
  • βœ… Secure Transactions - Powered by Flutterwave's secure payment gateway
  • βœ… Custom Messages - Send personalized messages with your tips
  • βœ… Goal Contributions - Help creators reach their fundraising goals

πŸ› οΈ Tech Stack

Frontend

Backend

Payment Processing

  • Flutterwave - Payment gateway and transfers
    • Payment initialization & verification
    • Bank account resolution
    • Automated transfers/withdrawals
    • Webhook handling

πŸ“‹ Prerequisites

Before you begin, ensure you have:


πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/devadedeji/tipcup.git
cd tipcup

2. Install Dependencies

npm install
# or
yarn install

3. Environment Configuration

Create a .env file in the root directory:

# Firebase Configuration
FIREBASE_API_KEY=your_firebase_api_key
FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_STORAGE_BUCKET=your_project.appspot.com
FIREBASE_MESSAGING_SENDER_ID=your_sender_id
FIREBASE_APP_ID=your_app_id

# Firebase Admin SDK (Server-side)
FIREBASE_SERVICE_ACCOUNT={"type":"service_account","project_id":"..."}

# Flutterwave
FLUTTERWAVE_SECRET_KEY=your_flutterwave_secret_key
FLUTTERWAVE_SECRET_HASH=your_webhook_secret_hash

πŸ“˜ Note: Get your Firebase Service Account JSON from Firebase Console β†’ Project Settings β†’ Service Accounts β†’ Generate New Private Key

4. Configure Firestore Security Rules

Copy the security rules from firestore_rules.md artifact and apply them in Firebase Console:

  1. Go to Firestore Database β†’ Rules
  2. Paste the rules
  3. Publish

5. Create Firestore Indexes

Create a composite index for payments:

  • Collection: payments
  • Fields: toUserId (Ascending), createdAt (Descending)

Create a composite index for withdrawals:

  • Collection: withdrawals
  • Fields: userId (Ascending), createdAt (Descending)

6. Run Development Server

npm run dev

Visit http://localhost:4444 πŸŽ‰


πŸ“¦ Production Deployment

Build for Production

npm run build

Preview Production Build

npm run preview

Deploy to Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project on Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy! πŸš€

πŸ“ Project Structure

tipcup/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ dashboard/         # Dashboard-specific components
β”‚   β”‚   β”‚   β”œβ”€β”€ BankModal.vue
β”‚   β”‚   β”‚   β”œβ”€β”€ GoalModal.vue
β”‚   β”‚   β”‚   β”œβ”€β”€ WithdrawalModal.vue
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   └── ui/               # Reusable UI components
β”‚   β”‚       β”œβ”€β”€ Button.vue
β”‚   β”‚       β”œβ”€β”€ Input.vue
β”‚   β”‚       β”œβ”€β”€ Select.vue
β”‚   β”‚       β”œβ”€β”€ Table.vue
β”‚   β”‚       └── ...
β”‚   β”œβ”€β”€ composables/          # Vue composables
β”‚   β”‚   β”œβ”€β”€ useAuth.ts
β”‚   β”‚   β”œβ”€β”€ useBankDetails.ts
β”‚   β”‚   β”œβ”€β”€ usePayments.ts
β”‚   β”‚   └── useWithdrawals.ts
β”‚   β”œβ”€β”€ layouts/              # App layouts
β”‚   β”‚   β”œβ”€β”€ default.vue
β”‚   β”‚   └── dashboard.vue
β”‚   β”œβ”€β”€ pages/                # File-based routing
β”‚   β”‚   β”œβ”€β”€ [username].vue    # Creator profile page
β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚   β”œβ”€β”€ index.vue
β”‚   β”‚   β”‚   └── earnings.vue
β”‚   β”‚   β”œβ”€β”€ login.vue
β”‚   β”‚   β”œβ”€β”€ signup.vue
β”‚   β”‚   └── onboarding.vue
β”‚   └── utils/                # Utility functions
β”‚       β”œβ”€β”€ format.ts
β”‚       └── cn.ts
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── flutterwave/      # Flutterwave API endpoints
β”‚   β”‚       β”œβ”€β”€ banks.get.ts
β”‚   β”‚       β”œβ”€β”€ initialize.post.ts
β”‚   β”‚       β”œβ”€β”€ verify.post.ts
β”‚   β”‚       β”œβ”€β”€ resolve-account.post.ts
β”‚   β”‚       β”œβ”€β”€ withdraw.post.ts
β”‚   β”‚       └── webhook.post.ts
β”‚   └── utils/
β”‚       β”œβ”€β”€ admin.ts          # Firebase Admin SDK
β”‚       └── flutterwave.ts    # Flutterwave utilities
β”œβ”€β”€ public/                   # Static assets
β”œβ”€β”€ firebase.ts               # Firebase client config
└── nuxt.config.ts           # Nuxt configuration

πŸ”‘ Key Features Explained

1. Payment Flow

User clicks "Support" β†’ Flutterwave Checkout β†’ Payment Success β†’
Webhook updates Firestore β†’ Dashboard shows transaction

2. Withdrawal Flow

Creator requests withdrawal β†’ Backend validates balance β†’
Flutterwave transfers to bank β†’ Withdrawal record created β†’
Balance updated

3. Bank Account Resolution

  • Uses Flutterwave's account resolution API
  • Verifies account number and bank code
  • Returns account holder name for confirmation
  • Test Mode: Only Access Bank (044) supported with test keys

πŸ§ͺ Testing

Test Bank Account (Flutterwave Test Mode)

  • Bank: Access Bank
  • Bank Code: 044
  • Account Number: 0690000031
  • Account Name: Pastor Bright

⚠️ Important: Flutterwave test environment only allows bank code 044 for account resolution. Use production keys to test with all banks.


πŸ”’ Security Considerations

  • βœ… Webhook signature verification implemented
  • βœ… Firestore security rules enforce user permissions
  • βœ… Server-side validation for all transactions
  • βœ… Firebase Admin SDK used for privileged operations
  • βœ… Environment variables for sensitive credentials

πŸ“ˆ Performance Optimizations

  • βœ… Debounced search in Select component (150ms)
  • βœ… Limited render for large option lists (max 100 items)
  • βœ… Real-time listeners for payments and withdrawals
  • βœ… Paginated tables for transaction history
  • βœ… Lazy-loaded components where applicable

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

About

A creator monetization platform for receiving tips, and managing withdrawals seamlessly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published