Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-ollama-crontab/llms.txt

Use this file to discover all available pages before exploring further.

backtest-ollama-crontab requires three infrastructure components: MongoDB (persistent document storage for parsed and screened items), Redis (job queue and caching layer), and an Ollama instance (local or remote LLM inference). Two ready-to-use Docker Compose files are provided under docker/mongodb/ and docker/redis/ so you can get a fully working local stack running with a single command each. Prerequisites: Docker Desktop or Docker Engine with the Compose plugin installed and running.

MongoDB

The MongoDB service runs version 8.0.4 using the official community server image on UBI 8.
docker/mongodb/docker-compose.yaml
version: '3.8'
services:
  mongodb:
    image: mongodb/mongodb-community-server:8.0.4-ubi8
    container_name: mongodb
    ports:
      - '27017:27017'
    volumes:
      - ./mongo_data:/data/db
    restart: always
volumes:
  mongo_data:
Start it with:
docker compose -f docker/mongodb/docker-compose.yaml up -d
Data is persisted to ./docker/mongodb/mongo_data/ on your host filesystem, so the database survives container restarts. Mongoose creates the application collections automatically on first use — you do not need to run any migrations:
CollectionPurpose
parser-itemsRaw messages fetched from Telegram channels
screen-itemsScreened and scored trading signals

Redis

The Redis service runs version 7.4.1 with password authentication enforced via the --requirepass flag.
docker/redis/docker-compose.yaml
version: '3.8'

services:
  redis:
    image: redis:7.4.1
    container_name: redis
    ports:
      - "6379:6379"
    environment:
      - REDIS_PASSWORD=mysecurepassword
    command: ["redis-server", "--requirepass", "mysecurepassword"]
    volumes:
      - ./redis_data:/data
    restart: always

volumes:
  redis_data:
Start it with:
docker compose -f docker/redis/docker-compose.yaml up -d
Redis data is persisted to ./docker/redis/redis_data/. The default password is mysecurepassword — ensure the CC_REDIS_PASSWORD environment variable in your .env file matches this value. If you change the password in the Compose file, update the env var as well. See the Environment guide for the full variable reference.

Verify Connections

After both services start, confirm they are reachable before running the application. MongoDB — open a mongosh shell inside the container:
docker exec -it mongodb mongosh
Then inside the shell, switch to the application database and list collections (they appear after the first run):
use backtest-kit
show collections
Redis — send a PING command:
docker exec -it redis redis-cli -a mysecurepassword ping
A successful connection returns:
PONG
When MongoDB and Redis run inside Docker but the Node.js process runs directly on your host machine (i.e. outside any container), use host.docker.internal as the hostname in your .env file instead of localhost or 127.0.0.1. Docker routes host.docker.internal from inside containers to the host network, and on macOS/Windows Docker Desktop exposes it in the reverse direction as well. The provided .env.example already sets both CC_REDIS_HOST and CC_MONGO_CONNECTION_STRING to use host.docker.internal for exactly this reason.

Ollama Setup

Ollama provides the local LLM inference backend. The application uses the model gpt-oss:120b (configured in ollama_outline_format.completion.ts). Install Ollama from ollama.com, then pull the required model:
ollama pull gpt-oss:120b
The initial download is large; subsequent starts reuse the cached weights. Once running, Ollama listens locally and the application connects to https://ollama.com as configured in packages/core/src/config/ollama.ts. The CC_OLLAMA_TOKEN bearer token is always included in every request header. Set the CC_OLLAMA_TOKEN environment variable to your API bearer token:
.env
CC_OLLAMA_TOKEN=sk-your-cloud-token-here
The Ollama client in packages/core/src/config/ollama.ts automatically includes this token in the Authorization header of every request.

Build docs developers (and LLMs) love