The monorepo ships two self-containedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-monorepo-parallel/llms.txt
Use this file to discover all available pages before exploring further.
docker-compose files — one for MongoDB 8 (docker/mongodb/docker-compose.yaml) and one for Redis 7 (docker/redis/docker-compose.yaml). Both services are prerequisites for every run mode: MongoDB stores candle data, position state, and session records, while Redis acts as an O(1) lookup cache that sits in front of every Mongo read on the hot path.
MongoDB
The MongoDB compose file pins the image to the official Community Server build8.0.4-ubi8, exposes the default port, and mounts a local mongo_data volume so candle data survives container restarts.
docker/mongodb/docker-compose.yaml
- Image:
mongodb/mongodb-community-server:8.0.4-ubi8— MongoDB 8.0.4 on UBI 8. - Port:
27017:27017— the standard Mongo port, mapped 1-to-1 from host to container. - Volume:
./mongo_data:/data/db— candle cache and all collection data persist here. restart: always: the container comes back up automatically after a host reboot.
Redis
The Redis compose file pins toredis:7.4.1, sets a password via both an environment variable and the --requirepass server flag, and mounts a redis_data volume.
docker/redis/docker-compose.yaml
- Image:
redis:7.4.1— Redis 7.4.1 stable. - Port:
6379:6379— the standard Redis port. - Password:
mysecurepassword— set in bothenvironmentand the servercommand. Must matchCC_REDIS_PASSWORDin your.env. - Volume:
./redis_data:/data— AOF / RDB snapshots persist here between restarts.
Starting Both Services
Run these two commands from the repo root to bring both containers up in detached mode:Verifying Connectivity
MongoDB — inspect the container logs and look for theWaiting for connections message, which confirms the server is ready to accept clients:
PING through the CLI inside the container. The -a flag supplies the password:
The
.env.example file sets CC_REDIS_HOST=host.docker.internal. This is the correct value for Docker Desktop on Mac and Windows, where containers and the host are on separate network namespaces. On Linux (where Docker runs natively on the host network), use CC_REDIS_HOST=127.0.0.1 — this is already the default in packages/core/src/config/params.ts.Port Reference
| Service | Default Port | Config Key |
|---|---|---|
| MongoDB | 27017 | CC_MONGO_CONNECTION_STRING |
| Redis | 6379 | CC_REDIS_PORT |
| backtest-kit UI | 60050 | — (fixed, served by @backtest-kit/ui) |
Data Persistence
Both compose files declare named volumes (mongo_data, redis_data). These volumes are not deleted when you run docker-compose down — your candle cache, session data, and Redis snapshots survive a normal stop/start cycle.
To wipe all stored data and start from scratch, pass the -v flag:
Building the Workspace Packages
Once infrastructure is running, build the monorepo packages before starting any run mode.Install root dependencies
Run
npm install at the repository root. This installs the workspace tooling and links all packages/* together via npm workspaces.Build all packages
Choose the command that matches your platform:Both scripts walk every directory under
packages/, enter each one, and run npm run build inside it (which invokes rollup -c). The Linux script also runs npm install in each package directory before building; the Windows script skips the per-package install and assumes dependencies are already satisfied by the root npm install:Verify build artifacts
Each package emits two artifacts after a successful build:
For example, after building
| Artifact | Purpose |
|---|---|
packages/<pkg>/build/index.cjs | CommonJS bundle consumed at runtime via config/alias.config.ts |
packages/<pkg>/types.d.ts | Rolled-up declaration bundle consumed at compile-time via tsconfig.json paths |
@pro/core you will find: