Skip to content

Deploy: Railway

Korta is deployed with:

  • Frontend on Railway
  • Backend on Railway
  • Database on Railway

Recommended order:

  1. Deploy backend first.
  2. Deploy frontend.
  3. Wire OAuth, CORS, and env vars.
  4. Run post-deploy checks.
  • GitHub repository connected Railway.
  • PostgreSQL database URL available.
  • Google OAuth client configured.
  • Resend API key (required in production).
  1. Create a new Web Service from your GitHub repo and set root directory to backend.
  2. Set runtime env vars:
    • Required core: DATABASE_URL, JWT_SECRET (or JWT_SECRET_KEY), GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_CALLBACK_URL
    • Production-required: RESEND_API_KEY
    • Optional/recommended: FRONTEND_URL, CORS_ORIGINS, EMAIL_FROM, TRUST_PROXY_HOPS=1
    • Optional test/tooling: TEST_DATABASE_URL, SHADOW_DATABASE_URL
  3. Configure service routing:
    • Public path: /
    • Health check path: /api/v1/health
  4. Deploy and verify backend URL (example):
    • https://api.korta.click
  1. Create/import project from the same repository and set root directory to frontend.
  2. Set frontend env vars:
    • VITE_API_URL=https://api.korta.click/api/v1
    • VITE_GOOGLE_AUTH_URL=https://api.korta.click/api/v1/auth/google
    • VITE_BASE_URL=https://korta.click
  3. Deploy and confirm app URL (example):
    • https://korta.click/

Set in Google Cloud OAuth client:

  • Authorized JavaScript origins:
    • https://korta.click
  • Authorized redirect URIs:
    • https://api.korta.click/api/v1/auth/google/callback

Ensure backend env matches:

  • GOOGLE_CALLBACK_URL=https://api.korta.click/api/v1/auth/google/callback
  • GET https://api.korta.click/api/v1/health returns {"status":"OK"}.
  • Landing page can create anonymous short links.
  • Login and Google OAuth callback both complete successfully.
  • Dashboard can fetch links and API key endpoints.
  • No CORS errors in browser console for production domain.