A quick vibecoded webapp on exe.dev that I liked enough to save the source for.
1# Go Shelley Template
2
3This is a starter template for building Go web applications on exe.dev. It demonstrates end-to-end usage including HTTP handlers, authentication, database integration, and deployment.
4
5Use this as a foundation to build your own service.
6
7## Building and Running
8
9Build with `make build`, then run `./srv`. The server listens on port 8000 by default.
10
11## Running as a systemd service
12
13To run the server as a systemd service:
14
15```bash
16# Install the service file
17sudo cp srv.service /etc/systemd/system/srv.service
18
19# Reload systemd and enable the service
20sudo systemctl daemon-reload
21sudo systemctl enable srv.service
22
23# Start the service
24sudo systemctl start srv
25
26# Check status
27systemctl status srv
28
29# View logs
30journalctl -u srv -f
31```
32
33To restart after code changes:
34
35```bash
36make build
37sudo systemctl restart srv
38```
39
40## Authorization
41
42exe.dev provides authorization headers and login/logout links
43that this template uses.
44
45When proxied through exed, requests will include `X-ExeDev-UserID` and
46`X-ExeDev-Email` if the user is authenticated via exe.dev.
47
48## Database
49
50This template uses sqlite (`db.sqlite3`). SQL queries are managed with sqlc.
51
52## Code layout
53
54- `cmd/srv`: main package (binary entrypoint)
55- `srv`: HTTP server logic (handlers)
56- `srv/templates`: Go HTML templates
57- `db`: SQLite open + migrations (001-base.sql)