No description
  • TypeScript 77.6%
  • Astro 19.9%
  • CSS 1.5%
  • Dockerfile 0.8%
  • JavaScript 0.2%
Find a file
ghifaryh c15bed7322
Some checks are pending
Verify Sandbox Runner / check (push) Waiting to run
CI & Docker Publish / Verify, Build & Push Docker Image (Forgejo) (push) Has started running
Update Dockerfile
2026-11-17 13:46:12 +07:00
.forgejo/workflows Update .forgejo/workflows/ci-cd.yml 2026-11-17 12:58:44 +07:00
.github/workflows Add .github/workflows/verify.yml 2026-11-17 11:44:57 +07:00
scripts fix: sanitize APP_URL fallback from localhost to https://spill.gehu.me 2026-11-14 00:38:13 +07:00
src perf: eliminate mobile scroll lag by removing fixed background, backdrop blur, and scroll listener 2026-11-14 07:41:10 +07:00
.dockerignore feat: add Google Sheets sync, Telegram bot handlers, and product management API 2026-11-08 20:44:15 +07:00
.env.example feat: add Google Sheets sync, Telegram bot handlers, and product management API 2026-11-08 20:44:15 +07:00
.gitignore feat: initial commit for KeranjangSpill mobile link-in-bio app 2026-10-03 22:42:35 +07:00
affiliate_link_prd.md feat: initial commit for KeranjangSpill mobile link-in-bio app 2026-10-03 22:42:35 +07:00
astro.config.mjs feat: initial commit for KeranjangSpill mobile link-in-bio app 2026-10-03 22:42:35 +07:00
docker-compose.yml feat: update docker compose configuration and add index page component 2026-11-08 21:05:32 +07:00
Dockerfile Update Dockerfile 2026-11-17 13:46:12 +07:00
package-lock.json feat: add dynamic avatar via Telegram bot, startup notification, and click stats endpoint 2026-11-13 21:57:45 +07:00
package.json feat: add dynamic avatar via Telegram bot, startup notification, and click stats endpoint 2026-11-13 21:57:45 +07:00
README.md feat: implement full-stack keranjangspill application with SQLite, Telegram bot, and verification suite 2026-11-07 23:35:05 +07:00
tsconfig.json feat: initial commit for KeranjangSpill mobile link-in-bio app 2026-10-03 22:42:35 +07:00

🌸 KeranjangSpill

A high-performance, mobile-first affiliate link-in-bio web application for Indonesian social media creators (TikTok & Instagram).

Followers locate recommended products via a designated Product Number mentioned in videos, search with zero latency (<5ms), and click through tracking redirects directly into native e-commerce apps (Shopee / TikTok Shop / Tokopedia).

The creator manages links remotely via a private Telegram Bot backed by Google Sheets (as CMS) and a local SQLite cache with sub-10ms response times.


✨ Features

  • ⚡ Zero-Latency Instant Search: Real-time client-side DOM filtering in vanilla JS (<5ms). Supports numeric (123) and text (ABC) search modes.
  • 📱 Mobile-First Aesthetic: Refined boutique design with warm off-white tones, dusty-rose accents, serif typography, sticky solid search band, and product thumbnails.
  • 🤖 Private Telegram Bot CMS: Add products on the go from your phone by sending: 45 - Kemeja Oversize Linen - https://s.shopee.co.id/abc1234 Supports photo attachments with caption, /list, /delete <number>, and /sync.
  • 📊 Anti-Spam Click Tracking:
    • Automatically filters crawler and bot user-agents (Bytespider, Googlebot, etc.).
    • SHA-256 IP + User-Agent deduplication with a 30-minute window prevents inflated click metrics.
  • 🚀 In-App Browser Compatibility: Special fallback deep-link buttons and meta navigation to seamlessly navigate past TikTok and Instagram in-app webviews.
  • 🛡️ Google Sheets Graceful Fallback: If Google Sheets is unreachable or rate-limited, Astro continues serving traffic uninterrupted from local SQLite.
  • 🐳 Docker & Portainer Ready: Containerized with multi-stage Docker build and persistent SQLite data volume.

🛠️ Tech Stack


🚀 Quick Start (Local Development)

1. Install Dependencies

npm install

2. Configure Environment

Copy .env.example to .env:

cp .env.example .env

3. Run Development Server

npm run dev

Open http://localhost:4321 in your browser (switch to Mobile view in DevTools).


🤖 Telegram Bot Configuration

  1. Create a bot using @BotFather on Telegram and copy the TELEGRAM_BOT_TOKEN.
  2. Find your personal Telegram user ID using @userinfobot and set TELEGRAM_ALLOWED_USER_ID. (All other users will receive a 403 Forbidden).
  3. Set your webhook URL:
curl -X POST "https://api.telegram.org/bot<YOUR_TOKEN>/setWebhook?url=https://spill.yourdomain.com/api/telegram"

(Optional: include &secret_token=<YOUR_SECRET> and match TELEGRAM_WEBHOOK_SECRET).

Bot Commands & Usage

  • Add product: Send message 45 - Kemeja Linen - https://s.shopee.co.id/xyz (or upload a photo with that caption).
  • List products: /list
  • Delete product: /delete 45 or /hapus 45
  • Sync cache from Sheets: /sync
  • Help: /help

📊 Google Sheets Setup (Optional CMS)

  1. Create a Google Spreadsheet with sheet name Products.
  2. Define column headers in row 1: Number | Title | Affiliate Link | Original Link | Image URL | Timestamp | Active Status
  3. Create a Google Cloud Service Account, grant Editor access to the spreadsheet, and pass the JSON key via GOOGLE_SERVICE_ACCOUNT_KEY (base64 or raw JSON) and GOOGLE_SHEET_ID.

🐳 Deployment with Docker / Portainer

1. Build and Run via Docker Compose

docker compose up -d --build

2. Portainer Configuration

  • Stack Name: keranjangspill
  • Repository: Point to your Git repo
  • Volume: Map ./data to /app/data (stores keranjang.db)
  • Port: 4321:4321

🛣️ API Endpoints

Endpoint Method Description
/ GET Mobile visitor link-in-bio page
/go/:id GET Tracking redirect to affiliate link with anti-spam
/api/telegram POST Webhook endpoint for Telegram Bot updates
/api/sync GET/POST Trigger sync from Google Sheets to SQLite