Coder Social home page Coder Social logo

go-hackathon-starter's Introduction

Welcome to Go Hackathon Starter!

Build Status Go Report Card Maintainability

The project is a boilerplate application in Golang and has commonly used API examples built into it. Out of the box support for authentication, account management and a host of other features for your next hackathon or side project.

Why did I create this?

When I first started out with Go, I found tons of comments online saying - just use the standard library! Now Go's standard library is one of the best one's I've seen, but it doesn't give all you need to build a full fledged web application. I tried to use go for many of side projects and found myself repeating some of the most common things like authentication, user management, lack of generators for CRUD applications etc. This project is heavily inspired by hackathon starter which is based on nodejs and express. Being a developer with both nodejs and Go experience, I found this missing in the Go ecosystem. This project is a step towards that direction. The focus of the project is to optimize developer speed and keep everything clean and reusable as much as possible.

Live Demo: https://go-hackathon-starter.herokuapp.com

Slack: https://gophers.slack.com #go-hackathon-starter invite

Table of Contents

Getting Started

You will need to clone the project and run following commands -

# cd into project directory
cd ~/go/src/github.com/<username>/

# clone the code
git clone [email protected]:niranjan92/go-hackathon-starter

cd go-hackathon-starter

you need to do steps given below manually in the project directory

# install dependencies
npm install

## MANUAL - find and replace imports with your directory
## eg. import "github.com/niranjan92/go-hackathon-starter" needs to be replaced with
## 	   import "github.com/<your_username>/go-hackathon-starter"

# The first thing you need to do is open up the "database.yml" file and edit it 
# to use the correct usernames, passwords, hosts, etc... that are appropriate for 
# your environment. then create database
buffalo db create -a

# run migrations
buffalo db migrate

once script has completed start the server using - buffalo dev If you point your browser to http://127.0.0.1:3000 you should see a "Welcome to Go Hackathon Starter!" page.

Obtaining API Keys

Github Facebook Twitter Google

Project Structure

Project follows MVC architecture

Recommended Go Libraries

  • gobuffalo
  • goth
  • testify
  • delve

FAQ

Unable to login/ start fails with .env file not found error

  • You will have to set keys for github, facebook, twitter to get the login working for you.
  • will be adding detailed instructions in Readme itself in next few days

New project build fails due to import failure

  • this is because imports were not updated are are still using github.com/niranjan92/go-hackathon-starter
  • you should run setup.sh script that will find and replace all the dependencies with correct paths

CheatSheets

Adding new authentication

Benchmarks

Go is pretty fast and focus should be on adding new features quickly. But for those of you looking for benchmarks - Tested with wrk on home page and was able to run at ~370 requests per second with average latency of ~3 ms. This way more than what a budding project needs. :)

Niranjans-MacBook-Air:hackathon-starter niranjan$ ~/go/bin/wrk -t1 -c1 -d20s http://localhost:3000
Running 20s test @ http://localhost:3000
  1 threads and 1 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.02ms    2.86ms  48.97ms   92.86%
    Req/Sec   375.58     97.42   554.00     65.00%
  7493 requests in 20.05s, 33.95MB read
Requests/sec:    373.73
Transfer/sec:      1.69MB

Deploy

The project comes with a default Dockerfile which lets you build and deploy your applications with ease on heroku. Reference You can also package the application as a static binary and deploy it using buffalo. Reference

Working in Progress

Must DO:

  • add screenshots
  • add account linking
  • FACEBOOK - show list of friends
  • add profile pic / gravatar to profile age
  • angular example with separate home page
  • react example with separate home page

Good to do:

  • add paypal test example
  • fix highlighted part for selected tab in nav
  • admin management console for users
  • add a simpler way to configure db. maybe using docker compose
  • increase coverage

Maybe:

  • add examples for angular and react

go-hackathon-starter's People

Contributors

dependabot[bot] avatar niranjan92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

athiwatp mrlynn

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.