fullstack go web app template, for those who enjoy radical simplicty.
git clone https://github.com/roscrl/light.git &&
cd light &&
make tools &&
make rungo install golang.org/x/tools/cmd/gonew@latestgonew github.com/roscrl/lightgo-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-Controlheaders 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
MakefileconstantAPP_NAMEto your own -
Change
MakefileconstantCLOUDFLARE_ZONE_IDto your own -
Change filename
config/todos.caddyto<APP_NAME>.caddy -
Change
config/todos.caddytls /etc/ssl/certs/todos.pem /etc/ssl/private/todos.pemtotls /etc/ssl/certs/<APP_NAME>.pem /etc/ssl/private/<APP_NAME>.pem -
Change filename
config/todos.serviceto<APP_NAME>.service -
Change
config/todos.serviceEnvironmentFile=/root/todos/.prodtoEnvironmentFile=/root/<APP_NAME>/.prod -
Change
config/todos.serviceWorkingDirectory=/root/todostoWorkingDirectory=/root/<APP_NAME> -
Change
config/todos.serviceExecStart=/root/todos/apptoExecStart=/root/<APP_NAME>/app -
Create
config/.produsingconfig/.prod.templateas a template -
Ensure
config/private.pemexists (cloudflare origin certificate private key from cloudflare setup) -
Set
VPS_IPenvironment variable to your VPS IP -
Set
CLOUDFLARE_ZONE_IDenvironment variable to your cloudflare zone id -
Set
CLOUDFLARE_EMAILenvironment variable to your cloudflare email -
Set
CLOUDFLARE_KEYenvironment 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.
rodfor e2e? buttests/benchfor individual endpoints - Code coverage + quality + unit test reports integrated to PR
core/notifypackage 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
