# Use and adapt refferq

Use the documented interfaces and source layout for **refferq**. The sections below retain the README’s examples and configuration details.

## 📋 About

**Refferq** is a comprehensive affiliate management platform designed to help businesses create, manage, and scale their affiliate programs. Built with modern web technologies, it provides a complete solution for tracking referrals, managing commissions, and engaging with affiliate partners.

### 🎯 Key Highlights

- **Complete Affiliate Portal** - Full-featured dashboard for affiliates to track earnings, submit leads, and manage payouts
- **Admin Control Panel** - Comprehensive admin dashboard for managing partners, referrals, and program settings
- **Real-time Analytics** - Track conversions, commissions, and performance metrics in real-time
- **Automated Workflows** - Automated commission calculations, payout processing, and email notifications
- **Flexible Commission Rules** - Support for percentage-based and fixed commission structures
- **White-Label Ready** - Customizable branding and subdomain support

---

## ✨ Features

### For Admins

- **Dashboard Analytics**
  - Real-time revenue tracking
  - Conversion rate analytics
  - Partner performance metrics
  - Visual charts and reports

- **Partner Management**
  - Approve/reject affiliate applications
  - Manage partner groups
  - Set custom commission rates
  - View partner activity logs

- **Referral Management**
  - Review and approve lead submissions
  - Track referral status (Pending, Approved, Rejected)
  - Manual lead conversion tracking
  - Bulk operations support

- **Commission & Payouts**
  - Automated commission calculations
  - Flexible commission rules
  - Payout scheduling (NET-15, NET-30, etc.)
  - Multiple payout methods (PayPal, Bank Transfer, Stripe, Wise)

- **Program Settings**
  - Customizable program details
  - Branding configuration (colors, logos)
  - Cookie tracking settings
  - Country blocking
  - Terms of Service management

- **Email Automation**
  - Welcome emails for new partners
  - Referral notification emails
  - Commission approval alerts
  - Payout confirmation emails
  - Customizable email templates

### For Affiliates

- **Personal Dashboard**
  - Earnings overview (total, pending, paid)
  - Click tracking
  - Lead conversion metrics
  - Recent referral activity

- **Referral Management**
  - Submit leads manually
  - Track referral status
  - View commission breakdown
  - Filter by status (All, Pending, Approved)

- **Marketing Resources**
  - Unique referral link
  - Shareable referral code
  - Copy-to-clipboard functionality
  - Social media sharing buttons

- **Payout Tracking**
  - View payout history
  - Track payout status
  - Next payout schedule
  - Earnings breakdown

- **Account Settings**
  - Update personal details
  - Configure payment methods
  - Set payout preferences
  - Manage notification settings

---

## 🛠️ Tech Stack

### Core Framework
- **Next.js 15.2.3** - React framework with App Router
- **React 19** - UI library
- **TypeScript** - Type safety

### Database & ORM
- **PostgreSQL** - Primary database
- **Prisma** - Modern ORM with type safety

### Authentication & Security
- **JWT (jose)** - JSON Web Tokens for auth
- **bcryptjs** - Password hashing
- **OTP Verification** - Email-based verification

### Styling
- **Tailwind CSS** - Utility-first CSS
- **Recharts** - Data visualization charts

### Email
- **Resend** - Modern email API for transactional emails
- **Email Templates** - Customizable HTML templates

### Development
- **ESLint** - Code linting
- **Prettier** - Code formatting
- **TypeScript** - Static typing

---

## Commands in the root manifest

The captured [package.json](https://github.com/Up-to-code/refferq/blob/HEAD/package.json) declares the following scripts. Run them from the directory containing that manifest.

| Command | Script |
| --- | --- |
| `npm run dev` | `next dev` |
| `npm run build` | `next build` |
| `npm run start` | `next start` |
| `npm run lint` | `next lint` |

## Troubleshoot a local change

1. Reproduce the smallest example from the [quick-start guide](/docs/up-to-code-refferq/quick-start-guide).
2. Compare required configuration and dependency versions with the README.
3. Check the linked issue tracker for the same error. Include the command, runtime version, and relevant error when reporting a problem; omit credentials.

## Source and help

- [GitHub repository](https://github.com/Up-to-code/refferq)
- [Original README](https://github.com/Up-to-code/refferq/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/refferq/issues)
- [Open the project website](https://www.refferq.com)

The catalog identifies the license as **MIT**. Read the repository license before redistributing source or assets.

This catalog entry is a fork. The README may describe upstream packages, domains, or release procedures; those destinations do not establish a separate release of this fork.