Codapult
料金プラグインブログドキュメントデモ

開発者のためのSaaSボイラープレート

© 2026 Codapult. All rights reserved.

Built with Codapult

プロジェクト

  • 料金
  • プラグイン
  • ドキュメント
  • SaaSテンプレート比較

会社概要

  • お問い合わせ

法的情報

  • プライバシーポリシー
  • 利用規約
全記事

Getting Started

  • Introduction
  • Quick Start
  • Project Structure
  • License and Permitted Use

Configuration

  • Environment Variables
  • App Configuration

Authentication

  • Authentication
  • OAuth Providers
  • Two-Factor & Passwordless
  • Enterprise SSO (SAML)

Database

  • Database
  • Migrations

Teams

  • Teams & Organizations
  • Permissions & RBAC
  • SCIM Provisioning

Payments

  • Payments & Billing
  • Stripe Setup
  • LemonSqueezy Setup
  • Polar Setup
  • Payment Webhooks

Api

  • API Layer
  • tRPC
  • GraphQL

Ai

  • AI Features
  • Streaming Chat
  • RAG and Semantic Search
  • Quotas and Memory

Email

  • Email
  • Email Templates

Infrastructure

  • Infrastructure
  • Self-Hosting
  • File Storage
  • Docker
  • Background Jobs
  • Terraform & Pulumi
  • Kubernetes

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Security

  • Security

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture
  • Waitlist
  • Audit Log
  • White-Labeling
  • Workflow Automation
  • A/B Testing
  • Welcome Page
  • Referrals
  • GDPR Export and Deletion
  • Outgoing Webhooks

Plugins

  • Plugin System
  • AI Kit Plugin
  • CRM Plugin
  • Helpdesk Plugin
  • Email Marketing Plugin

Deployment

  • Deployment
  • Troubleshooting

Upgrading

  • Upgrading Codapult

Developer Tools

  • AI Agents & IDEs
  • MCP Server
  • Testing
Modules

Referrals

Generate referral codes, track referred signups, conversions, rewards, and leaderboards.

The referral module gives each user a referral code and tracks referred signups through conversion and reward states.

Lifecycle

StatusMeaning
pendingReferral code exists, no signup yet
signed_upA referred user created an account
convertedThe referred user became a paying customer
rewardedThe reward was issued

Key files

FilePurpose
src/lib/referrals/index.tsReferral code, signup, conversion, reward, stats helpers
src/app/api/referrals/route.tsReferral stats and leaderboard API
referral tableStores referral code and lifecycle state

Configuration

REFERRAL_REWARD_AMOUNT="10"
REFERRAL_REWARD_TYPE="credit"

REFERRAL_REWARD_TYPE supports credit, discount, or cash. Adapt the reward issuance step to match your billing provider and business model.

Typical integration points

  1. Call getOrCreateReferralCode(userId) when showing a referral dashboard.
  2. Capture the code from signup links.
  3. Call recordSignup(code, referredUserId) after account creation.
  4. Call markConverted(referredUserId) after the first paid purchase.
  5. Call markRewarded(referralId) after issuing the reward.

Feature flag

ENABLE_REFERRALS="false"

When disabled, referral dashboard and API surfaces return 404.

Welcome PageGDPR Export and Deletion