Install dependencies:
npm install
cd client
npm install
cd ..In order to develop your app locally, you can use a webhook proxy URL to forward webhooks from GitHub to your computer or codespace. This app uses Smee.io to provide a webhook proxy URL and forward webhooks.
- In your browser, navigate to https://smee.io/.
- Click Start a new channel.
- Copy the full URL under "Webhook Proxy URL". You will put it in .env in a later step.
Follow GitHub documentation for creating a GitHub App that responds to webhook events:
This app uses Auth0 for authentication with GitHub as the login provider. The frontend uses the Auth0 SPA SDK, and the backend validates JWTs using express-oauth2-jwt-bearer.
-
Create an Auth0 Account & Tenant
- Go to auth0.com and sign up
- Create a new tenant (e.g., my-app.us.auth0.com) — this becomes your
AUTH0_DOMAIN
-
Create a Single Page Application (Frontend)
-
In the Auth0 dashboard, go to Applications → Applications → Create Application
-
Choose Single Page Application
-
Configure the SPA settings: Navigate to the Settings tab and fill in:
- Allowed Callback URLs: http://localhost:5173
- Logout URLs: http://localhost:5173
- Web Origins:http://localhost:5173
- Save changes. Note the Client ID — this is your
VITE_AUTH0_CLIENT_ID. - Set Up GitHub Social Connection
- Go to Authentication → Social → Create Connection
- Select GitHub and deselect everything else
- You'll need a GitHub OAuth App:
- Go to GitHub → Settings → Developer Settings → OAuth Apps → New OAuth App
- Set Homepage URL
- Set Authorization callback URL: https://.auth0.com/login/callback
- Copy the
Client IDandClient Secretinto Auth0's GitHub connection settings
- Make sure GitHub connection is enabled for your SPA
-
-
Create an API (Backend)
- Go to Applications → APIs → Create API
- You can use any URL as an identifier, it doesn't matter. It will be your
AUTH0_AUDIENCEin the backend andVITE_AUTH0_AUDIENCEin the frontend
- Add Action that will add
nicknameclaim to the token payload-
Go to Dashboard - Actions - Library
-
Click
Create Action-Create Custom Action -
Add following script and deploy:
exports.onExecutePostLogin = async (event, api) => { api.accessToken.setCustomClaim( "https://yourapp.com/nickname", event.user.nickname ); };
-
Than go to Actions - Triggers
-
Select
post-logintrigger -
In the workflow, add new custom action between
StartandCompletesteps -
Apply
-
For access to LLMs I used Open Router. To get started:
- Create an Open Router account.
- Buy credits (minimum payment is 5$)
- Get your API key
- Add your key to the
OPENROUTER_API_KEYenv var
Create a .env file in the project root with these values:
APP_ID=<your-github-app-id>
WEBHOOK_SECRET=<your-webhook-secret>
GITHUB_PRIVATE_KEY_PATH=<path-to-your-private-key-file>
WEBHOOK_PROXY_URL="https://smee.io/<your-channel>"
OPENROUTER_API_KEY="YOUR_KEY"
DATABASE_USER=
DATABASE_PASSWORD=
DATABASE_NAME=
DATABASE_URL="postgres://YourUser:YourPassword@localhost:5432/YourDatabaseName"
AUTH0_DOMAIN="your-tenant-domain"
AUTH0_AUDIENCE="your-audience"
BASE_URL="http://localhost:5173"For the frontend, copy the example environment file in the client folder and add all credentials
Start the db:
docker compose up -dRun migrations:
npm run migrate upStart the backend in watch mode:
npm run devThe backend should be available on http://localhost:3000 by default.
To receive GitHub webhooks locally, in a second terminal, run:
npm run webhookThis uses your .env values and forwards webhooks to http://localhost:3000/api/webhook.
To start the frontend application: In another terminal run:
cd client
npm run devThe frontend is served by Vite at http://localhost:5173 by default.
Run unit tests with Vitest:
npm testRun type checking:
npm run typeCheckIn production, you do not need a webhook proxy.
For production GitHub App setup, use GITHUB_PRIVATE_KEY with the raw .pem content instead of GITHUB_PRIVATE_KEY_PATH.
- Add New Resource, select Public Repository, and point to this GitHub repository. Add all variables from
.env.example.prodUse these commands to build and start the backend:
npm run build
npm run migrate up && npm run start- To deploy the frontend
- Create another recourse
- Check both:
Is it a static site?Is it a SPA (Single Page Application)?
- set
Base directoryto/client - set
Publish Directoryto/dist - add env vars