Project template for creating server side rendered web applications in Go, with example database & content.
- Routing & middleware
- HTTP session management
- User registration & authentication
- Database backend (SQL)
- Templating & forms
- github.com/alexedwards/scs/mysqlstore
- github.com/alexedwards/scs/v2
- github.com/go-playground/form/v4
- github.com/go-sql-driver/mysql
- github.com/julienschmidt/httprouter
- github.com/justinas/alice
- github.com/justinas/nosurf
- golang.org/x/crypto
git clone https://github.com/bartvanbenthem/gofound-webapp.git
cd gofound-webapp
cd project
docker-compose up -d
cd ..
go test -vet=off -v ./cmd/web/
go build -o ./bin/gofoundweb ./cmd/web/
./bin/gofoundweb --addr=":4000" \
--dsn="web:pass@/gofound?parseTime=true" \
--smtp-host="localhost" \
--smtp-port="1025" \
--smtp-user="" \
--smtp-password="" \
--mail-address="mail@gofound.nl" \
--cert="./tls/cert.pem" \
--key="./tls/key.pem"
Start MailHog to test mail capabillities
$ go get github.com/mailhog/MailHog
$ ~/go/bin/MailHog
Use the provisioned user:
- Username: admin@gofound.nl
- Password: administrator
cd tls
go run /usr/local/go/src/crypto/tls/generate_cert.go --rsa-bits=2048 --host=localhost