Giter Club home page Giter Club logo

go_project_template's Introduction

Backend Rest API template

Test application

Rest API template

Project structure:

  • cmd - this folder contains main entry point of project
  • config - contains configurations and global constants
  • migrations - contains database DDL commands for using with go-migrate cli tool
  • nginx - contains nginx configurations
  • scripts - contains docker container entrypoint scripts
  • templates - contains static html templates
  • pkg
    • faker_util - contains fake data generators
    • helpers - contains commonly used functions
    • logger - logging utility
    • mailer - email sender
    • response - returns json response with checking errors in response
    • router - contains gin router initialisation
    • security - contains security functions such as generating hash, jwt token validation
    • sentry - contains sentry tracer implementation
    • storage - contains query interfaces to database and database connections
    • translator - translates validation errors to human-readable texts
    • validator - validates json requests
  • internal
    • handler - contains versioned http handlers, you can also add another type of handlers there, such as event handlers or callback handlers
    • job - contains periodically runnable tasks in background
    • middleware - contains checking permissions, logging requests
    • models - contains request-response DTO s
    • repository - contains database queries, you can implement interfaces to your specific databases there
    • server - contains http server initialisation
    • services - contains business logic of project and all of your code should be here, services can use each other as dependency
    • types - type aliases for using long types

Currently, there are app versioning, authorization, swagger documentation, file uploading and rendering, profiling, user and role handlers.

All packages joined together with DI pattern and used uber.fx for this. Every package are testable and mockable for every type of testing.

Used 3rd party libraries:

go_project_template's People

Contributors

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