logo
Company ProfileWeb ApplicationCompletedFeatured

Garam Cap Kapal Website & E-Commerce

Bringing Indonesia's legendary salt brand since 1978 into the modern digital commerce era

A full-stack digital brand experience and integrated e-commerce platform for Garam Cap Kapal (PT Susanti Megah). Built with Next.js 16, React 19, and a Modular Domain-Driven Laravel 13 REST API, the platform unifies interactive brand storytelling, dual-tier consumer and distributor (Agent) pricing, Midtrans & Manual QRIS checkout flows, a loyalty reward redemption system, community forum, and a comprehensive role-based admin panel.

My Role
Full-Stack Developer
Timeline
Apr 2026 - Sep 2026
Duration
6 months
Garam Cap Kapal Website & E-Commerce
11+
Core Modules
~150MB
Docker Image
Since 1978
Brand Heritage
4 Tiers
User Roles

The Journey

Reimagining a Household Icon Since 1978

How do you modernize a brand found in millions of Indonesian kitchens without losing its heritage?

Garam Cap Kapal has been Indonesia's pioneer of iodized consumption salt since 1978. While the brand enjoyed decades of household trust and repeated Top Brand recognition, its digital presence needed to evolve beyond a static brochure into an interactive brand hub and direct-to-consumer / business-to-business commerce platform.

When I started working on the platform in April 2026, the goal was ambitious: build an ecosystem that serves four distinct audiences under one roof:

  • Everyday Consumers & Home Cooks: discovering iodized salt products, exploring Kreasi Rasa recipes, participating in community forums, and earning loyalty points.
  • Agents & UMKM Partners (agen): registering business profiles with distributor codes and purchasing bulk inventory at specialized B2B agent pricing.
  • Job Seekers: browsing open positions and submitting applications directly through the career portal.
  • Admins & Superadmins: managing products, verifying manual QRIS & Midtrans payments, moderating forums, and tracking loyalty redemptions.

Backend-for-Frontend (BFF) & Edge Security Architecture

Zero client-side tokens with Next.js Edge Proxy and Modular Laravel 13

Security and clean separation of concerns were foundational priorities from day one. Rather than storing JWT bearer tokens in localStorage where they are vulnerable to XSS, I engineered a Backend-for-Frontend (BFF) Proxy architecture:

  1. HttpOnly Session Cookies: Upon authentication (or Google OAuth callback), the Next.js server stores the JWT inside an encrypted HttpOnly cookie (gck_token) alongside signed role metadata (gck_roles).
  2. Edge RBAC Middleware (src/proxy.ts): Every navigation request through /dashboard or /admin is intercepted at the Edge using jose to verify JWT signatures and enforce role-based access control (superadmin, admin, agen, user) before a page even renders.
  3. Transparent API Proxy (/api/proxy/[...path]): Client-side TanStack React Query hooks communicate exclusively with the internal Next.js proxy route, which attaches the Authorization: Bearer header server-side and forwards requests to the Laravel 13 backend.

On the backend, the API was architected using Domain-Driven Modular structure (app/Modules/{Auth,Product,Order,Payment,Reward,Promo,Forum,CMS,Career,Notification,Admin}), powered by Laravel Sanctum, Spatie Permission, Spatie Laravel Data DTOs, Meilisearch (via Laravel Scout) for instant catalog indexing, and Laravel Horizon for asynchronous queue processing.


Dual-Tier Commerce, Hybrid Payments & Loyalty Rewards

Tailoring the buying journey for both retail shoppers and wholesale agents

One of the most interesting engineering challenges was building the role-aware pricing and checkout engine:

  • Dynamic Agent Pricing: When a verified Agent (agen) logs in, the entire product catalog, shopping cart, and order calculation engine automatically switch from retail pricing (price) to wholesale distributor pricing (agent_price), complete with UMKM business profile and distributor code validation.
  • Hybrid Payment Flows: To accommodate all customer preferences, I integrated Midtrans Snap for instant automated payments alongside a Manual QRIS Payment Flow where buyers scan a dynamic QRIS code, upload their transfer receipt, and trigger an admin verification workflow with one-click payment status synchronization.
  • Multi-Channel Marketplace Bridge: For customers who prefer shopping on their favorite marketplace, each product dynamically links to official Shopee, Tokopedia, Lazada, Blibli, and TikTok Shop storefronts.
  • Loyalty & Point Redemption Engine: Customers earn points from purchases and events, which can be redeemed for role-specific rewards and promo vouchers—enforced by per-user redemption limits (max_redeem) and tracked in an auditable point ledger.

Production DevOps & Automated CI/CD Pipeline

From local TypeScript code to a 150MB hardened production container

To ensure reliable deployments on the production VPS behind Nginx and Cloudflare Turnstile, I built a complete containerization and CI/CD pipeline:

  • Multi-Stage Docker Build: Using Next.js output: "standalone" on node:20-alpine, the production image strips away development dependencies and runs under a non-root nextjs user at roughly 150MB.
  • Automated GitHub Actions Workflows:
    • ci.yml: Runs ESLint, TypeScript type-checking (tsc --noEmit), and production build verification on every pull request.
    • security.yml: Executes weekly and per-push Trivy container vulnerability scans and pnpm audit dependency checks, uploading SARIF reports directly to the GitHub Security tab.
    • deploy-staging.yml & deploy-production.yml: Builds multi-tag Docker images (sha-*, latest), pushes them to GitHub Container Registry (GHCR), and performs automated SSH rollouts with health-check verification and automatic rollback on failure.

Technologies Used

Next.js
TypeScript
Laravel
Tailwind CSS
TanStack Query
Zustand
Framer Motion
Midtrans
Docker
GitHub Actions

Key Challenges

Designing a secure Backend-for-Frontend (BFF) proxy and Edge RBAC middleware to keep authentication tokens strictly inside HttpOnly cookies away from client-side JavaScript
Supporting dual-tier commerce logic where regular consumers and verified Agents (distributors/UMKM) seamlessly view role-specific pricing across the catalog, cart, and checkout
Orchestrating hybrid payment workflows combining automated Midtrans Snap webhooks with manual QRIS proof-of-payment uploads and admin verification
Containerizing the Next.js standalone application into a lightweight ~150MB multi-stage Docker image with automated CI/CD, Trivy security scanning, and zero-downtime deployment

Key Features

Interactive brand showcase featuring 3D salt mascots (Captain Yodi, Salta, Saltu, Salto), Top Brand awards, and animated product storytelling
Role-aware B2C & B2B (Agent) e-commerce catalog with dynamic distributor pricing, cart synchronization, and multi-marketplace integration (Shopee, Tokopedia, Lazada, Blibli, TikTok Shop)
Hybrid checkout supporting automated Midtrans payment gateway and manual QRIS upload with real-time payment status synchronization
Loyalty Points & Reward Redemption system with role-diversified vouchers, per-user redemption caps (max_redeem), and point ledger tracking
Rich content modules including Kreasi Rasa (Recipes), Kapal Mampir Pasar & Cooking Demo activities, Articles, CSR initiatives, Events & Promos, and Community Forum
Comprehensive Admin & Superadmin Dashboard for managing orders, verifying payments, moderating forum threads, and exporting loyalty and sales reports

Key Learnings

1

Implementing a Next.js BFF proxy (/api/proxy/[...path]) with HttpOnly cookies eliminates XSS token theft vectors while simplifying CORS and token refresh lifecycles

2

Structuring a large Laravel 13 backend into self-contained Domain Modules (Auth, Product, Order, Payment, Reward, Promo, Forum, CMS) keeps business logic maintainable as requirements evolve

3

Real-world Indonesian commerce requires flexibility — combining automated payment gateways (Midtrans) with manual QRIS verification and marketplace deep-links maximizes conversion across diverse customer segments

4

Automated security gates (Trivy container scanning, pnpm audit, and Husky pre-commit hooks) catch vulnerabilities early before they ever reach staging or production

Project Gallery

Interested in this project?

Feel free to explore the code or see it in action. I'm always happy to discuss the technical details!