Ronbun/README.md
2026-05-25 21:28:10 +02:00

61 lines
1.7 KiB
Markdown

# Ronbun-CMS
A personal CMS created to learn Golang and SQL. To learn more about the goals of the project, you can read this [blog post](https://thomasorus.com/i-built-my-own-little-cms).
The project was made following Alex Edward's excellent [Let's go](https://lets-go.alexedwards.net/) book. I changed a lot of things, and had the author's authorization to share the code.
## Road to open source
- Create a new table for static data like the site title, rss feed name, etc
- On first launch, redirect to account creation, then on site customization, then create default pages : 1st blog post, about page, etc
- Remove my design files but keep the necessary styles
- Popup before "Delete this page" happens
- Show archive of pages on the home by default
- Rewrite the AI image processing code
- Write tons of tests
## Local Development
You need to make a few preparations to dev locally.
### Requirements
- Go 1.24
### Create a self-signed cert
In order to have https locally, we need to create a self-signed certificate using the `generate_cert.go` file.
On mac if Go was installed with homebrew:
```
mkdir tls
cd tls
go run /opt/homebrew/Cellar/go/1.24.1/libexec/src/crypto/tls/generate_cert.go --rsa-bits=2048 --host=localhost
cd ..
```
### Give lightning CSS the right to execute
```
chmod +x ./tooling/lightningcss
```
### Live reload
Then use air to launch the project in dev mode:
```
go tool air -- -dev
```
Visit [](https://localhost:4000/)
## Build to production
Unfortunately the webp package needs cgo, install a compiler with
`brew install FiloSottile/musl-cross/musl-cross`
And then run:
`CC=x86_64-linux-musl-gcc CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-linkmode external -extldflags "-static"' -o ./build/ronbun ./cmd/web/`