Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Example environment variables for CHAI project
# Copy this file to .env and adjust values as needed

# Database connection
CHAI_DATABASE_URL=postgresql://postgres:s3cr3t@localhost:5435/chai
PGPASSWORD=s3cr3t

# Scheduler
ENABLE_SCHEDULER=true
FREQUENCY=24

# Pipeline behavior
TEST=false
FETCH=true
NO_CACHE=false

# Docker service variables
# (uncomment and set as needed)
# SERVICE=package_managers

# Other environment variables can be added below as needed
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# CHAI
[![CI](https://github.com/teaxyz/chai/actions/workflows/ci.yml/badge.svg)](https://github.com/teaxyz/chai/actions/workflows/ci.yml)

CHAI is an attempt at an open-source data pipeline for package managers. The
goal is to have a pipeline that can use the data from any package manager and
Expand Down Expand Up @@ -102,6 +103,30 @@ There are many other potential use cases for this data:
will connect you to the database.
2. If you're orchestrating via docker, swap `localhost` for `host.docker.internal`

## Troubleshooting / Common Errors

### Docker Compose fails to start db
- Make sure port 5435 is not already used by another service.
- If you get a permission error on the data folder, run your terminal as administrator or fix the permissions for the `./data` folder.

### Migration error (alembic)
- Ensure you have run `docker compose build --no-cache db alembic` before `docker compose up alembic`.
- Check that the `CHAI_DATABASE_URL` environment variable is set correctly.

### Database connection refused
- Make sure the `db` service is healthy before starting other services.
- If you are using Docker Desktop on Windows/Mac, use `host.docker.internal` as the database host.

### Out of disk space
- Fetching package manager data can consume more than 5GB. Ensure you have enough storage before running the pipeline.

### Permission denied when deleting ./data
- Run `rm -rf ./data` with administrator/root privileges.

### Service stuck or not responding
- Check logs with `docker compose logs <service>` to see detailed errors.
- Restart the service with `docker compose restart <service>`.

## Managing Dependencies

We use [`uv`](https://astral.sh/uv) to manage dependencies (and sometimes execution).
Expand Down
6 changes: 6 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Example environment variables for CHAI API service
# Copy this file to .env and adjust values as needed

DATABASE_URL=postgresql://postgres:s3cr3t@localhost:5435/chai
HOST=0.0.0.0
PORT=8080
Loading