Ivyi Platform Architecture

📑 Table of Contents

Core Documentation

📖 Overview

Ivyi is a revolutionary gifting platform built with modern, scalable architecture following domain-driven design principles. The platform consists of backend API services and frontend web applications that work together to provide seamless celebration and gifting experiences.

🏗️ Overall Architecture

  1. Domain-Driven Design: Clear separation of concerns across business domains
  2. Microservices Approach: Independent backend and frontend services
  3. Type Safety: End-to-end TypeScript integration
  4. API-First: Backend services designed as APIs first
  5. Modern Tooling: Latest development tools and practices

Monorepo Organization

Ivyi/
├── apps/                    # Application services
│   ├── api/                 # Backend API service
│   └── web/                 # Frontend web application
├── packages/                 # Shared packages
│   ├── eslint-config/         # ESLint configurations
│   ├── typescript-config/     # TypeScript configurations
│   └── ui/                  # Shared UI components
├── docs/                     # Platform documentation
├── architecture.md             # This file
├── README.md                  # Platform overview
├── package.json               # Root package configuration
├── turbo.json                 # Turborepo configuration
└── .gitignore                 # Git ignore rules

Application Structure

Backend API (apps/api/)

Frontend Web (apps/web/)

🎯 Core Technologies

Backend Stack

Frontend Stack

Shared Infrastructure

🔄 Data Flow

Data Flow Patterns

  1. User Interactions: Web actions → API requests → Database operations
  2. Real-time Updates: WebSocket connections and SSEs for live updates
  3. Event-Driven: Domain events for cross-system communication
  4. Caching Strategy: Multi-layer caching for performance

📦 Shared Packages

The platform uses a monorepo structure with shared packages that promote code reuse and consistency across applications:

Package Management Strategy

packages/
├── ui/                  # Shared React component library
├── eslint-config/         # ESLint configurations
├── typescript-config/     # TypeScript configurations
└── lib/                  # Shared functionality and 3rd party libraries

@ivyi/ui

@ivyi/lib

@ivyi/eslint-config

@ivyi/typescript-config

Monorepo Benefits

  1. Code Sharing: Shared packages eliminate duplication
  2. Consistent Dependencies: Single source of truth for versions
  3. Unified Tooling: Same linting, formatting, build tools across all packages
  4. Atomic Commits: Changes tracked per package, better change management
  5. Scalable Structure: Easy to add new applications or shared packages
  6. Independent Development: Teams can work on different packages simultaneously

Package Dependencies

apps/api/     → @ivyi/ui (for admin interfaces)
               → @ivyi/lib (shared utilities)
               → @ivyi/eslint-config
               → @ivyi/typescript-config

apps/web/     → @ivyi/ui (component library)
               → @ivyi/lib (API clients)
               → @ivyi/eslint-config
               → @ivyi/typescript-config

Development Workflow

  1. Root-level Commands: Turborepo manages dependencies and scripts across packages
  2. Shared Changes: Made in individual packages, versioned independently
  3. Cross-package Testing: Integration tests ensure compatibility
  4. Consistent Releases: All packages versioned and released together

🔧 Development Tools

Code Quality Stack