Coder Social home page Coder Social logo

gin-project-structure's Introduction

Gin Project Structure

Golang APIs for Example service.

this project contains backend APIs and logic for Example Service powered by Go,Gin,Redis,MinIO,CouchBase and Dgraph

Application runs on Go 1.14 And redis,couchbase,MinIO,dgraph and scylladb.

Table of Contents

  • [Project Structure](#Project Structure)
  • [Install application](#Install application)
  • Configuration
  • Features
  • [Services and Database dependencies](#Services and Database dependencies)
  • Testing

Project Structure

.
├── config                      # all config files is here
    ├── file                    # develop yml config file is here
    └── test_conf               # unit test yml config file is here
├── console                     # console commands dicretory
    └── cmd                     # all console commands is here 
├── constants                   # some static values is here
├── docs                        # any documentation is here swagger,flowchat,gif , ....
├── logic                       # business logic layer directories. all server business logics is here
    └── tests                   # we create logics unit test in here
├── model                       # we save project struct/models in here
    └── proto                   # also if we need proto files we save it here
├── repository                  # repository layer directories. all server repository logics is here
    ├── rediskeys               # redis keys names is here
    ├── couchbaseQuery          # we save static quere is here
    └── tests                   # we create repository unit test in here.
├── router                      # router layer directories. all server router logics is here 
    ├── grpc                    # a directory for grpc routers
    └── http                    # a directory for http routers
        └── tests               # we create controllers unit test in here.
├── services                    # request and connections to therd party servers is here
├── utils                       # some local utils functions saved in here
├── .gitignore                  # realy this need explain ?!?!?
├── .gitlab-ci.yml              # gitlab ci stages and commands
├── go.mod                      # go modules file
├── go.sum                      # go modules file
├── main.go                     # project started in this file
└── Readme.md                   # you read me here :)

Install application

Get application to run locally for development or deployment

https://github.com/RezaOptic/gin-project-structure
cd gin-project-structure

installation dependencies

To installation dependencies use go mod vendor command.

Configuration

by default app server in running read config file from ./file/cofigs.yml if you want to change some service or database address or ports must edit config file

Setup your own config

to setup config you can set your settings into yml file.

Run Application

To run application on development config use go run main.go

Features

consoles

some time we need some worker to do some jobs periodically we use cobra to write console commands to do some jobs.

API's

grpc

we have multiple grpc methods :

http

we have multiple http route :

  • /v1/ POST: api for ...
  • /v1/ POST: api for ...
  • /v1/ POST: api for ...

Services and Database dependencies

this server need redis,couchbase,MinIO, dgraph and scylladb servers to start running.

Testing

  • TODO: Add dependency injection structure
  • TODO: Additional instructions for testing the application.
  • TODO: maybe better configs structure

gin-project-structure's People

Contributors

rezaoptic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.