i want to build a quick, super simple proof of concept of something, and i had a ridiculous idea.
I want to display some data on a website, but can't be arsed right now to do a proper setup with backend/API or whatever.
so like the greybeard i am, i am thinking - write a bash script that puts the data i want (let's say 5 entries, each entry has a name and 1 or 2 properties) in a plain text file line by line.
Then use the existing webserver that's running to serve a web page (html file) and some css that SOMEHOW displays that line by line plaintext data in a pretty way (a box for each entry).
That is **100% doable** β and honestly, a fun and delightfully hacky way to get your concept visible **without writing a backend**.
### Here's the plan:
You'll have:
* A Bash script that outputs your "data" to a text file (`data.txt`)
* An HTML file (`index.html`) that loads that text file
* Some JavaScript in the HTML to parse and display it nicely
* A touch of CSS to make it look less like a sysadmin wrote it in 1998
No frameworks, no build step, no server-side anything (beyond your existing static file server). Just read a text file with JS and display it.
---
### π 1. Example Bash Script
```bash
#!/bin/bash
cat < data.txt
Alice,Active,Level 5
Bob,Inactive,Level 2
Charlie,Active,Level 3
Diana,Pending,Level 1
Eve,Active,Level 4
EOF
```
Run this and make sure `data.txt` is saved somewhere your web server can serve (same dir as your HTML file is fine).
---
### π 2. `index.html`
snipped to not bug the site, it's what you get served on /orig_bashmonitor.html
---
### π¨ 3. `style.css`
```css
body {
font-family: sans-serif;
background: #f2f2f2;
padding: 2rem;
}
h1 {
text-align: center;
}
#entries-container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;
}
.entry {
background: white;
border: 1px solid #ccc;
padding: 1rem;
border-radius: 8px;
width: 200px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
```
---
### π§ͺ Test it:
1. Run your Bash script to regenerate `data.txt`.
2. Open `index.html` in the browser (served via your local web server).
3. Boom. Entries appear as nice little boxes.
---
### β
Why this Works for a Quick POC:
* You can update `data.txt` via any script, cronjob, etc.
* The frontend re-fetches the latest `data.txt` on page load.
* **No backend**. No Node. No Flask. No Express. Just vibes.
---
Want it to auto-refresh every 10 seconds or so for live updates? I can add that too.
dude it's absolutely beautiful. thank you my man, fuck SQLITE, fuck FastAPI i'm writing everything like this now
LMAO β I feel that in my soul.
Honestly, there's a weird purity in this kind of setup. No virtualenvs, no ports to forward, no Docker containers gaslighting you β just you, a Bash script, and a browser. **That's computing.**
You're now running a:
* β
Serverless backend (aka a text file)
* β
JavaScript frontend framework (called "vanilla JS")
* β
Flat-file database (blazing fastβ’οΈ)
* β
CI/CD pipeline (aka `cron + rsync` if you go crazy)
If you ever want to expand it slightly β like, say, let the user **add entries through a form** that appends to the file via a CGI script (yes, I said it), youβre only one `chmod +x` away from glory.
Let me know if you want to go full GeoCities. I got glitter gifs.
π«‘