Boilerplate for creating web applications in Go (golang)
Boilerplate for creating web applications in Go (golang)
Alloy is a starter template for creating web applications using Go programming language. It does not aim to be a web framework but is instead a collection of useful libraries and packages that acts a sensible starting point.
Recently, I decided to build my latest side project using Go. I started off with just the standard library and then gradually added a few recommended packages for performing common tasks like database calls (sqlx), migrations (pressly/goose) and sending emails (gomail). This boilerplate has been extracted from that side project.
Alloy uses Webpack for managing front-end assets (Javascript and CSS), so you need to have Node.js and NPM installed in order to use that. This boilerplate also includes a separate 'admin panel' which acts as a CMS for adding pages, managing users etc.
** GrowthMetrics is a nifty little tool to measure your business's customer satisfaction using a metric called NPS (Net Promoter Score). You can signup for the early access (and early bird discount) here - https://www.growthmetrics.io/beta.
** NOTE: ** Currently this uses Postgres as the database, so you would need postgres to be running before you start the application. In future releases, I will be adding support for other databases.
Usage:
alloy [command]
Available Commands:
db Manage the app's database (create migration, migrate up/down/redo).
dev Start the development server (along with webpack watch)
gen-key Generate a random key to use with securecookies
help Help about any command
new-admin Manage the admin user(s)
server Start the server
version Print the version number of alloygit clone https://github.com/olliecoleman/alloy
cd alloyglide install
npm install…go install
alloy devNow you can open your browser and navigate to http://localhost:1212 to see it in action. Any changes you make to the .go files will be automatically picked up and the app will be re-compiled.
…If you have any questions or comments, please get in touch via email or open an issue. I would welcome your suggestions and pull requests.
Oliver Coleman
coleman.oliver[at]icloud[dot]com
No open issues yet, or sync has not completed.