- Node.js LTS (>v20.x)
- pnpm (> 9.8.0)
- An Heroku account
- Heroku CLI
- PostgreSQL psql client
- Redis server (for chat memory)
- Heroku AI CLI
- Heroku Managed Inference and Agents MIA
Install pnpm
corepack install -g pnpm@latestNote
If corepack is not installed you can run npm install -g corepack
Install dependencies by running:
Warning
Don't mix pnpm and npm, pnpm is more performant and have better cache
pnpm installCreate an Heroku application with:
heroku create <app-name>Install the Heroku PostgreSQL addon:
heroku addons:create heroku-postgresql:essential-0Install the Heroku Key-Value Store addon:
heroku addons:create heroku-redis:miniOnce the PostgreSQL database is created, setup the database schema with:
node data/migration.jsInstall the Heroku Inference addon
Note
Make sure the Heroku AI CLI plugin is installed with heroku plugins:install @heroku/plugin-ai
heroku ai:models:create claude-3-7-sonnet --as inference -a <app-name>Make sure to fetch the configuration to your local project by running:
heroku config --shell > .envSeed the database with mock data by running:
node data/seed.jsRun the project locally with:
pnpm run devBefore running the project, you need to set up the environment variables.
Note
For a complete list of required environment variables, please refer to the sample .env file included in the repository.
For JWT authentication you need a public/private key pair. You can generate these keys using OpenSSL by running:
openssl genpkey -algorithm RSA -out private.key -pkeyopt rsa_keygen_bits:2048openssl rsa -pubout -in private.key -out public.keyThese commands will create two files (private.key and public.key) in your repository with the values stored inside.
To manually deploy to Heroku you can run:
git push heroku main