codon

module
v0.0.0-...-769c1bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2025 License: MIT

README

Codon

Codon is a minimal Go, SQLite and TypeScript toolkit that makes web app packaging and deploys trivial.

Static sites are built with Bun and can be deployed as a directory.

Dynamic apps are built with Go + SQLite and deployed as a single binary.

The goals are to increase productivity building and hosting web apps, with modern tools that reduce dependencies, build steps, config files, and other layers of cruft.

Quick start

brew install deno go oven-sh/bun/bun sqlc
go install github.com/nzoschke/sqlc-gen-zz@latest
go install github.com/mitranim/gow@latest

go generate ./...
go test -count 1 -v ./...
go build -o app cmd/app/main.go

./app
open http://localhost:1234
curl -d '{"email":"[email protected]","name":"Ann"}' -H "Content-Type: application/json" http://localhost:1234/api/contacts

{"created_at":"2025-04-13T18:39:04Z","email":"[email protected]","id":1,"info":{"age":0},"name":"Ann","phone":"","updated_at":"2025-04-13T18:39:04Z"}

Development

Go
LEVEL=debug gow -v run cmd/app/main.go -dev

To test:

go test -v ./...
bun test

To build:

go generate ./...
go build -o app cmd/app/main.go
./app
TS
cp src/scripts/pre-commit .git/hooks
bun install
bun run build
bunx serve build/dist

Philosophy

  • All things equal the shorter solution is better
  • Reduce dependencies

This leads us to:

  • Bun and its build tools
  • Deno and its fmt tool (until https://github.com/oven-sh/bun/issues/2246🤞)
  • Go and its tools and stdlib
  • Fuego and its Open API spec and client gen
  • Svelte and its compiler (and without SvelteKit)
  • SQLite and its file and memory backed databases
  • Tailwind

References:

Directories

Path Synopsis
cmd
app command
pkg
api
db
log
run
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL