Tokolink is a modern, high-performance open-source multi-tenant SaaS platform for small-to-medium businesses (SMBs) and creator-merchants. It combines a digital link-in-bio card with a full-featured storefront, integrated payment gateway, automated digital product delivery, and real-time shipping verification all in one place.
- Latest Major Update Notice (v2.0.0)
- Key Features
- Architecture & Technology Stack
- System Requirements
- Local Installation & Setup
- Project Directory Structure
- Security Hardening
- Contributing
- Sponsor & Support
- License
Tokolink v2.0.0 is a major milestone release (Generation 2) transforming Tokolink from a basic link-in-bio micro-catalogue into a complete automated online store platform:
- Integrated Payment Gateway & Automated Payouts: Integrated Midtrans Snap payment processing with automated seller disbursements via Iris Facilitator.
- Real-Time Logistics Courier Rates: Server-authoritative Biteship API courier rate calculation and shipping validation with Redis caching.
- Automated Digital Product Delivery: Instant text (
AUTO_TEXT) and manual key delivery upon payment verification via WhatsApp & order lookup pages.- Automated WhatsApp Notifications: Fonnte API integration for instant order confirmation, courier tracking, and buyer/seller notifications.
- Independent Per-Variant Stock Tracking: Full per-variant option stock management (
ProductVariantOption.stock) with Mutual Exclusive Stock UI logic.- Atomic Checkout Pre-Reservation & Race Condition Prevention: Atomic database pre-reservation (
updateMany) preventing oversell scenarios under high-concurrency checkouts.- Tab-Switching State Persistence & Quiet Token Refresh: Seamless tab switching (e.g. WhatsApp Web to Dashboard) without losing active form inputs or triggering full-page loading unmounts.
- Production Security Hardening: Sliding-window rate limiting on
confirm-receipt(5 req/min) andreviews(3 req/min), anti-IP-spoofing header resolution, and sanitized error messages to prevent internal UUID/database leakage.
- Instant Storefront & Onboarding: Launch a full-featured, responsive merchant web app (
tokolink.app/store-slug) in seconds via a streamlined onboarding flow. - Hybrid Mobile-First Layout: A sleek continuous-scroll storefront matching link-in-bio social links with interactive product catalog grids, complete with fluid micro-animations.
- Automated WhatsApp Order & Buyer Notifications: Instant buyer & seller WhatsApp updates powered by Fonnte for payment confirmation, courier tracking numbers, order completion thank-you messages, and digital delivery.
- Instant Digital Product Delivery: Full support for digital products with automated Instant Text (
AUTO_TEXT) delivery upon payment verification, manual key fulfillment, and direct delivery over WhatsApp and customer order pages. - Dynamic Category Management: Flexible seller-managed category system supporting custom display order, inline renaming with automatic product association sync, and deletion safeguards.
- Server-Authoritative Shipping Verification: Real-time Biteship courier integration with server-side price validation and Upstash Redis caching to eliminate client-side shipping cost tampering.
- Midtrans Payment Gateway & Automated Payouts: Integrated payment processing with Midtrans Snap and automated seller payout scheduling via Iris Facilitator.
- Cloudflare R2 Image Storage: WebP-compressed product image uploads via Cloudflare R2, with unpredictable UUID-based object keys and zero egress fees.
- Cloudflare Turnstile Bot Protection: Invisible bot protection on auth and onboarding routes via Cloudflare Turnstile (replaces reCAPTCHA v3).
- Destructive Action Safety: Custom confirmation modal prompts across all dashboard destructive operations (deleting products, categories, links).
Tokolink is built on top of the modern TypeScript web ecosystem:
- Frontend: React 19, TanStack Start (Vite + Vinxi compiler), Zustand (state management), Framer Motion (micro-animations), Tailwind CSS v4.
- Routing & SSR: TanStack Router (file-based type-safe routing) with Server-Side Rendering (SSR).
- Backend Logic: TanStack Start Server Functions (RPC endpoints) protected by Same-Origin CSRF middleware.
- Database & ORM: PostgreSQL with Prisma ORM for type-safe relational database management.
- Third-Party Services & APIs:
- Supabase Auth: Secure authentication (Email OTP & Google OAuth).
- Midtrans & Iris: Payment gateway & automated disbursement payouts.
- Biteship API: Real-time Indonesian logistics courier rates & shipping booking.
- Fonnte API: WhatsApp notification automation for buyers and sellers.
- Upstash Redis: Serverless caching for shipping rate queries and rate limiting.
- Cloudflare R2: S3-compatible cloud media storage with WebP compression via
sharp. - Cloudflare Turnstile: Privacy-respecting invisible bot protection.
- Resend: Transactional email service for authentication OTPs & order alerts.
Before starting local development, ensure your environment has:
- Bun Runtime v1.x (recommended) or Node.js v18+
- PostgreSQL database instance (or Supabase Postgres)
- API credentials for all required services (see
.env.example)
git clone https://github.com/MastayY/tokolink-app.git
cd tokolink-appbun installcp .env.example .envOpen .env and fill in credentials for: PostgreSQL, Supabase, Midtrans, Fonnte, Biteship, Upstash, Cloudflare R2, Cloudflare Turnstile, and Resend.
bun run db:generate
bun run db:pushbun run devOpen your browser at http://localhost:3000.
tokolink/
βββ .github/
β βββ ISSUE_TEMPLATE/ # Bug report & feature request templates
β βββ pull_request_template.md
βββ prisma/ # Prisma schema & seed scripts
βββ public/ # Static assets (logos, favicons, OG images)
βββ src/
β βββ components/ # UI components (primitives, dashboard, storefront)
β βββ hooks/ # Custom React hooks
β βββ lib/ # Client configs, Zod schemas, Zustand stores, utils
β βββ routes/ # Page routes & API endpoints (TanStack Router)
β βββ server/ # Server functions & middleware
β βββ styles.css # Global CSS entrypoint (Tailwind CSS v4)
β βββ start.ts # TanStack Start middleware (CSRF & error handling)
βββ .env.example # Environment variables template
βββ CODE_OF_CONDUCT.md # Community standards
βββ CONTRIBUTING.md # Contributor guide
βββ LICENSE # GNU Affero General Public License v3.0 (AGPL-3.0)
βββ LICENSE-MIT-HISTORICAL.md # Pre-2026-07-30 historical MIT license
βββ NOTICE.md # Relicensing history notice
βββ SECURITY.md # Vulnerability reporting policy
βββ README.md
Tokolink incorporates production-grade security standards:
- CSRF Protection: Every server function call is automatically protected via TanStack Start Same-Origin CSRF validation.
- Server-Authoritative Pricing & Shipping: Order totals and shipping costs are independently calculated and verified server-side to prevent client-side manipulation.
- HMAC Signature & Dual-Layer Webhook Verification: Midtrans webhooks undergo HMAC-SHA512 signature validation and secondary status queries to Midtrans REST API.
- SSRF Prevention: OG image generation restricts image URL fetching to trusted domains only (
R2_PUBLIC_URL,api.dicebear.com,tokolink.app). - Type & Input Sanitization: All payload parameters are strictly validated using Zod before executing database queries.
- Image Binary Magic Bytes Verification: Upload handlers inspect binary header magic bytes (PNG, JPG, GIF, WEBP) to prevent malicious file uploads.
- WebP Conversion & Unpredictable Storage Keys: Images are compressed to WebP via
sharpand stored withcrypto.randomUUID()keys to prevent key enumeration. - Cloudflare Turnstile: Invisible bot protection on all auth and onboarding form submissions.
- Upstash Rate Limiting: Redis-backed rate limiting on all public API routes.
Contributions are warmly welcome! Please read CONTRIBUTING.md before submitting a PR.
Key points:
- Open an Issue or Discussion before working on large changes
- Follow Conventional Commits for commit messages
- Run
bun run buildto verify your changes before submitting - Check SECURITY.md for responsible vulnerability disclosure
If you find Tokolink valuable or if it helps empower your business, please consider supporting the project!
Your support directly covers infrastructure maintenance, domain costs, API integrations, and ongoing open-source feature development for Indonesian SMBs and creator-merchants.
- πͺ Dukung via Saweria (Indonesia): saweria.co/Mastay
- π Sponsor via GitHub Sponsors (Global): github.com/sponsors/MastayY
Every contribution, big or small, helps keep Tokolink independent, actively maintained, and free for everyone! π
- Cloudflare R2 storage integration and Cloudflare Turnstile bot protection implementation referenced from @salmanabdurrahman.
Tokolink is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
In plain English:
- Free & Open Source: You are free to use, modify, run, and distribute Tokolink.
- Network Copyleft: If you modify Tokolink and run it as a network service/SaaS, you must make your modified source code available to your users under AGPL-3.0.
- Historical License: Commits up to commit
19820bb61f7207b76b65c8c84c3a52e9568b995e(June 13, 2026) remain permanently under the MIT License. All subsequent commits are licensed under AGPL-3.0. See NOTICE.md and LICENSE-MIT-HISTORICAL.md for details.
Copyright (c) 2026 MastayY