MCPcopy Index your code
hub / github.com/ashleyrudland/nextjs_vps

github.com/ashleyrudland/nextjs_vps @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
22 symbols 73 edges 25 files 3 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Do we need Vercel? Can we just run our NextJS apps on a VM? Maybe all our apps on one machine?

I love NextJS, but I don't like Vercels pricing. It seems nuts to me and it seems many other people do too. So I spent a few hours playing with this and ~~Digital Ocean~~ Hetzner Cloud (€3.30/mo 🤣) to see what was possible.

All thanks goes to kamal and @ImSh4yy, I built this using his post 🙏

What's the objective here?

Figure out if we can have all the requirements of most indie hacker apps on a little VM instead of Vercel?

Here's the list of to dos:

  • [x] Can we run NextJS on VPS easily? ✅
  • [x] Is the latency acceptable? ✅ 35ms, roughly same as Vercel
  • [x] Can we auto deploy? ✅ see deploy-on-main.yml
  • [x] Can we persist data on this machine when using Docker?
  • [x] How much traffic can this machine handle concurrently? Around 750 HTTP requests/sec on Hetzner €3.29/mo VPS, before it starts to slow down, see this load test report
  • [x] What's the writes per second using SQL Lite? ✅ 14,000/sec on Hetzner €3.29/mo VPS
  • [x] What's the uptime of this? ✅ so far 100%
  • [x] NextJS Feature: Image Optimization? ✅ works!
  • [x] NextJS Feature: Can we use Server Actions? ✅ SQLite write test runs on Server Actions. See actions
  • [x] NextJS Feature: API routes? ✅ see /api/vm/
  • [ ] NextJS Feature: Can we use the NextJS Caching? Custom Cache?
  • [ ] Can/how we run multiple apps on the same machine? Switch app based on domain name?

What's not the objective?

  • Infinite scale - do indie hackers really need this?
  • Complex architecture

How does this auto deploy?

Basically GitHub actions run on each commit to main, builds image using Docker, uploads then Kamal connects to machine via SSH (with passphrase), then reboots app with new code.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 21
Interface 1

Languages

TypeScript100%

Modules by API surface

src/app/actions/db-test.ts5 symbols
src/components/tests/capacity.tsx3 symbols
src/components/tests/db.tsx2 symbols
src/lib/utils.ts1 symbols
src/components/ui/test-card.tsx1 symbols
src/components/ui/spinner.tsx1 symbols
src/components/ui/button.tsx1 symbols
src/components/ui/button-loading.tsx1 symbols
src/components/tests/images.tsx1 symbols
src/components/tests/chart.tsx1 symbols
src/app/up/route.ts1 symbols
src/app/page.tsx1 symbols

For agents

$ claude mcp add nextjs_vps \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page