[ 00 ] Case Study

HONGSHIANG | 鴻象科技

Agency:

Freelance / Independent

Live Site

Year:

2024

Industry:

RetailFintechSaaS

Focus:

#Full-Stack#TypeScript#Monorepo
8 min Read
HONGSHIANG | 鴻象科技

PremiseA precision-engineered digital ecosystem for Hongshiang — uniting a bespoke storefront, an intelligent operations dashboard, and a type-safe payment layer within a single monorepo, designed to carry a legacy retail brand into the next era of commerce.

Premise &
Provocation

A traditional retailer stood at the threshold of reinvention — caught between the certainty of legacy processes and the promise of a unified digital future.

[ 01 ] Premise
Client:

Hongshiang

Year:

2025

Industry:

E-commerce /
Traditional Business

Role:

Full Stack Dev

UX Strategy

System Arch

The Problem

“Fragmented channels, manual workflows, and no unified system to bridge legacy retail with the speed of modern commerce.”

The business faced mounting pressure to digitize, yet lacked a cohesive platform for payments, logistics, and content management.

The Solution
  • Scalability

    Built on a monorepo architecture with Turborepo, enabling independent scaling.

  • End-to-End Integrity

    End-to-end type safety from Prisma through oRPC to TanStack Start.

  • Editorial Autonomy

    Sanity CMS empowers clients to update content without touching code.

[ 02 ] Architecture

A Unified
Codebase

A centralized architecture built with Turborepo, designed for maximum code reuse, type safety across boundaries, and scalable service deployment.

hs-magic-micro/
/apps

store/

Customer Storefront

admin/

Operations Dashboard

sanity/

Sanity Studio

/packages (Shared Services)

api

Type-safe API Layer

auth

Authentication Gateway

db

Schema & Migrations

ecpay

Commerce Integration

inngest

Event-driven Workflows

types

Shared Type Contracts

The Stack

Framework

TanStack Start

Monorepo

Turborepo

Runtime

Bun

Database

Prisma + PostgreSQL

Content

Sanity CMS

API Layer

oRPC

Auth

Better-Auth

Workflows

Inngest

[ 03 ] Methodology

Guiding
Convictions

“Development First” — leveraging the best of the open-source ecosystem to accelerate delivery without compromising quality.

“Craft is not about building everything from scratch. It is about knowing precisely which pieces to choose — and having the discipline to assemble them without compromise.”
Core Principle
Components

shadcn/ui

Accessible, composable primitives that deliver polish without sacrificing the freedom to diverge.

Interaction

MagicUI

Curated micro-animations and interactive patterns that elevate the storefront beyond the ordinary.

Optimization

Performance

TanStack Start with file-based routing delivers sub-second loads and search-engine fluency.

Architecture

Type Safety

From database schema to API boundary to rendered view — every data flow is verified at compile time.

[ 04 ] Visual Language

Type & Tone

Manrope — a typeface born from geometric primitives, lending neutrality and warmth in equal measure across every surface of the product.

Manrope

Heading 1
64 px
Title
48 px
Body
20 px
AaBbCc123
Chromatic Identity
#0B090D

Background

#424043

Secondary

#B1B0B2

Muted

#FFFFFF

White

#440CB2

Primary (Glow)

#435B27

Accent (Green)

[ 05 ] Engineering

Where Precision
Meets Legacy

The intersection of modern type systems and legacy payment infrastructure — where every abstraction must earn its place through reliability.

Commerce Integration Layer

FINTECH

Payment

Credit card, ATM, & CVS with webhook confirmation.

SCM

Logistics

Shipping label generation & real-time tracking.

COMPLIANCE

Invoice

Taiwan e-invoice carrier support.

HMAC SHA256 Verification
Idempotent Handlers
Zod Webhook Validation
// File Structure
schemas/
payment.ts
logistics.ts
utils/
checkmac.ts
encrypt.ts
Content Management

Two Sources of Truth,
One Seamless Experience

By decoupling transactional data (Prisma/PostgreSQL) from editorial content (Sanity), we achieved 100ms instant previews for the client while maintaining rigid data integrity for orders.

Editorial Freedom

Live previews & real-time schema updates without deployments.

Performance

TanStack Start loaders for SEO-optimized static-dynamic hybrid rendering.

Technical Achievement & Lessons

Built a complete type-safe ECPay SDK — a Rosetta Stone translating between legacy XML/Form APIs and modern TypeScript, turning undocumented behavior into verifiable contracts.

“ECPay's documentation is often contradictory. Zod schemas became our single source of truth — turning vague specifications into living, executable validation.”

[ 06 ] Outcomes

From Repository
to Reality

Every commit traverses an automated gauntlet of type verification, build validation, and review gates before reaching production on Railway.

LIVE

Storefront

hs-magic.com

LIVE

Admin Panel

[SECRET]

LIVE

Sanity CMS

[SECRET]

The Verification Chain

01

Branching

Feature-based workflow

02

Verification

CI Type-check & Build

03

Review

Automated PR analysis

04

Deployment

Railway Auto-scaling

Measurable Outcomes

First Contentful Paint
Performance
~4.2s0.8s
Content Update Latency
Agility
2 DaysInstant
Order Logic Handling
Operations
ManualAutomated
Verified. Deployed. Performing.

Tools & Technologies

TypeScript

Language

TanStack Start

Framework

Turborepo

Monorepo

Bun

Runtime

Prisma

ORM

PostgreSQL

Database

Sanity CMS

CMS

oRPC

API Layer

Better-Auth

Auth

Inngest

Workflows

TailwindCSS

Styling

shadcn/ui

Components

Zustand

State

Arcjet

Security

PostHog

Analytics

HS MAGIC