GithubHelp home page GithubHelp logo

backend-golang's Introduction

[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url]


BACKEND GOLANG


Table of Contents
  1. About The Project
  2. Getting Started
  3. Project structure
  4. Features
  5. License
  6. Contact
  7. Acknowledgements

About The Project

This project is using Modular Monolith architecture, but it does not rule out the possibility we rewrite using Microservice architecture.

Built With

This section we explain what is backend is develop with

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • First you need to install Golang

  • After that check the installation and Golang version it must be above than 1.11 because we need the Golang Modules

    > go version
    go version go1.16.3 darwin/amd64
  • Check if your OS have make, to check it run this command (in my case is using OSX)

    ❯ make -v
    GNU Make 3.81
    Copyright (C) 2006  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    
    This program built for i386-apple-darwin11.3.0
    
  • Docker is required trought our development process, so highly need it

    ❯ docker version
    Client:
    Cloud integration: 1.0.14
    Version:           20.10.6
    API version:       1.41
    Go version:        go1.16.3
    Git commit:        370c289
    Built:             Fri Apr  9 22:46:57 2021
    OS/Arch:           darwin/amd64
    Context:           default
    Experimental:      true
    
    Server: Docker Engine - Community
    Engine:
      Version:          20.10.6
      API version:      1.41 (minimum version 1.12)
      Go version:       go1.13.15
      Git commit:       8728dd2
      Built:            Fri Apr  9 22:44:56 2021
      OS/Arch:          linux/amd64
      Experimental:     false
    containerd:
      Version:          1.4.4
      GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
    runc:
      Version:          1.0.0-rc93
      GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
    docker-init:
      Version:          0.19.0
      GitCommit:        de40ad0
    

    As you can se the Engine > Version > 20.10.6 (on my OSX)

Installation

Manual Installation

  1. Clone the repo
    git clone https://github.com/jadahbakar/backend-golang.git
  2. Install Modules packages
    go mod update
  3. Before to next step, firstable you must manual install reflex
    go get github.com/cespare/reflex
  4. Check reflex installation
    relex --help
  5. This is Optional if point 4 shows error, you must manualy add to SYSTEM PATH \n in my case i'm using zsh, so add it to .zshrc
    export PATH="$PATH:$(go env GOPATH)/bin"
    After that refresh the console with
    . ~/.zshrc
    Or
    source ~/.zshrc
  6. Run it
    make watch

Docker

  1. Clone the repo
    git clone https://github.com/jadahbakar/backend-golang.git
  2. Run it (it will create docker images and container with autoreload)
    make devel-up
  3. Stop
    make devel-down

Project Structure

Features

  • Create scaffolding for Monolith - Hexagonal Architechture
  • Integrating Viper with go for reading environment variable
    • Define on appConfig with mapstructure
  • Config REST API with Fiber, this include:
    • Middleware
      • Prefork=true
      • Config Logger (/log/fiber.log)
      • Config CORS
      • Config Compress
      • Config CSRF
    • Server
      • Shutdown Normaly
      • Graceful Shutdown
  • Configuration for Build Golang Manualy go build
  • mix recepies Golang with Docker
  • Using Traefik for Reverse Proxy
  • Create Watcher with reflex for Development with Hot Reloading
  • Create Development with Docker and Air for Development with Hot Reloading
  • Configure Traefik desktop
  • Create Monitoring
  • Deploy on Local kubernetes Container Orchestration
  • Centralization logger multistaging (Application, Database) with Fluentd + Elasticsearch
  • Create Makefile
    • Include external environment file (app.env)
    • All In One service (up - clean)
    • Development (build - run - watch)
    • Development with Docker (devel-up - devel-stop - devel-down)
    • Build for Docker (go-buil)
    • Docker (docker-build - docker-push - docker-remove-image - docker-remove-container - docker-prune)
    • Docker-Compose (compose-up - compose-down - compose-clean)
  • Deploy and Configure Redis for caching
  • Create Authentication Service
    • Create Security Service
  • Create Authorization Service
    • Create Access Control List for User
  • Next Will be Microservice Architechture
  • Next Will Using NATS for Message Broker (Microservice Architechture)
  • Next Will use Centralizen Configuration (Microservice Architechture)
  • Next Will use Service Registery with Health Check (Microservice Architechture)

License

Distributed under the Proprietary License. See LICENSE for more information.

Acknowledgements

backend-golang's People

Contributors

jadahbakar avatar

Watchers

 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.