GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - serdarceran/github-demo: A Simple Demo for GitHub

BranchesTags
Open more actions menu

Latest commit

 

History

58 Commits
58 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.playwright-mcp
.playwright-mcp
 
 
app
app
 
 
components
components
 
 
hooks
hooks
 
 
lib
lib
 
 
prisma
prisma
 
 
types
types
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
instrumentation.ts
instrumentation.ts
 
 
next-env.d.ts
next-env.d.ts
 
 
next.config.js
next.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
postcss.config.js
postcss.config.js
 
 
start.txt
start.txt
 
 
tailwind.config.ts
tailwind.config.ts
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.tsbuildinfo
tsconfig.tsbuildinfo
 
 

Repository files navigation

github-demo

A Simple Demo for GitHub

Getting started

Local dev

1. Start PostgreSQL

docker-compose up -d

2. Run migrations (creates tables)

npm run db:migrate # prompts for a migration name

3. Start the app

npm run dev

Production (Hetzner VM)

  1. Edit .env on the VM, switch the DATABASE_URL to point at the VM's PostgreSQL.
  2. Run npm run db:migrate:prod — this runs prisma migrate deploy (no prompts, safe for CI/CD).

Switching environments

Only the DATABASE_URL in .env needs to change. Comment/uncomment the appropriate line:

Local

DATABASE_URL="postgresql://goaltracker:goaltracker@localhost:5432/goaltracker"

Production (Hetzner)

DATABASE_URL="postgresql://goaltracker:@:5432/goaltracker"


Architecture

Browser (useGoals hook) │ client-side penalty logic runs here │ optimistic UI updates │ ├── GET /api/goals?username=X → load goals + logs ├── POST /api/goals → create goal ├── PATCH /api/goals/[id] → update goal state after logging ├── POST /api/goals/[id]/logs → upsert daily log entry └── DELETE /api/goals/[id] → delete goal

API Routes (server-only) └── lib/db.ts (Prisma singleton) └── PostgreSQL


Deploying to Vercel

1. Push your code to GitHub

Your repository must be hosted on GitHub, GitLab, or Bitbucket before importing into Vercel.

2. Provision a PostgreSQL database

Choose one of the following options:

  • Vercel Postgres (easiest): In your Vercel dashboard go to Storage → Create Database → Postgres. It automatically sets the DATABASE_URL environment variable.
  • Neon (free tier): Create a project at neon.tech and copy the connection string.
  • Supabase (free tier): Create a project at supabase.com and copy the connection string.

3. Import the project on Vercel

  1. Go to vercel.com → "Add New Project"
  2. Import your GitHub repository
  3. Vercel auto-detects Next.js — no framework configuration needed

4. Set environment variables

In your Vercel project settings → Environment Variables, add:

DATABASE_URL=postgresql://user:password@host:5432/dbname?sslmode=require

Most managed Postgres providers require ?sslmode=require at the end of the connection string.

5. Configure the build command to run migrations

In Vercel project settings → Build & Development Settings, set the Build Command to:

prisma generate && prisma migrate deploy && next build

Alternatively, add a vercel.json file at the project root:

{
  "buildCommand": "prisma generate && prisma migrate deploy && next build"
}

This runs prisma migrate deploy (not migrate dev), which applies existing migrations non-interactively — the correct mode for production.

6. Deploy

Trigger a deployment. Vercel will run the build command, apply database migrations, and publish the app.

Notes:

  • Always use prisma migrate deploy in production, never prisma migrate dev.
  • If you experience connection issues at scale, consider using Prisma Accelerate or a connection pooler such as PgBouncer, as Vercel's serverless functions can open many short-lived database connections.

About

A Simple Demo for GitHub

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.