All Projects → dipeshdulal → clean-gin

dipeshdulal / clean-gin

Licence: 0BSD license
Implementation of clean architecture in Go, Gin with dependency injection.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to clean-gin

go-12factor-example
Example the 12factor app using golang
Stars: ✭ 20 (-88.95%)
Mutual labels:  gorm, gin-gonic
Goilerplate
Clean Boilerplate of Go, Domain-Driven Design, Clean Architecture, Gin and GORM.
Stars: ✭ 173 (-4.42%)
Mutual labels:  clean-architecture, gorm
GoGonicEcommerceApi
Ecommerce Rest API application built in Go with Gin Gonic + Gorm
Stars: ✭ 81 (-55.25%)
Mutual labels:  gorm, gin-gonic
simple-wallet
This is a simple wallet REST api that is capable of acount deposits and withdrawals, checking for account balance and providing a ministatement. It follows domain driven design practices. The project uses the DDD architecture approach.
Stars: ✭ 32 (-82.32%)
Mutual labels:  clean-architecture, gorm
go-todo-app
Go + Angular Todo App
Stars: ✭ 21 (-88.4%)
Mutual labels:  clean-architecture, gin-gonic
go api boilerplate
🐶Go (Golang)🚀REST / GraphQL API + Postgres boilerplate
Stars: ✭ 127 (-29.83%)
Mutual labels:  gorm, gin-gonic
Klean-ArchiteKture
Kotlin Android clean-architecture demo project for a meetup talk. Slides: https://docs.google.com/presentation/d/1CxnntHf3CorNDicx_cDN5s1t5pEbUwjwWHZ5PNmfe6Y/edit?usp=sharing
Stars: ✭ 10 (-94.48%)
Mutual labels:  clean-architecture
northwind-dotnet
A full-stack .NET 6 Microservices build on Minimal APIs and C# 10
Stars: ✭ 77 (-57.46%)
Mutual labels:  clean-architecture
poem-hexagon
A simple example for a hexagonal architecture.
Stars: ✭ 33 (-81.77%)
Mutual labels:  clean-architecture
PexWallpapers
Android application following best practices: Jetpack, Jetpack Compose, Modularity, Clean Architecture, Kotlin Coroutines, Tests, MVVM, DI, Static Analysis
Stars: ✭ 86 (-52.49%)
Mutual labels:  clean-architecture
node-express-clean-architecture
A modular folder structure for developing highly scalable and maintainable APIs in nodejs using express.
Stars: ✭ 41 (-77.35%)
Mutual labels:  clean-architecture
Flutter Roadmap
This is a flutter roadmap and documentation repository. If anyone is interested you can join the party to help the community and make flutter great again.
Stars: ✭ 47 (-74.03%)
Mutual labels:  clean-architecture
react-clean-arch
Demo implementation of Clean Architecture in React apps
Stars: ✭ 74 (-59.12%)
Mutual labels:  clean-architecture
go-paginate
Cursor-based go paginator
Stars: ✭ 48 (-73.48%)
Mutual labels:  gorm
ego
Go微服务.A simple and component-based microservice kit for go.
Stars: ✭ 765 (+322.65%)
Mutual labels:  gorm
android-clean-architecture
🚀🚀🚀 The boilerplate for Android using Kotlin & Clean architecture.
Stars: ✭ 21 (-88.4%)
Mutual labels:  clean-architecture
educational-platform
Modular Monolith Java application with DDD
Stars: ✭ 124 (-31.49%)
Mutual labels:  clean-architecture
editorconfig-checker.javascript
A tool to verify that your files are in harmony with your .editorconfig
Stars: ✭ 59 (-67.4%)
Mutual labels:  clean-architecture
dagger2-clean-mvp-example
Sample project with a basic approach to CLEAN architecture on Android
Stars: ✭ 41 (-77.35%)
Mutual labels:  clean-architecture
QueryMovies
This repository shows a Android project with Clean Architecture, Functional Reactive Programming and MVP+Dagger
Stars: ✭ 16 (-91.16%)
Mutual labels:  clean-architecture

Clean Gin

Clean architecture template with gin framework, go-fx as dependency container, gorm as orm for database related operations.

To learn about project structure and dependency injection please go through here

Running the project

  • Make sure you have docker installed.
  • Copy .env.example to .env
  • Run docker-compose up -d
  • Go to localhost:5000 to verify if the server works.
  • Adminer Database Management runs at 5001 .

If you are running without docker be sure database configuration is provided in .env file and run go run . app:serve

Environment Variables

Variables Defined in the project
Key Value Desc
SERVER_PORT 5000 Port at which app runs
ENV development,production App running Environment
LOG_OUTPUT ./server.log Output Directory to save logs
LOG_LEVEL info Level for logging (check lib/logger.go:172)
DB_USER username Database Username
DB_PASS password Database Password
DB_HOST 0.0.0.0 Database Host
DB_PORT 3306 Database Port
DB_NAME test Database Name
JWT_SECRET secret JWT Token Secret key
ADMINER_PORT 5001 Adminer DB Port
DEBUG_PORT 5002 Port that delve debugger runs in

Migration Commands

⚓️   Add argument p=host if you want to run the migration runner from the host environment instead of docker environment. Check #19 for more details. eg; make p=host migrate-up

Migration commands available
Command Desc
make migrate-up runs migration up command
make migrate-down runs migration down command
make force Set particular version but don't run migration
make goto Migrate to particular version
make drop Drop everything inside database
make create Create new migration file(up & down)

Implemented Features

  • Dependency Injection (go-fx)
  • Routing (gin web framework)
  • Environment Files
  • Logging (file saving on production) zap
  • Middlewares (cors)
  • Database Setup (mysql)
  • Models Setup and Automigrate (gorm)
  • Repositories
  • Implementing Basic CRUD Operation
  • Authentication (JWT)
  • Migration Runner Implementation
  • Live code refresh
  • Dockerize Application with Debugging Support Enabled. Debugger runs at 5002. Vs code configuration is at .vscode/launch.json which will attach debugger to remote application. Learn More
  • Cobra Commander CLI Support. try: go run . --help

Todos

  • COBRA Commander CLI Support #26
  • Swagger documentation examples #25
  • Unit testing examples. #23
  • File upload middelware. #20
  • Use of Interfaces #10

Contributing

Please open issues if you want the template to add some features that is not in todos. 🙇‍♂️

Create a PR with relevant information if you want to contribute in this template.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].