{"id":15514260,"url":"https://github.com/somritdasgupta/webcv","last_synced_at":"2026-05-09T15:14:53.197Z","repository":{"id":190193472,"uuid":"681591781","full_name":"somritdasgupta/webCV","owner":"somritdasgupta","description":"🌿 My personal website/portfolio built using Next.js and Tailwind.","archived":false,"fork":false,"pushed_at":"2025-03-18T09:08:37.000Z","size":13653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T10:24:20.255Z","etag":null,"topics":["api","nextjs","serverless","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"https://somrit.in","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/somritdasgupta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-22T10:44:59.000Z","updated_at":"2025-03-18T09:08:40.000Z","dependencies_parsed_at":"2023-08-23T15:57:17.188Z","dependency_job_id":"79116076-081b-4d21-a341-d1ffc5ac042c","html_url":"https://github.com/somritdasgupta/webCV","commit_stats":null,"previous_names":["somritdasgupta/webcv"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somritdasgupta%2FwebCV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somritdasgupta%2FwebCV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somritdasgupta%2FwebCV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somritdasgupta%2FwebCV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somritdasgupta","download_url":"https://codeload.github.com/somritdasgupta/webCV/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246150416,"owners_count":20731419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","nextjs","serverless","tailwindcss","typescript"],"created_at":"2024-10-02T09:58:19.448Z","updated_at":"2026-05-09T15:14:53.192Z","avatar_url":"https://github.com/somritdasgupta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Personal Site \u0026 Blog\n\nA fast, file-based personal site with an MDX blog, an in-browser editor that commits posts to GitHub, a GitHub activity feed on the home page, and a printable CV.\n\nBuilt with React 18, Vite, MDX, Tailwind, and Recharts. No backend — everything runs in the browser and reads MDX files directly from this repo.\n\n---\n\n## What you need before you start\n\n1. A GitHub account (this is where your blog posts will live, as `.mdx` files).\n2. A free Vercel **or** Netlify account (to host the site).\n3. Node 20+ and `bun` (or `npm`) installed locally if you want to run it on your machine.\n\nThat is it. There is no database, no server to rent, no API keys to pay for.\n\n---\n\n## Step 1 — Make the project yours\n\nOpen `src/site.config.ts` and replace the placeholder values:\n\n- `SITE.BASE_URL` — fallback only. The real value comes from the `VITE_SITE_URL` environment variable (Step 4).\n- `SITE.name`, `title`, `description`, `twitterHandle` — your name and tagline.\n- `AUTHOR` — name, role, bio, email, and your social links.\n- `GITHUB.username` — your GitHub handle. The home page pulls public repos and recent commits from this account.\n- `GITHUB.repoIdAllowlist` / `repoAllowlist` / `pinned` / `featured` — which repos to feature. Leave the arrays empty to show everything.\n- `ADMIN.repo.owner` / `name` / `branch` / `contentDir` — the repo and branch where blog posts are committed (usually this same repo).\n- `ADMIN.devUsername` / `devPin` — a 4-digit PIN for **read-only** preview access to `/admin` when you do not want to sign in with GitHub. Change both before you deploy.\n\nSave. The whole site updates from this one file.\n\n---\n\n## Step 2 — Set up the in-browser blog editor (optional but recommended)\n\nThe editor at `/admin` lets you write new posts in the browser and commit them straight to your repo. To enable publishing, create a GitHub OAuth App so the editor can sign you in:\n\n1. Go to \u003chttps://github.com/settings/developers\u003e.\n2. Click **New OAuth App**.\n3. Fill in:\n   - **Application name** — anything, e.g. `My Site Admin`.\n   - **Homepage URL** — your site URL (you can use a placeholder for now, e.g. `https://example.com`).\n   - **Authorization callback URL** — any value; the device flow ignores it. Use the homepage URL again.\n4. Create the app, then open it and **enable Device Flow** (checkbox under General).\n5. Copy the **Client ID** shown at the top of the page.\n6. Paste it into `ADMIN.githubClientId` in `src/site.config.ts`.\n\nThe Client ID is public and safe to commit. There is no client secret used.\n\nAfter deploying, visit `/admin`, click **Continue with GitHub**, enter the device code on github.com, and you are signed in. Your token stays in your browser only.\n\n---\n\n## Step 3 — Write your first post\n\nPosts live in `content/blog/` as `.mdx` files. Two ways to add one:\n\n**A. By hand:** create `content/blog/my-first-post.mdx`:\n\n```mdx\nexport const frontmatter = {\n  title: \"My first post\",\n  description: \"A one-line summary that shows in cards and search results.\",\n  date: \"2026-01-15\",\n  tags: [\"intro\", \"writing\"],\n};\n\nHello, world.\n```\n\nDrop it in the folder, push to GitHub, and it appears at `/blog/my-first-post`.\n\n**B. From the browser:** go to `/admin/editor` after signing in. Write, preview, and click **Publish** — it commits the file for you.\n\nUse `mdx-showcase.mdx` as a reference for the custom components (callouts, charts, tabs, code blocks, etc.) available without imports.\n\n---\n\n## Step 4 — Deploy\n\nThe site is pure static output, so any static host works. Two recommended paths:\n\n### Vercel (easiest)\n\n1. Push this repo to GitHub.\n2. Go to \u003chttps://vercel.com/new\u003e and import the repo.\n3. Framework preset: **Vite**. Build command and output dir auto-detect.\n4. Under **Environment Variables**, add:\n   - `VITE_SITE_URL` = `https://your-domain.com` (no trailing slash). This drives every canonical URL, OG tag, sitemap entry, and JSON-LD reference on the site.\n5. Deploy.\n6. Add your custom domain under **Settings → Domains**.\n\n### Netlify\n\nSame idea. Build command: `bun run build` (or `npm run build`). Publish directory: `dist`. Add the `VITE_SITE_URL` environment variable. Deploy.\n\n---\n\n## Step 5 — Auto-publish scheduled posts (optional)\n\nYou can write a post with a future `date` in its frontmatter and it stays hidden until that date is in the past. The site is statically built, so it needs a rebuild for the post to actually appear. The included GitHub Action handles this:\n\n`.github/workflows/publish-scheduled.yml` runs every hour and triggers a rebuild via a deploy hook.\n\nTo enable it:\n\n1. In Vercel: **Settings → Git → Deploy Hooks → Create Hook**. Name it (e.g. `scheduled-publish`), pick your production branch, and copy the URL. (Netlify has the same feature under **Site Settings → Build \u0026 Deploy → Build Hooks**.)\n2. In your GitHub repo: **Settings → Secrets and variables → Actions → New repository secret**.\n   - Name: `DEPLOY_HOOK_URL`\n   - Value: the URL you just copied.\n3. Commit and push. The workflow starts running on the schedule.\n\nIf you do not need scheduled posts, just delete the workflow file.\n\n---\n\n## Step 6 — Sanity check\n\nOnce deployed, verify:\n\n- Your `/blog` page lists your posts.\n- The home page shows your GitHub repos and recent commits.\n- `/cv` renders your CV from `src/lib/cvData.ts` (edit that file to update it).\n- `/admin` accepts your PIN (preview only) and your GitHub login (publish).\n- View source on any page — `\u003cmeta\u003e` tags should reflect your `VITE_SITE_URL`, not the placeholder.\n- `https://your-domain.com/sitemap.xml` and `/robots.txt` resolve.\n\n---\n\n## Running locally\n\n```bash\nbun install      # or: npm install\nbun dev          # or: npm run dev\n```\n\nOpen \u003chttp://localhost:8080\u003e.\n\nTo preview a production build:\n\n```bash\nbun run build\nbun run preview\n```\n\n---\n\n## Project layout, in plain words\n\n- `content/blog/` — your MDX posts. One file per post.\n- `src/site.config.ts` — single source of truth for site identity, GitHub feed, and admin settings.\n- `src/lib/cvData.ts` — your CV content.\n- `src/components/mdx/` — the custom MDX components (callouts, charts, tabs, etc.).\n- `src/pages/` — page components (home, blog, post, activity, CV, admin).\n- `public/` — static files served as-is (favicon, `og.png`, etc.). Replace `public/og.png` with your own social-share image (1200×630).\n- `vite.config.ts` — build config; injects `VITE_SITE_URL` into static files at build time.\n\n---\n\n## Things to keep in mind\n\n- **Never commit a GitHub personal access token.** The editor only ever uses tokens issued by the OAuth Device Flow, which live in your browser's `localStorage` and never reach the repo.\n- The PIN in `ADMIN.devPin` is **client-side only**. It gates UI access on shared devices but cannot stop a determined visitor from reading the source. Anything destructive (publishing, deleting posts) still requires a real GitHub sign-in.\n- If you change `VITE_SITE_URL`, redeploy — it is read at build time, not runtime.\n- Replace `public/og.png` with your own 1200×630 social card before sharing the site.\n\nThat is everything. Edit `site.config.ts`, drop in `.env.example` values for your host, push, done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomritdasgupta%2Fwebcv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomritdasgupta%2Fwebcv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomritdasgupta%2Fwebcv/lists"}