Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontend local dev script for Clickhouse development #4891

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

alexkim205
Copy link
Contributor

@alexkim205 alexkim205 commented Jun 28, 2021

Changes

When I want to make frontend changes with Clickhouse, hot reloading doesn't work quite as you expect it to when running the frontend in a docker image. For every frontend change, the frontend app reloads 10-11 times so you have to wait 1-2min for every reload which makes for a suboptimal dx.

Let's make a equivalent docker-backend.sh script for Clickhouse, so that devs can spin up a local React application that can talk to a dockerized backend. I also added a one-liner script in package.json that you can run to get a dockerized backend and local frontend up and running in no time.

Also requires doc updates in this PR

Steps

  1. yarn start-ch-dev

To quit everything

  1. Ctrl/Cmd+C
docker compose -f ee/docker-compose.ch.yml down
DEBUG=1;DJANGO_SETTINGS_MODULE=posthog.settings;PRIMARY_DB=clickhouse;CLICKHOUSE_HOST=clickhouse;CLICKHOUSE_DATABASE=posthog;CLICKHOUSE_SECURE=false;CLICKHOUSE_VERIFY=false python migrate.py migrate_clickhouse

@alexkim205 alexkim205 self-assigned this Jun 28, 2021
@timgl timgl temporarily deployed to posthog-pr-4891 June 28, 2021 19:25 Inactive
@timgl timgl temporarily deployed to posthog-pr-4891 June 28, 2021 19:30 Inactive
@alexkim205 alexkim205 requested review from mariusandra and liyiy June 28, 2021 19:42
@alexkim205
Copy link
Contributor Author

Merging this because there is no impact with a few more dev scripts ;). Also need this for my PR's and it's getting painful to git stash all the time

@alexkim205 alexkim205 merged commit d36b15e into master Jun 29, 2021
@alexkim205 alexkim205 deleted the chore/easier-clickhouse-frontend-dev branch June 29, 2021 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants