Giter Site home page Giter Site logo

jenrinaldo / golang-monolithic-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mahdidelnavazi/golang-monolithic-boilerplate

0.0 0.0 0.0 200 KB

Go DDD example application. Complete project to show how to apply DDD, Monolithic Architecture using docker ,mongodb ,redis ,gin and paseto.

Go 99.74% Makefile 0.26%

golang-monolithic-boilerplate's Introduction

Golang Monolithic Boilerplate

Golang Monolithic Boilerplate using Domain Driven Design handles authentication and authorization, and beside of this features, It also handles user CRUD using :

Terminology

  • User — User is the main entity of this microservice which contain the primary information of user, all the actions of user list below

  • Authentication — Each user can register and login in the system and take advantage of our platform, therefore we assign a token for handling this operation. (PASETO)

  • Authorization — Each user access defined permissions and take actions on specific entities, therefore we control this permissions through role based authorization.

  • Permission — One the main entities of this microservice and it is key value pair to know which role has which permission.

  • Role — Each user can have one role, and each role can have multiple permissions, we handle user's access to Polaris project

Structure of the Code

 ┌───┐
 │ / │
 └─┬─┘
   │
   ├───────▶ Common ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ Configuration(s) (default values, env, middleware, token)
   │
   ├───────▶ Components ─ ─ ─ ─ All Components have Request ,Response ,Controller ,Service and Repository
   │                   │ 
   │                   └──┬──▶ Auth ─ ─ ─ ─ Login User and NewAccessToken
   │                      │
   │                      ├──▶ AuthUser ─ ─ ─ ─ Logout User
   │                      │ 
   │                      ├──▶ Permission ─ ─ ─ ─ Permission List
   │                      │
   │                      ├──▶ Role ─ ─ ─ ─ Create ,Reade ,Update Roles
   │                      │
   │                      ├──▶ RolePermission ─ ─ ─ ─ Attach and Detach Permission to Role
   │                      │
   │                      ├──▶ Ticket ─ ─ ─ ─ Create New User Ticket
   │                      │
   │                      ├──▶ User ─ ─ ─ ─ Create ,Reade ,Update User 
   │                      │
   │                      └──▶ UserRole ─ ─ ─ ─ Attach and Detach Role to User
   │
   ├───────▶ Docs ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ Swagger Files
   │
   ├───────▶ Router ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 
   │
   ├───────▶ Test ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ Config Testing Database

Setting up the environment

The system needs to have a database (mongodb).

You have to complete your .env file based on the .test.env template file provided within the root directory of the project.

You can run the docker environment

For start Mongodb :

$ make createdb

For start Redis :

$ make redis

For start Swagger :

$ make swagger

For start server :

$ make server

golang-monolithic-boilerplate's People

Contributors

mahdidelnavazi avatar mjbayati avatar amirjani avatar miladirannejad 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.