Deploy: Railway
Overview
Section titled “Overview”Korta is deployed with:
- Frontend on Railway
- Backend on Railway
- Database on Railway
Recommended order:
- Deploy backend firsts.
- Deploy frontend.
- Wire OAuth, CORS, and env vars.
- Run post-deploy checks.
Prerequisites
Section titled “Prerequisites”- GitHub repository connected Railway.
- PostgreSQL database URL available.
- Google OAuth client configured.
- SMTP provider credentials (for email verification).
Backend
Section titled “Backend”- Create a new Web Service from your GitHub repo and set root directory to
backend. - Set runtime env vars:
DATABASE_URLJWT_SECRET(orJWT_SECRET_KEY)FRONTEND_URLCORS_ORIGINSGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_CALLBACK_URLRESEND_API_KEYEMAIL_FROM
- Configure service routing:
- Public path:
/ - Health check path:
/api/v1/health
- Public path:
- Deploy and verify backend URL (example):
https://api.korta.click
Frontend
Section titled “Frontend”- Create/import project from the same repository and set root directory to
frontend. - Set frontend env vars:
VITE_API_URL=https://api.korta.click/api/v1VITE_GOOGLE_AUTH_URL=https://api.korta.click/api/v1/auth/googleVITE_BASE_URL=https://korta.click/
- Deploy and confirm app URL (example):
https://korta.click/
OAuth configuration (Google)
Section titled “OAuth configuration (Google)”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
Post-deploy checks
Section titled “Post-deploy checks”GET https://api.korta.click/api/v1/healthreturns{"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.