- GitHub, GitLab, or Bitbucket account
- Vercel account (free tier)
- A domain (optional, Vercel provides a
.vercel.appdomain for free)
cd /root/cocor.tech
git init
git add .
git commit -m "Initial commit"Create a repo on GitHub/GitLab and push:
git remote add origin https://github.com/your-username/cocor.tech.git
git branch -M main
git push -u origin main- Go to vercel.com/new
- Import your Git repository
- Vercel auto-detects Next.js — no build commands to change
- Click Deploy
That's it. The site will be live in ~2 minutes.
- In the Vercel dashboard, go to your project → Settings → Domains
- Add
cocor.tech - Follow Vercel's DNS instructions for your domain provider
In Vercel project Settings → Environment Variables, add:
| Name | Value | Purpose |
|---|---|---|---|
| ADMIN_PASSWORD | (your chosen password) | Admin login at /admin |
| FORMSPREE_URL | https://formspree.io/f/your-id | Contact form submissions |
| GITHUB_TOKEN | (GitHub PAT with repo scope) | Enables admin content writes via GitHub API |
| GITHUB_REPO_OWNER | your GitHub username | Repo owner for GitHub API writes |
| GITHUB_REPO_NAME | cocor.tech | Repo name for GitHub API writes |
| GITHUB_BRANCH | main | Branch to commit to |
The first 3 are required for the admin and contact form to work. The GitHub vars are needed for the admin to write content on Vercel — without them, the admin works in read-only mode.
| Operation | Without GitHub vars | With GitHub vars |
|---|---|---|
| Reading content | ✅ Filesystem (works) | ✅ Filesystem (works) |
| Writing content | ❌ Filesystem is read-only | ✅ GitHub API commits to repo |
| Creating content | ❌ Blocked | ✅ Auto-commits to git → triggers redeploy |
| Deleting content | ❌ Blocked | ✅ Auto-commits to git → triggers redeploy |
When GITHUB_TOKEN, GITHUB_REPO_OWNER, and GITHUB_REPO_NAME are set in environment variables:
- Admin creates/edits/deletes a
.mdfile - The API commits the change directly to your GitHub repo via the GitHub Contents API
- Vercel detects the push and automatically redeploys
- Within ~2 minutes, the content is live
Set up a GitHub token at https://github.com/settings/tokens with repo scope (for private repos) or public_repo scope (for public repos).
Auto-detected by Vercel:
- Framework: Next.js
- Build Command:
npm run build(auto) - Output Directory:
.next(auto) - Node.js Version: 18+ (auto)
- Admin auth is cookie-based (stateless). No file storage or database needed.
- All routes are statically generated where possible. Dynamic routes (
/docs/[[...slug]],/blog/category/[category]) are server-rendered. - The admin panel shows its current mode (local filesystem vs GitHub API) in the header.