Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-docs-audit-1776071666.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Development Environment Setup
Comprehensive instructions for establishing a local development environment for CoW Protocol’s Backend For Frontend (BFF) services, which uses an NX monorepo architecture.Prerequisites
The setup requires three foundational tools:-
Node.js 20.x - Install via nvm:
-
Yarn - Install globally as the package manager:
- Docker - Required for running databases, message queues, and other containerized services
Initial Setup
Clone and Install
Environment Configuration
.env file:
- RPC URLs for blockchain networks (Ethereum mainnet, Gnosis Chain, Arbitrum)
- Database credentials for PostgreSQL
- Optional: Redis and RabbitMQ settings
.env for running services locally via NX commands, and .env.docker when running services through Docker Compose.
Infrastructure Services
Docker Compose manages the project’s infrastructure:Database Migrations
After the database service starts, run migrations:Development Workflow
Starting Services
Project Architecture
The monorepo organizes code into:Applications (/apps/)
- API - Main HTTP API server
- Telegram - Telegram bot consumer
- TWAP - Time-weighted average price service
- Notification Producer - Blockchain event monitor
Shared Libraries (/libs/)
- Repositories - Data access layer
- Services - Business logic
- Shared - Common utilities and types
- Notifications - Notification templates
- Smart Contract ABIs - Contract interfaces
TypeScript Path Aliases
The project uses TypeScript path aliases for module imports:Common Issues
TypeORM Driver Error
If you encounterpg package resolution errors: