Skip to main content

Architecture

Strategic blueprint for Pasar Seken. This is the canonical reference for how SEKEN works as a system, from the moment a buyer opens the app to the moment a seller receives their disbursement. Every flow, every integration, every permission model is documented here.

Living document

This architecture is verified against the codebase as of 2026-07-07. Each element carries a status flag so you always know what is built versus planned. The brain regenerates this section weekly.

What this isโ€‹

Premium internal documentation that serves three audiences simultaneously:

AudienceWhat they get
FoundersStrategic visibility into how the business operates technically
EngineersAuthoritative reference for every flow, state, and integration
New team membersOnboarding ground truth, read this first

Status legendโ€‹

Every diagram, table, and module in this section uses the same four-state flag:

FlagMeaning
โœ… LiveFully implemented, in production, verified by audit
๐ŸŸก PartialBuilt but incomplete, missing edge cases, or placeholder logic
๐Ÿ”ต PlannedDesigned and documented, not yet built
โŒ DriftWas documented one way, codebase shows another, needs reconciliation

How to read this sectionโ€‹

The 18 pages are ordered by zoom level, start wide, narrow as you go.

At a glanceโ€‹

Three principles guiding the architectureโ€‹

1. Sellers always free, foreverโ€‹

Zero commission on sellers is a permanent business decision, type-enforced at the database layer. Revenue comes from buyer-side fees, shipping markup, and Boost products, never from seller commissions.

2. Brain is source of truthโ€‹

Every architectural decision lives in Pasarseken-AI-Brain first, then propagates to code via CLAUDE.md. This document is generated from the brain, not maintained by hand.

3. Reliability before featuresโ€‹

The platform runs on a hardened reliability layer: idempotency guards, transactional outbox processing every 15 minutes, circuit breakers on every external integration, and optimistic locking on all order state transitions.

Key factsโ€‹

MetricValue
Database tables81
Order states14 (DB CHECK constraint enforced)
External integrations6
Subdomains5
Ops portal modules52 of 52 (100% built)
AI bots live2 (help center, ops staff)
Auto-confirm window48 hours
Return window24 hours
Backend runtimeNestJS 10 + Fastify + Drizzle (Dokploy VPS)
Image storageDigitalOcean Spaces + imgproxy

Open architectural questionsโ€‹

Items still under review or pending the Engineer's investigation. Each links to its detailed page.

QuestionOwnerPage
Should fin_* tables migrate to a finances schema?EngineerDatabase Schema
Reverse Biteship label, v1 build scope confirmedEngineerReturns & Disputes
Algolia vs self-hosted search (Tier 2 trigger)EngineerScalability

How to use this with AI toolsโ€‹

Both Cursor (Founder) and Copilot (Engineer) read CLAUDE.md in the pasarseken repo, which references the brain. When working in a Claude Code session, this entire architecture is available as context, just ask.

Example prompts that work well:

  • "Walk me through the checkout flow with current code references"
  • "What changes if I add a new order state?"
  • "Show me the money flow with all current fees"
  • "What's the difference between dispute and return flows?"

Next: System Architecture โ†’