Skip to content

Architecture Overview

Trove is a multi-tenant B2B gifting platform built as a TypeScript monorepo. It connects brands (vendors) with gift recipients through a storefront-based model, with platform operations managed through an admin portal and background processing handled by an asynchronous worker service.


System Components

The platform is made up of four main applications:

Application Description
API NestJS 11 + Fastify REST API - the core backend serving all platform data and business logic
Admin Portal React 18 + Vite 6 single-page application - the brand-facing management interface
Customer Frontend React 18 + Vite 6 - the storefront experience presented to gift recipients
Worker NestJS async job processor - handles background tasks via AWS SQS queues

All applications live in a single Nx monorepo and share common libraries for data access, types, and utilities.


High-Level Architecture

                        ┌─────────────────┐
                        │   Admin Portal   │  {vendor}.trove.com
                        │  React + Vite    │
                        └────────┬────────┘
              ┌──────────────────▼──────────────────┐
              │              NestJS API              │
              │         (Fastify, REST, JWT)         │
              └──────┬──────────────────┬───────────┘
                     │                  │
          ┌──────────▼──────┐  ┌────────▼────────┐
          │   MySQL 8 DB    │  │   AWS SQS Queue  │
          │   (MikroORM)    │  └────────┬─────────┘
          └─────────────────┘           │
                                ┌───────▼────────┐
              ┌─────────────────┤  Worker Service │
              │  AWS S3 (files) │  (NestJS, SQS   │
              │  AWS KMS (keys) │   polling)      │
              └─────────────────┴────────────────┘

         ──────────────── Third-Party Integrations ────────────────
         Auth0 (identity) · Stripe Connect (payments) · Shopify
         (OAuth + webhooks) · Xero (invoicing) · Sentry (errors)
         Microsoft Clarity (analytics) · Slack (notifications)

Infrastructure

Trove runs on AWS, managed through DuploCloud for environment configuration and deployment orchestration.

Layer Technology
Hosting AWS (DuploCloud-managed)
Object storage AWS S3
Message queuing AWS SQS
Encryption keys AWS KMS
CI/CD GitHub Actions
Error monitoring Sentry

Authentication

Authentication is handled by Auth0 with JWT tokens verified by the API. The platform uses five distinct token types to separate concerns across vendors, recipients, and internal administration:

  • Vendor (brand) sessions
  • Recipient access
  • Admin access
  • Shopify OAuth flow
  • Xero OAuth flow

Data Layer

  • Database: MySQL 8
  • ORM: MikroORM with a migration-based schema managed in the database/ directory (150+ migrations)
  • Seed data: 37+ seeders for development and staging environment setup

Third-Party Integrations

Integration Purpose
Auth0 Identity and authentication
Stripe Connect Payment processing and vendor payouts
Shopify OAuth integration and webhook processing for product sync
Xero Invoice generation and accounting
Sentry Error tracking and performance monitoring
Microsoft Clarity Session recording and analytics
Slack Internal operational notifications