Skip to content

Quickstart

  • Node.js 18+ (recommended 20+)
  • pnpm
  • PostgreSQL running locally (or reachable test instance)
  • Google OAuth credentials (optional if you will not test OAuth)
  • Resend API key (production only)
Terminal window
# from repository root
cd backend
pnpm install
cd ../frontend
pnpm install

Use backend defaults from .env.example and frontend local env files:

backend/.env.development
PORT=5000
NODE_ENV=development
DATABASE_URL=postgresql://user:password@localhost:5432/korta
JWT_SECRET=change-me-strong-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CALLBACK_URL=http://localhost:5000/api/v1/auth/google/callback
FRONTEND_URL=http://localhost:5173
# Optional. If unset, backend falls back to FRONTEND_URL.
CORS_ORIGINS=http://localhost:5173
EMAIL_FROM=noreply@korta.click
TRUST_PROXY_HOPS=0
# Optional test/tooling
TEST_DATABASE_URL=postgresql://user:password@localhost:5432/korta_test
SHADOW_DATABASE_URL=postgresql://user:password@localhost:5432/korta_shadow
# Production only
# RESEND_API_KEY=re_your_resend_api_key
frontend/.env.development
VITE_API_URL=http://localhost:5000/api/v1
VITE_GOOGLE_AUTH_URL=http://localhost:5000/api/v1/auth/google
VITE_BASE_URL=http://localhost:5173

Open two terminals:

# terminal 1: backend
cd backend
pnpm prisma:generate:local
pnpm dev:local
Terminal window
# terminal 2: frontend
cd frontend
pnpm dev

Optional local test flow:

Terminal window
cd backend
pnpm prisma:migrate:deploy:test:local
pnpm test:local

Current backend E2E status: 46/46 passing.

  • Open http://localhost:5173 and create an anonymous short URL from landing page.
  • Open http://localhost:5000/api/v1/health and confirm response is:
{"status":"OK"}
  • (Optional) Register/login and test OAuth flow.

Review Environment Variables.