Getting Started
This section will help you set up your development environment and get started with Open Chat Studio.
Development Environment Setup
Open Chat Studio uses UV and Invoke for dev automation.
Prerequisites
- Python 3.11 (recommended)
- Node.js >= 22.14.0
- Docker and Docker Compose
- Git
Installation Steps
-
Clone the repository
git clone https://github.com/dimagi/open-chat-studio.git cd open-chat-studio
-
Install dependencies
uv venv --python 3.11 source .venv/bin/activate uv sync
-
Run the automated setup
inv setup-dev-env
This will: - Install pre-commit hooks - Start database and Redis services - Run database migrations - Build frontend resources - Create a superuser
Manual steps
Install the pre-commit hooks
pre-commit install --install-hooks
Set up database
Start the database and redis services and run the DB migrations:
inv up # start the docker services cp .env.example .env ./manage.py migrate
Build the front-end resources
To build JavaScript and CSS files, first install npm packages:
inv npm --install # or npm install npm run dev
Note
You should be using node >= 22.14.0. If you have nvm installed, you can run
nvm use
to switch to the correct version.To check which version you are using use
node --version
.Create a superuser
./manage.py createsuperuser
-
Start the development server
./manage.py runserver
-
Run Celery for background tasks
Celery is required to handle LLM interactions. Run it using:
inv celery
For a production-like setup, use:
inv celery --gevent
Common Development Tasks
Running Tests
pytest
Or to test a specific app/module:
pytest apps/utils/tests/test_slugs.py
Updating Translations
inv translations
Linting and Formatting
The project uses ruff for linting and formatting:
inv ruff
Updating Requirements
inv requirements
To add a new requirement:
uv add <package-name>
# for dev / prod dependencies
uv add <package-name> --group [dev|prod]
Next Steps
- Learn how to Contribute to the project