Skip to content

Deploy: Railway

Korta is deployed with:

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

Recommended order:

  1. Deploy backend firsts.
  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.
  • SMTP provider credentials (for email verification).
  1. Create a new Web Service from your GitHub repo and set root directory to backend.
  2. Set runtime env vars:
    • DATABASE_URL
    • JWT_SECRET (or JWT_SECRET_KEY)
    • FRONTEND_URL
    • CORS_ORIGINS
    • GOOGLE_CLIENT_ID
    • GOOGLE_CLIENT_SECRET
    • GOOGLE_CALLBACK_URL
    • RESEND_API_KEY
    • EMAIL_FROM
  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.