This is not a web framework. It generates a skeleton web project for you to kick-ass.
Feel free to use or rip-out any of its parts.
NOTE: Due to lack of Windows machine, at the moment, PostgreSQL template is not working on Windows.
-
PostgreSQL or MySQL if you choose to use a database.
-
Go programming language, version 1.3.x or newer.
-
Ensure
$GOPATH/bin
is in your$PATH
. Example:PATH=$PATH:$GOPATH/bin
-
go get github.com/go-bootstrap/go-bootstrap
-
$GOPATH/bin/go-bootstrap -dir github.com/{git-user}/{project-name} -template {core|postgresql|mysql}
-
Start using it:
cd $GOPATH/src/github.com/{git-user}/{project-name} && go run main.go
If you have PGUSER
, PGPASSWORD
, PGHOST
, PGPORT
, PGSSLMODE
environment variables set,
they will be used to generate and bootstrap the database.
This generator makes A LOT of decisions for you. Here's the list of things it uses for your project:
-
There are 3 templates to choose from:
-
Core: If you don't want a database.
-
PostgreSQL.
-
MySQL.
-
-
bcrypt is chosen as the password hasher.
-
Bootstrap Flatly is chosen for the UI theme.
-
Session is stored inside encrypted cookie.
-
Static directory is located under
/static
. -
Model directory is located under
/models
. -
It does not use a full blown ORM.
-
Test database is automatically created under
$GO_BOOTSTRAP_PROJECT_NAME-test
. -
A minimal Dockerfile is provided.
-
A minimal Vagrantfile is provided.
-
github.com/jmoiron/sqlx is chosen to connect to a database.
-
github.com/gorilla is chosen for a lot of the HTTP plumbings.
-
github.com/carbocation/interpose is chosen as the middleware library.
-
github.com/tylerb/graceful is chosen to enable graceful shutdown.
-
github.com/rnubel/pgmgr is chosen as the database migration and management tool for PostgreSQL.
-
github.com/mattes/migrate is chosen as the database migration and management tool for MySQL.
-
github.com/Sirupsen/logrus is chosen as the logging library.
-
github.com/spf13/viper is chosen to manage application config.