Skip to main content
The Exness Trading Platform uses a monorepo architecture with shared packages that provide common functionality across all applications. These packages are located in the packages/ directory and use workspace protocols for internal dependencies.

Available Packages

@repo/config

Configuration management with environment variables, Redis clients, and pub/sub utilities

@repo/db

PostgreSQL database client using Prisma ORM with Accelerate extension

@repo/timescaledb

TimescaleDB client for time-series data with hypertables and continuous aggregates

@repo/types

Shared TypeScript type definitions used across the platform

@repo/ui

React component library with 50+ components built on Radix UI and Tailwind CSS

@repo/utils

Utility functions including email service with Nodemailer

Package Architecture

All packages follow these conventions:

Workspace Dependencies

Packages use the workspace:* protocol to reference other internal packages:
"dependencies": {
  "@repo/config": "workspace:*",
  "@repo/types": "workspace:*"
}

TypeScript Configuration

All packages use TypeScript 5+ and export their main module through the exports field:
"exports": {
  ".": "./src/index.ts"
}

Private Packages

Most packages are marked as private since they’re internal to the monorepo:
"private": true

Common Use Cases

Configuration Management

Use @repo/config for centralized environment variables and Redis connections:
import { config, redisClient } from '@repo/config';

const redis = redisClient(config.REDIS_URL);
await redis.connect();

Database Operations

Use @repo/db for PostgreSQL operations with Prisma:
import { prisma } from '@repo/db';

const user = await prisma.user.findUnique({
  where: { email: '[email protected]' }
});

Time-Series Data

Use @repo/timescaledb for storing and querying trading data:
import { timeScaleDB } from '@repo/timescaledb';

const db = timeScaleDB();
await db.connect();
await db.setupTimescale();

UI Components

Use @repo/ui for consistent React components:
import { Button, Card } from '@repo/ui/components/button';
import { useIsMobile } from '@repo/ui/hooks/use-mobile';

Development

Running Package Scripts

Most packages include a development script:
# Run a specific package in development mode
bun run --filter @repo/config dev

Building Packages

Packages are built automatically by the consuming applications. No separate build step is required due to the TypeScript module resolution.

Adding Dependencies

When adding dependencies to a package, use the appropriate workspace filter:
# Add a dependency to a specific package
bun add <package-name> --filter @repo/config

Best Practices

Choose the right package based on your needs:
  • Configuration and Redis: @repo/config
  • Database queries: @repo/db
  • Time-series data: @repo/timescaledb
  • UI components: @repo/ui
  • Utilities: @repo/utils
Each package should have a single, well-defined responsibility. Don’t add unrelated functionality to existing packages.
Only export what’s necessary through the main index file. Keep implementation details private.
Add JSDoc comments to exported functions, types, and classes for better developer experience.

Next Steps

Config Package

Learn about environment configuration and Redis utilities

Database Package

Explore Prisma integration and database schemas

UI Components

Browse the component library and usage examples

Utils Package

Discover utility functions and helpers

Build docs developers (and LLMs) love