Source code for anishshobithps.com: a portfolio, blog, and guestbook. Interfaces, bots, and questionable automation scripts, mostly so I don't have to repeat myself.
bun install
bun run drizzle-kit push # sets up the database tables
bun dev # http://localhost:3000You'll need a few things first:
| What | Where |
|---|---|
| PostgreSQL | neon.tech (free tier works) |
| Auth | clerk.com (for guestbook & comments) |
| Spotify | run scripts/get-spotify-refresh-token.ts once |
Create .env.local at the root:
DATABASE_URL=postgresql://...
IP_HASH_SALT=some-random-secret # optional, defaults to "blog-salt"
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
SPOTIFY_REFRESH_TOKEN=
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
OWNER_CLERK_USER_ID=user_... # your user ID = admin powers
CLERK_WEBHOOK_SECRET=whsec_... # Clerk > Webhooks > Signing Secret
NEXT_PUBLIC_BASE_URL=https://anishshobithps.com
NEXT_PUBLIC_UMAMI_WEBSITE_ID=... # optional, or remove from layout.tsxClerk webhook: point https://yourdomain.com/api/webhooks/clerk at user.deleted to keep the DB clean when users delete their accounts.
bun run build # push schema + next build
bun start # production server
bun run types:check # tsc --noEmit
bun run lint # ESLintAdd the env vars, point DATABASE_URL at Neon, done. The build command runs drizzle-kit push before next build, so schema is always up to date on deploy.