Shopubu
Full-stack Developer 2024 Web
Multi-tenant e-commerce SaaS platform for the Turkish market with admin panel, storefront engine, and 1000+ automated tests.
The Problem
Small and medium businesses in Turkey lacked affordable, localized e-commerce infrastructure. International platforms like Shopify had limited Turkish payment gateway support, no built-in Turkish tax compliance, and pricing that was prohibitive for the local market. Businesses needed a multi-tenant SaaS solution that understood Turkish e-commerce regulations and consumer behavior.
The Solution
Designed and built Shopubu as a multi-tenant e-commerce SaaS platform from scratch using a modern TypeScript monorepo. The admin panel provides 32 UI components across 8 tRPC namespaces for complete store management. The storefront engine supports custom theming, dynamic cart and checkout flows, and built-in SEO optimization. The entire platform is tested with 1000+ automated tests across unit, integration, and E2E layers.
The Results
- Multi-tenant architecture supporting isolated storefronts from a single codebase
- 32 reusable UI components in the admin panel across 8 tRPC namespaces
- Theme engine enabling per-tenant storefront customization
- 1000+ automated tests (unit, integration, E2E) with 80%+ coverage
- Complete cart-to-checkout flow with Turkish payment gateway integration
- SEO-optimized storefront with dynamic meta tags and structured data
Key Metrics
Monorepo Architecture
Shopubu uses Turborepo to orchestrate a monorepo with shared packages for UI components, database layer, and tRPC router definitions. The admin panel and storefront consume the same type-safe database schemas through Drizzle ORM, which means a product model change propagates to both apps at compile time. Shared UI components live in a dedicated package, ensuring visual consistency between the merchant-facing admin and the customer-facing storefront. This structure reduced code duplication significantly — the cart logic, for instance, is defined once and consumed by both the storefront checkout and the admin order management screen.
Technical Decisions
Drizzle ORM was chosen over Prisma for its type-safe SQL approach and superior performance in multi-tenant query patterns. Tenant isolation uses a schema-per-tenant strategy with connection pooling, and Drizzle’s query builder makes it straightforward to scope every database operation to the correct tenant without middleware hacks. tRPC provides end-to-end type safety from the API layer to the frontend, eliminating the need for API documentation or code generation. Vitest replaced Jest for testing speed — the 1000+ test suite runs in under 30 seconds on CI, making TDD practical rather than aspirational.
Phased Delivery
Shopubu was built in four distinct phases, each with its own test suite and acceptance criteria. Phase 0 (Foundation) established the monorepo, database, authentication, and CI/CD pipeline with 170 tests. Phase 1 (Admin Panel) delivered 32 UI components and 8 tRPC namespaces with 420 tests. Phase 2 (Storefront) added the theme engine, cart, checkout, and SEO with 343 tests. Phase 3 (Production Hardening) completed E2E testing, security audits, email notifications, and deployment with 491 tests. The TDD approach meant that every feature was tested before or alongside its implementation, catching regressions early and enabling confident refactoring throughout the project.