albertchan / bijou

An opinionated project skeleton for web applications written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bijou

An opinionated web application skeleton with MVC pattern comprised of the following core components:

  • Negroni, an idiomatic approach to web middleware in Go
  • HttpRouter, a lightweight high performance HTTP request router for Go
  • pq, a pure Go Postgres driver for the database/sql package

Getting started

After installing all your dependencies, run the server:

go run server.go

Or if you're doing development and want live-reloading, run using gin:

gin -p "8080" -a "8888" run server.go

Here, the proxy server port is 8080, and the Go web server port is 8888 (default). After running that command, you should see the following:

[gin] listening on port 8080

You can now point your browser to http://localhost:8080

Project structure

bijou/
├── app/
│   ├── controllers/
│   ├── core/
│   ├── helpers/
│   ├── models/
│   ├── views/
│   ├── config.yml
│   └── server.go
├── client/
│   ├── gulp/
│   ├── scripts/
│   ├── styles/
│   └── package.json
└── public
    ├── css/
    ├── images/
    └── js/

Backend /app/*

/controllers

All controllers that serve defined routes.

/core

Core functions and structs.

/helpers

Helper functions.

/models

Database models and data access layer methods.

/public

All static files mapped to /assets/* path except robots.txt and favicon.ico which are mapped to /.

/views

Templates using standard Go template system.

server.go

The main entry point for the application. This file also contains routes definitions.

Frontend /client/*

/gulp

Gulp tasks for frontend build pipeline

/scripts

Frontend JavaScripts, including React commponents and Redux architecture

/styles

Stylesheets written in Sass

References

About

An opinionated project skeleton for web applications written in Go

License:MIT License


Languages

Language:JavaScript 44.6%Language:CSS 40.5%Language:Go 13.8%Language:HTML 1.2%