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.

Packages Used

Backend
Router:
go-chi/chi
DB:
lib/pq, jmoiron/sqlx, markbates/pop/nulls, pressly/goose
Emails:
pressly/douceur, gopkg.in/gomail.v2
Security:
crypto/bcrypt, gorilla/csrf, gorilla/securecookie, gorilla/sessions
Utilities:
markbates/refresh, microcosm-cc/bluemonday, spf13/cobra
Frontend
Development:
Webpack, Babel
JS:
(in admin panel)
Bootstrap (v4.0), jQuery, Froala Editor
SCSS:
Bootstrap (v4.0)
Note: Since Alloy uses Webpack for local dev setup and bundling assets, you need to have Node.js & NPM installed.

Installation and Usage

  1. Clone the repository
git clone https://github.com/olliecoleman/alloy
cd alloy
  1. Install the dependencies
glide install
npm install
  1. Start the development server
go install
alloy dev

Now 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.

Alloy comes with basic scaffolding (CRUD actions) to create & manage pages and messages. You can use that as a base for building your own models and resources.

Project structure

├── README.md
├── app
│   ├── handlers
│   ├── mailer
│   ├── migrations
│   ├── models
│   ├── router
│   │   ├── middleware
│   │   └── router.go
│   ├── services
│   │   ├── db.go
│   │   └── session.go
│   ├── templates
│   │   ├── admin
│   │   ├── layouts
│   │   ├── mailer
│   │   ├── pages
│   └── views
├── assets
│   ├── fonts
│   ├── images
│   ├── js
│   └── scss
│       ├── admin
│       ├── frontend
│       └── frontend.scss
├── cmd
├── testutils
├── glide.yaml
├── main.go
├── package.json
├── refresh.yml
└── webpack.config.js

Support & Updates

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.

Fork on Github Contact Us

Growth Metrics is a tool to help you measure and improve your brand's customer satisfaction using Net Promoter System. We are currently in beta and we are getting ready for a public launch.


Signup now to be the first one to be notified of our launch.

Net Promoter Score