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 theworkspace:* protocol to reference other internal packages:
TypeScript Configuration
All packages use TypeScript 5+ and export their main module through theexports field:
Private Packages
Most packages are marked as private since they’re internal to the monorepo:Common Use Cases
Configuration Management
Use@repo/config for centralized environment variables and Redis connections:
Database Operations
Use@repo/db for PostgreSQL operations with Prisma:
Time-Series Data
Use@repo/timescaledb for storing and querying trading data:
UI Components
Use@repo/ui for consistent React components:
Development
Running Package Scripts
Most packages include a development script: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:Best Practices
Use appropriate package for the task
Use appropriate package for the task
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
Keep packages focused
Keep packages focused
Each package should have a single, well-defined responsibility. Don’t add unrelated functionality to existing packages.
Export clean APIs
Export clean APIs
Only export what’s necessary through the main index file. Keep implementation details private.
Document your exports
Document your exports
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