-
Ensure you have Homebrew installed by running
which brewin terminal. If it's not found then you should install it: https://brew.sh/. Runwhich brewagain to check it's found. If it's not you may need to add it your path -
Run
brew install libpulsarto install the C++ libraries that the pulsar-client depends on -
Make sure you have Python installed on your machine by running
which python3in terminal. -
If python isn't found then you should install it: https://www.python.org/downloads/. In a new terminal window run
which python3again. -
Run
npm config set python /the/path/from/the/which/python3/commandinserting the path from step 2 or 3 -
Install node-gyp:
npm install -g node-gyp -
Make sure you have the Xcode command line tools installed by running
xcode-select --installfrom the terminal. If it says they're already installed then you're set. -
Run this in the terminal:
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:$(brew --prefix)/include"
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/3.1.0- Run
pnpm installin the same terminal window.
Warning All the following commands should be launched from the monorepo root directory
-
Install the dependencies.
pnpm install
-
Optionally, if you are testing auth (pizzly) or webhooks (webapp) then you'll need to use ngrok to proxy internet traffic to your local machine
Get access to ngrok and then follow the instructions here to get it setup: https://ngrok.com/download (use homebrew) and make sure to authenticate.
Then run the following scripts to start proxying:
./scripts/proxy-pizzly.sh dan-pizzly-dev ./scripts/proxy-webapp.sh dan-trigger-dev
-
Environment variables. You will need to create copies of the
.env.examplefiles inapp/webappcp ./apps/webapp/.env.example ./apps/webapp/.env
Then you will need to fill in the fields with real values.
You also need to create the
pizzly-server.envfiles under the.dockerdirectory:cp ./.docker/pizzly-server.env.example ./.docker/pizzly-server.env
Next, update the
AUTH_CALLBACK_URLenv var in thepizzly-server.envenv file with the value provided to the./scripts/proxy-pizzly.shcommand. Using the example above theAUTH_CALLBACK_URLwould beAUTH_CALLBACK_URL=https://dan-pizzly-dev.eu.ngrok.io/oauth/callback.If you aren't proxying pizzly according to step 2, then leave the
pizzly-server.envfile empty.If you are proxying the webapp according to step 2 then in
webapp/.env, set theAPP_ORIGINto theNGROK_SUBDOMAINprovided to the./scripts/proxy-webapp.shcommand, e.g.APP_ORIGIN=https://dan-trigger-dev.eu.ngrok.io -
Start postgresql, pulsar, and pizzly server
pnpm run docker:db
Note: The npm script will complete while Docker sets up the container in the background. Ensure that Docker has finished and your container is running before proceeding.
-
Generate prisma schema
pnpm run generate
-
Run the Prisma migration to the database
pnpm run db:migrate:deploy
-
Run the first build (with dependencies via the
...option)pnpm run build --filter=webapp...
Running simply
pnpm run buildwill build everything, including the Remix app. -
Run the Remix dev server
pnpm run dev --filter=webappPIZZLY_HOSTPORT=http://localhost:3004 npx pizzly config:create github github <client-id> <client-secret> "repo,user"Check the turbo.json file to see the available pipelines.
- Run the Cypress tests and Dev
pnpm run test:e2e:dev --filter=webapp
- Lint everything
pnpm run lint
- Typecheck the whole monorepo
pnpm run typecheck
- Test the whole monorepo
pnpm run test or pnpm run test:dev - How to install an npm package in the Remix app ?
pnpm add dayjs --filter webapp
- Tweak the tsconfigs, eslint configs in the
config-packagefolder. Any package or app will then extend from these configs.
- Ensure there are no database migrations to run
pnpm run db:migrate:dev- Generate the Prisma database client
pnpm run generate- Install packages
pnpm install- Build everything
pnpm run build- Install packages again, this makes sure the local packages are linked
pnpm install- Ensure the docker containers are running
pnpm run docker:db- Run the webapp
pnpm run dev --filter=webapp- Run the Web Socket Server
pnpm run dev --filter=wss- Run the @trigger.dev/sdk:dev
pnpm run dev --filter=@trigger.dev/sdk- Run the @trigger.dev integrations
pnpm run dev --filter=@trigger.dev/integrations- Run the smoke test workflow
cd ./examples/smoke-test
pnpm run dev- Running the workflow requires you to send data to the local API.
You can use this cURL command to send a user.created event. This will run the workflow and generate the corresponding logs.
curl --request POST \
--url http://localhost:3000/api/v1/events \
--header 'Authorization: Bearer trigger_dev_zC25mKNn6c0q' \
--header 'Content-Type: application/json' \
--data '{
"name": "user.created",
"payload": {
"id": "123"
}
}'Setup a custom launch configuration for the Warp terminal (docs here) by copying the .warp/triggerdotdev.yaml.example file to ~/.warp/launch_configurations/triggerdotdev.yaml. Make sure you edit the file and replace <your-trigger-dev> and <your-pizzly-dev> with your custom ngrok subdomains.
