so you like nextjs, let me present to you nest.shell
so you like nextjs, let me present to you nest.shell
It has routing, API endpoints, SQLite integration, and a working TODO app. All shell scripts piped through socat.
Why
I wanted something simple. Not “minimal framework” simple, actually simple. No runtime, no dependencies beyond what’s already on a Linux box. Just Bash, sqlite3, socat, and jq.
Turns out you can build real web applications this way. The TODO app works. You click things, they save to a database, the page updates. It’s not fast, it’s not scalable, but it fits in your head and runs anywhere.
How it works
socat listens on a port and pipes HTTP requests to Bash. Bash routes
based on filesystem paths, want a /about page? Make a
content/about/ directory. Want an API? Drop a
.api.sh script in content/api/.
# content/api/todos.api.sh
#!/bin/bash
result=$(sqlite3 "$DB_FILE" "SELECT * FROM todos;")
echo "Content-Type: application/json"
echo ""
echo "$result" | jq -R 'split("|") | {id: .[0], task: .[1], completed: .[2]}'That’s a real endpoint. Request comes in, query runs, JSON goes out.
When would you use this?
Prototyping something quick. Running on a box where you can’t install anything. Teaching someone how HTTP actually works under the hood. Building something small for yourself and not wanting to think about node_modules, and you don’t care about security.
It’s a fun tool for small problems.