GithubHelp home page GithubHelp logo

maxdobeck / basic-app-api Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 229 KB

Basic Application server with basic api for a basic app

License: MIT License

Go 100.00%
golang gorilla postgresql-database api authentication

basic-app-api's Introduction

Build Status

basic-app-api

Service to authenticate users, manage user sessions, and process business logic.

Installing and Running

# Starting local server
$ go run main.go

# Run all tests
$ go test ./...

# Compile and create executable
This will place the executable under go/bin
$ go install

# Run the executable
$ basic-app-api

Background

This is essentially the Model and the Controller in the MVC for cookie-based sessions that are stored in a Postgresql database. It shouldn't be too hard to change the cookie store to a Redis database if that's what your needs call for. Both CSRF protection and sessions were implemented from the Gorilla library of Golang packages. http://www.gorillatoolkit.org/

The Database management is done essentially by hand, no ORM is in use at the moment. Setting up the database requires following the instructions for Postgresql database creation and management. If you'd like to use another database you'll need to change quite a bit in the code. The db/migrations directory will be executable sql files that create your tables or add migrations. If you execute them in order starting with setup.sql all should be well with your database.

Dependencies

Go dep is used for dependency management and the /vendor files. This started as a requirment for Heroku deployment but it looks like Golang may eventually use this tool by default. Read more here: https://github.com/tools/godep

This was built in parallel with https://github.com/maxdobeck/scheduler-frontend. At the time of this writing it is a dumb Vue.js Single Page App with very little functionality. Essentially it has a few protected routes and a log-in-log-out system. It also requires Vuex. The real value here is the Fetch requests. You should be able to essentially copy-paste them from this app to any other app.

Sources

Started with handy helping from:

basic-app-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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