Giter VIP home page Giter VIP logo

go-webapp-skeleton's Introduction

go-webapp-skeleton

This repo contains a skeleton of a Go webapp. It has some useful features, mostly cribbed from other, similar projects around the Internet:

All tied together with a useful set of tooling. See below for more information.

Usage

  1. Clone this repository into your project's location:
    git clone https://github.com/andrew-d/go-webapp-skeleton.git $GOPATH/github.com/your-user/your-project
  2. Run the rename.sh script in order to rename this project and point it at the new import path.
  3. Type make clean all in order to clean the project and rebuild it.
    Note: you need go-bindata installed and in your $PATH in order for the build to complete.

Tooling

This project uses gvt in order to manage dependencies. It comes with all the dependencies already vendored as part of the repository. In order to update a given dependency, you can run gvt update path/to/dep.

Organization

Note: somewhat of a work in progress

  • The base of the project can be found in the main.go file, which imports most of the other packages and kicks everything off. You probably won't need to modify this as much.
  • The model directory contains database models. These models should not interact directly with the database.
  • The datastore directory is responsible for mapping the models to the database in use. It defines interfaces which provide the interface to interact with the underlying, concrete, datastore.
  • The datastore/database directory contains the actual code that is responsible for interacting with the underlying database.
  • The datastore/migrate directory contains the SQL code for migrations performed by the app upon startup.
  • The handler directory contains useful functions that are generic between API and frontend routes.
  • The handler/api directory contains the API route handler functions.
  • The handler/frontend directory contains the frontend route handler functions.
  • The router directory contains the main router, which registers each of the handler functions on their respective routes.

go-webapp-skeleton's People

Contributors

adunham-stripe avatar andrew-d avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.