Skip to content

Signor-Koala/KWoC-Backend

 
 

Repository files navigation

Directory Structure

MVC Strucutre is being followed.

main.go: Driver Code for all of backend.

models: Database Models

controllers: Various handlers for HTTP Requests

routes: Definitions of Sub-routers

utils: Middlewares and other files common to multiple functions

scripts: Extra scripts (unrelated to the usual flow of the webapp)

docs: Documentation

File Naming Convention

  • Separate file for each Model.

  • Controller functions to be grouped together by their routes.

  • Each Subroute has a separate file.

In short, don't keep any surprises. Use groupings as per your discretion.

Dependencies

gorilla/mux
jinzhu/gorm
golang-jwt/jwt/v4

Also uses golanglint-ci for linting code.

Building

  • Clone the repo and cd into it's directory.
  • Run the following commands
    docker-compose build
    docker-compose up 

NOTE: If you face the following issue with docker-compose.

strconv.Atoi: parsing "": invalid syntax

This is because docker-compose is creating arbitrary container not in docker-compose.yml and terminating the starting process.
FIX: Use docker-compose-v1 instead of docker-compose.

About

Go backend for KWOC 21

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.1%
  • HTML 2.6%
  • Other 1.3%