Skip to content

anishshobithps/anishshobithps.com

Repository files navigation

anishshobithps.com

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.

GitHub Stars GitHub Forks Last Commit

License

Next.js React TypeScript Tailwind CSS Drizzle PostgreSQL Bun ESLint


Running locally

bun install
bun run drizzle-kit push   # sets up the database tables
bun dev                    # http://localhost:3000

You'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.tsx

Clerk webhook: point https://yourdomain.com/api/webhooks/clerk at user.deleted to keep the DB clean when users delete their accounts.


Commands

bun run build        # push schema + next build
bun start            # production server
bun run types:check  # tsc --noEmit
bun run lint         # ESLint

Deploy

Vercel Neon Clerk Spotify Cloudinary Umami

Add 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.

Contributors