fullstack go web app template, for those who enjoy radical simplicty.
git clone https://github.com/roscrl/light.git &&
cd light &&
make tools &&
make run
go install golang.org/x/tools/cmd/gonew@latest
gonew github.com/roscrl/light
go-sqlite3
database driver, requires CGO to build. Prefer zig cc
over gcc
/clang
for easier cross compilation
tailwindcss
styling
@hotwired/turbo
SPA like navigation
@hotwired/stimulus
lightweight JS functionality
esbuild
bundling
sqlc
generate Go code from SQL queries
is
test assertions
rod
browser testing
fsnotify
watch Go template changes in dev mode without recompiling
golangci-lint
linting
gofumpt
formatting
- Set SSL
Full (strict)
- Add an A record in the DNS settings pointing to VPS IP
- Create a 15 year 'Origin Certificate' and place in
config/public.pem
&config/private.pem
- Enable Rate Limiting
(http.request.uri.path contains "/")
50 requests per 10s- TODO: Also add rate limiting to Caddy as is not an application concern
- Enable Bot Fight Mode
- Enable Page Rules Caching to respect
Cache-Control
headers returned- playlistvote.com/* Cache Level: Cache Everything
- Always Use HTTPS, Enable Brotli
- Set firewall to allow only Cloudflare IPs on port 443
- Set firewall to allow only personal IP on port 22
-
Change
Makefile
constantAPP_NAME
to your own -
Change
Makefile
constantCLOUDFLARE_ZONE_ID
to your own -
Change filename
config/todos.caddy
to<APP_NAME>.caddy
-
Change
config/todos.caddy
tls /etc/ssl/certs/todos.pem /etc/ssl/private/todos.pem
totls /etc/ssl/certs/<APP_NAME>.pem /etc/ssl/private/<APP_NAME>.pem
-
Change filename
config/todos.service
to<APP_NAME>.service
-
Change
config/todos.service
EnvironmentFile=/root/todos/.prod
toEnvironmentFile=/root/<APP_NAME>/.prod
-
Change
config/todos.service
WorkingDirectory=/root/todos
toWorkingDirectory=/root/<APP_NAME>
-
Change
config/todos.service
ExecStart=/root/todos/app
toExecStart=/root/<APP_NAME>/app
-
Create
config/.prod
usingconfig/.prod.template
as a template -
Ensure
config/private.pem
exists (cloudflare origin certificate private key from cloudflare setup) -
Set
VPS_IP
environment variable to your VPS IP -
Set
CLOUDFLARE_ZONE_ID
environment variable to your cloudflare zone id -
Set
CLOUDFLARE_EMAIL
environment variable to your cloudflare email -
Set
CLOUDFLARE_KEY
environment variable to your cloudflare key -
Run
make vps-new
- On PR, create a ephemeral preview environment with usage of Makefile VPS creation commands
- On PR, performance testing should execute and attach a graph with ability to see performance changes overtime.
rod
for e2e? buttests/bench
for individual endpoints - Code coverage + quality + unit test reports integrated to PR
core/notify
package for sending notifications (email, sms, push, etc)- E2E testing of VPS deployment as CI/CD workflow
- Load testing https://shane.ai/posts/load-testing-tips/
- Replica to S3 for SQLite https://litestream.io
- Tailwind css formatter/autocomplete plugin, not working for some reason on Intellij multiple tickets open on Intellij YouTrack
- Session management https://github.com/alexedwards/scs , fix bug with goroutine
- Investigate https://www.sqlite.org/spellfix1.html
- https://docs.gitlab.com/ee/ci/testing/
- Hotreload - find simple solution