This portfolio uses Google Analytics only after you agree. It records aggregate navigation and performance signals, never contact-form contents or account details. Declining does not change the site.
Modular E-Commerce Platform | Ionuț Necula
Case study / 05
Modular E-Commerce Platform
A fully modular e-commerce platform built as a Turborepo monorepo with a Fastify backend, Astro storefront (React islands), React + Vite admin panel, and three shared packages - featuring dynamic RBAC, convention-based route auto-registration, and background job processing.
Status
Selected work
System context
TypeScript, Turborepo, Fastify, Astro
Source
Public repository
01 / System behavior
Interactive proof
A project-specific technical mechanism based on the recorded architecture and implementation context.
Interactive proofModular E-Commerce Platform
01Fastify backend
02Astro storefront
03React admin
04Shared UI
05Utilities
06Configuration
PostgreSQLRedis / BullMQTurborepo graph
Context and intent
This monorepo confronts the scaling problem that emerges when a project outgrows a single-app architecture. It manages six inter-dependent packages with Turborepo's task graph and caching - a full rebuild that previously took 4+ minutes dropped to under 60 seconds after the first run populated the cache.
The Fastify backend uses Zod for compile-time type safety and runtime validation on every route. An autoRegisterRoutes utility scans the modules/ directory at startup and dynamically imports every *.route.ts file - adding a new module means creating the standard folder structure with zero manual imports or registration.
03 / Architecture record
Architecture
A structured reading of the architecture recorded with this project.
Architecture recordModular E-Commerce Platform
01frontend
02backend
03admin
04@modular/ui
05@modular/utils
06@modular/config
Read the full architecture record
The monorepo is structured into three applications and three shared packages:
Apps:
• backend - Fastify API with modular route structure, Zod validation, JWT auth, and dynamic RBAC
• frontend - Astro storefront with React islands for interactive components (cart, checkout)
• admin - React + Vite admin panel for product, order, and user management
Packages:
• @modular/ui - Shared UI component library with data-attribute theming
• @modular/utils - Reusable utility functions across all apps
• @modular/config - Centralized configuration including database connections and environment variables
The backend follows a strict modular convention: src/modules/<name>/controller, service, route, validator. Routes are auto-discovered and mounted at startup. Prisma handles database access with migrations and seeding.
How the system is shaped
The dynamic RBAC system auto-generates CRUD permissions for every Prisma model (product:create, product:read, etc.). Role-permission mappings live in the database, not in code - granting permissions is a database operation, no deployment needed. A Fastify preHandler decorator enforces permissions on every protected route.
The customer storefront is built with Astro, rendering static HTML by default and hydrating React islands only where interactivity is needed. Product listing pages are fully static (fast, cacheable, SEO-friendly), while the cart and checkout are hydrated React components.
05 / Selected highlights
Selected implementation notes
The decisions and workflows that carry the most explanatory weight.
Turborepo monorepo with parallel builds, dependency-graph-aware task execution, and remote caching - full rebuild in under 60 seconds
Convention-based route auto-registration - autoRegisterRoutes.ts dynamically discovers and mounts all *.route.ts files at startup, zero manual imports needed
Dynamic RBAC with auto-generated CRUD permissions per Prisma model - role-permission mappings stored in the database, no code changes for new entities
Fastify backend with first-class Zod schema validation - compile-time type safety and runtime validation on every route, malformed requests rejected at the framework level
Astro storefront with React islands - static HTML by default, interactive hydration only where needed, near-perfect Lighthouse scores
Shared UI component library (@modular/ui) consumed by both storefront and admin panel with data-attribute theming for different skins
A collaborative task management application with teams, real-time sync, live notifications, and role-based access - built with Next.js 15 and Convex to explore reactive database subscriptions and event-driven communication patterns.
A production-ready microservices architecture with 5 NestJS services (API Gateway, Auth, Users, Products, Payments) communicating entirely through RabbitMQ events, each with its own PostgreSQL database, deployed on Kubernetes with full CI/CD.