This template ships with backend routes for three external services: GitHub, Google, and Pike 13. All routes degrade gracefully — the server starts and serves traffic with zero integration credentials configured.
Browser → /api/auth/github → Passport GitHub OAuth → session
→ /api/auth/google → Passport Google OAuth → session
→ /api/github/repos → GitHub API (user token from session)
→ /api/pike13/events → Pike 13 API (server-side token)
→ /api/pike13/people → Pike 13 API (server-side token)
→ /api/integrations/status → reports which services are configured
→ /api/auth/me → current user (any provider)
→ /api/auth/logout → destroy session
All routes return 501 with a docs URL when the required credentials
are not configured.
Setup: https://github.com/settings/developers (Create an OAuth App under your GitHub account or organization.)
OAuth docs: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app
| Setting | Value |
|---|---|
| Environment variables | GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET |
| Callback URL (dev) | http://localhost:5173/api/auth/github/callback |
| Callback URL (prod) | https://<app>.jtlapp.net/api/auth/github/callback |
| Scopes requested | read:user, user:email |
Routes:
| Method | Path | Description |
|---|---|---|
| GET | /api/auth/github |
Initiates OAuth redirect |
| GET | /api/auth/github/callback |
Handles callback, stores user in session |
| GET | /api/github/repos |
Returns authenticated user's repositories |
Setup: https://console.cloud.google.com/apis/credentials (Create an OAuth 2.0 Client ID. You will need to configure the consent screen first.)
OAuth docs: https://developers.google.com/identity/protocols/oauth2/web-server
Consent screen: https://developers.google.com/identity/protocols/oauth2/web-server#creatingclient
| Setting | Value |
|---|---|
| Environment variables | GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET |
| Callback URL (dev) | http://localhost:5173/api/auth/google/callback |
| Callback URL (prod) | https://<app>.jtlapp.net/api/auth/google/callback |
| Scopes requested | profile, email |
Routes:
| Method | Path | Description |
|---|---|---|
| GET | /api/auth/google |
Initiates OAuth redirect |
| GET | /api/auth/google/callback |
Handles callback, stores user in session |
App registration: https://developer.pike13.com (Register an application to obtain client credentials.)
Authentication docs: https://developer.pike13.com/docs/authentication
API docs: https://developer.pike13.com/docs/get_started
Pike 13 implements a standard OAuth 2.0 authorization code flow:
- Direct users to the authorization endpoint to grant access
- Receive an authorization code at your callback URL
- Exchange the code for an access token at the token endpoint
Pike 13 access tokens do not expire, so no refresh token logic is needed. However, tokens can be revoked, so handle 401 responses gracefully.
| Setting | Value |
|---|---|
| Environment variables | PIKE13_CLIENT_ID, PIKE13_CLIENT_SECRET, PIKE13_ACCESS_TOKEN |
| Authorization endpoint | https://pike13.com/oauth/authorize (or https://BUSINESS.pike13.com/oauth/authorize) |
| Token endpoint | https://pike13.com/oauth/token |
| Callback URL (dev) | http://localhost:5173/api/auth/pike13/callback |
| Callback URL (prod) | https://<app>.jtlapp.net/api/auth/pike13/callback |
| API base URL (default) | https://pike13.com/api/v2/desk |
| API base URL (override) | Set PIKE13_API_BASE for subdomain-specific businesses |
Authorization request parameters:
| Parameter | Value |
|---|---|
client_id |
Your PIKE13_CLIENT_ID |
response_type |
code |
redirect_uri |
Your callback URL (must match registered value exactly) |
Token exchange parameters:
| Parameter | Value |
|---|---|
grant_type |
authorization_code |
code |
The authorization code from the callback |
redirect_uri |
Same callback URL used in the authorization request |
client_id |
Your PIKE13_CLIENT_ID |
client_secret |
Your PIKE13_CLIENT_SECRET |
Routes:
| Method | Path | Description |
|---|---|---|
| GET | /api/pike13/events |
This week's event occurrences |
| GET | /api/pike13/people |
First page of people |
| Method | Path | Description |
|---|---|---|
| GET | /api/auth/me |
Returns current user or 401 |
| POST | /api/auth/logout |
Destroys session |
| GET | /api/integrations/status |
Reports which services are configured |
Credentials flow through the secrets pipeline documented in secrets.md:
- Add values to
config/dev/secrets.env(encrypted with SOPS + age) - Run
./scripts/install.shto decrypt into.env - The server reads
.envviadotenvat startup - In production: secrets are Docker Swarm secrets loaded by
docker/entrypoint.sh
See config/dev/secrets.env.example for the full list of available variables.
The example integration page (client/src/pages/ExampleIntegrations.tsx)
is designed to be deleted. To remove it:
- Delete
client/src/pages/ExampleIntegrations.tsx - Revert
client/src/App.tsxto your application's root component - Optionally delete
client/src/App.cssif unused
The backend routes (auth.ts, github.ts, pike13.ts,
integrations.ts) remain available for your application to use.
Before deploying to production:
-
Create Swarm secrets for any integrations you use:
github_client_id,github_client_secretgoogle_client_id,google_client_secretpike13_access_token
-
Set callback URLs in each provider's settings to use your production domain (e.g.,
https://myapp.jtlapp.net/api/auth/github/callback) -
Remove or replace
ExampleIntegrations.tsxwith your actual application UI