Skip to content

Repository files navigation

Ukrainium

A Next.js 14 + PostgreSQL application deployed on Railway.

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Database: PostgreSQL
  • ORM: Prisma 5
  • Auth: Custom session-based auth with bcryptjs
  • Styling: Tailwind CSS
  • Hosting: Railway

Quick Start

Local Development

  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your local PostgreSQL credentials
  1. Generate Prisma client and run migrations:
npx prisma generate
npx prisma migrate dev
  1. Run the development server:
npm run dev

Visit http://localhost:3000

Railway Deployment

Prerequisites

  • Railway CLI installed
  • GitHub account with Railway app authorized

Deploy Steps

  1. Create GitHub repository:
gh repo create fidgetbot/ukrainium --public --source=. --push
  1. Install Railway CLI:
brew install railway
railway login
  1. Create Railway project:
railway init
  1. Add PostgreSQL service: In Railway dashboard, click "New" → "Database" → "Add PostgreSQL"

  2. Link your service:

railway service link ukrainium
  1. Set environment variables:
# Get DATABASE_URL from Railway PostgreSQL service
railway variable set DATABASE_URL="your-postgresql-url"
railway variable set AUTH_SECRET="your-secret-key-min-32-chars"
railway variable set NODE_ENV=production
  1. Deploy:
railway up
  1. Run database migrations:
railway run npm run migrate:deploy
  1. Get your public URL:
railway domain

Auto-deploy from GitHub

Once set up in Railway dashboard, pushing to GitHub will auto-deploy:

git add .
git commit -m "Your changes"
git push

Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run migrate:deploy - Deploy database migrations
  • npm run db:transcriptions - Recompute and backfill word transcriptions
  • npx prisma studio - Open Prisma database GUI

Updating Transcriptions

If the transcription rules change, update prisma/seed-transcriptions.ts and rerun:

python3 -m venv .venv-stress
source .venv-stress/bin/activate
pip install ukrainian-word-stress
npm run db:transcriptions

To update the Railway production database after deploy, run the same backfill script in Railway's environment so it uses the production DATABASE_URL:

railway run --service ukrainium npm run db:transcriptions

This updates the stored transcription values in PostgreSQL directly. No schema migration is needed.

Features

  • User registration & login
  • Session-based authentication
  • Protected dashboard
  • PostgreSQL persistence
  • Railway-ready deployment

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages