For Windows, install WSL and install these within WSL https://docs.microsoft.com/en-us/windows/wsl/install
- git https://git-scm.com/downloads
- Node.JS and npm https://nodejs.org/en/download/
- Docker engine https://www.docker.com/get-started
- Clone repo
- Create .env file in project root and copy paste the contents of
.env.template
in and fill in the values. - Run
docker-compose up -d
to start the development PostgreSQL database + Adminer. - Open adminer to verify the database and adminer started properly. Enter password from .env file. Adminer link
- Run
npm install
to install dependencies. - Run
npx prisma db push
to setup the database with our schema. - Verify by viewing the newly created database 'mydb'. Adminer link
- Run
npx prisma db seed
to insert data into the database that is needed to run the application. (things from Stripe like products/prices) - If you have changes in your prisma design, be sure to run
prisma migrate dev --name <short descriptive name>
before merging * - Verify by viewing the newly created rows in the products table. Adminer link
- Run
npx nx run next:serve
- Run
npx nx run remotion:serve
to start the remotion server
Note: Running locally on windows inside of wsl may cause issues with spawning a local server. Running Get-Service LxssManager | Restart-Service
May need to prefix command with npx
. You can remove the need for npx by properly setting up your path.
Note: This requires twitch-cli repo to be installed https://github.com/twitchdev/twitch-cli
To test stream is online event (streamup) run following command
twitch event verify-subscription streamup -F http://localhost:4200/api/twitch/notification/${twitter-id-here} -s helloWorld
twitch event trigger streamup -F http://localhost:4200/api/twitch/notification/stream.online/${user-id-here} --secret="${secret-here}"
To test stream is offline event (streamdown) run following command
twitch event trigger streamdown -F http://localhost:4200/api/twitch/notification/stream.offline/${user-id-here} --secret="${secret-here}"
https://dev.twitch.tv/docs/eventsub/handling-webhook-events#using-the-cli-to-test-your-handler
If you are dumb enough to do this on windows inside of wsl (like me) here is the steps
If it is just a problem with chromium not being installed, follow this tutorial to install it inside WSL https://scottspence.com/posts/use-chrome-in-ubuntu-wsl
- Follow these instructions to install ffmpeg and all additional requirements for linux https://www.remotion.dev/docs/#additional-step-for-linux-users
- Install chromium-browser in wsl
sudo apt-get install chromium-browser
- Make sure puppeteer is installed
npm install puppeteer
sudo apt-get install -yqq daemonize
sudo apt-get install -yqq dbus-user-session
sudo apt-get install -yqq fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
- This has installed snap on your wsl system, verify running
snap version
sudo snap install chromium
- Good to start the server,
nx run remotion:serve