Back to all docs

The Sys.

A simple markdown blog viewer running on EC2. Built to stay focused.


What This Is

A Node.js/Express server that renders markdown files with a clean UI. All your personal docs (system reference, letters, blog posts) accessible via browser at port 3000.


Setup

Components:

  1. Express server (server.js) - Serves markdown files as HTML
  2. Request logging - Every visit logged to access.log
  3. systemd service - Runs as system service, auto-starts on boot, auto-restarts on crashes

Files:


Accessing the Blog

From work Mac (or any browser on same network):

http://[EC2-PUBLIC-IP]:3000

Get your EC2 public IP:

curl -s ifconfig.me

Useful Commands

Service Management:

# Check if running
sudo systemctl status blog

# Start/stop/restart
sudo systemctl start blog
sudo systemctl stop blog
sudo systemctl restart blog

# Disable/enable auto-start on boot
sudo systemctl disable blog
sudo systemctl enable blog

Viewing Logs:

# Server logs (startup, errors)
tail -f ~/yap/server.log

# Access logs (who's visiting)
tail -f ~/yap/access.log

# systemd logs
sudo journalctl -u blog -f

# Last 50 lines of systemd logs
sudo journalctl -u blog -n 50

After Making Changes:

# If you edit server.js or markdown files
sudo systemctl restart blog

# If you edit the service file (/etc/systemd/system/blog.service)
sudo systemctl daemon-reload
sudo systemctl restart blog

Access Log Format

Each line in access.log:

[timestamp] | [IP address] | [method] [URL] | [user agent]

Example:

2025-10-19T20:50:42.434Z | 127.0.0.1 | GET / | curl/8.5.0
2025-10-19T21:15:30.123Z | 192.168.1.100 | GET /blog-post-ssh-to-sanity.md | Mozilla/5.0...

How It Works

  1. systemd starts the service on boot (because we ran systemctl enable blog)
  2. server.js runs on port 3000, binding to 0.0.0.0 (accessible from network)
  3. Every request gets logged to access.log via middleware
  4. Markdown files are converted to HTML using marked library
  5. If server crashes, systemd automatically restarts it after 10 seconds

Adding New Docs

Just add a .md file to /home/ubuntu/yap/. It'll show up on the homepage automatically.

No restart needed - the server scans for markdown files on each homepage load.


systemd Service Configuration

Located at /etc/systemd/system/blog.service:

[Unit]
Description=The Sys - Blog Server
After=network.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/yap
ExecStart=/usr/bin/node /home/ubuntu/yap/server.js
Restart=always
RestartSec=10
StandardOutput=append:/home/ubuntu/yap/server.log
StandardError=append:/home/ubuntu/yap/server.log

[Install]
WantedBy=multi-user.target

What each part does:


Troubleshooting

Server not responding:

sudo systemctl status blog  # Check if running
sudo journalctl -u blog -n 50  # Check for errors

After EC2 restart: Service should auto-start. If not:

sudo systemctl start blog

Port 3000 not accessible from browser:

Can't write to access.log:

ls -l access.log  # Check permissions
# Should be owned by ubuntu user

The System (What This Whole Thing Is About)

This blog documents a system for staying focused:

The markdown files in this directory are the core documentation for that system.

Read phone-system-reference.md to understand the full context.


Built With

Philosophy: Simple. No frameworks. No complexity. Just markdown files and a basic server.

Like the phone system - remove options, make it automatic.


Last updated: October 2025