Skip to content
/ resik Public

Clean Architecture implementation in Golang for building REST and gRPC applications. This project provides various ready-to-use features for creating structured and maintainable applications.

License

Notifications You must be signed in to change notification settings

dedyf5/resik

Repository files navigation

Resik - Golang Clean Architecture Implementation

Go Version License: MIT Build Status

Clean Architecture implementation in Golang for building REST and gRPC applications. This project provides various ready-to-use features for creating structured and maintainable applications.

Features

  • Dual Protocol Support

    • REST API
    • gRPC API
  • Core Functionality

    • Multi-language Support (English, Bahasa Indonesia, 日本語)
    • Form Validation
    • JWT Authentication & Authorization
    • Dependency Injection
    • Database Migration Support
    • Structured Logging
  • Developer Experience

    • API Documentation
    • Clean Architecture Implementation
    • Configuration Management

Getting Started

Prerequisites

  • Ensure you have Go (version 1.24 or higher) installed on your system.
  • You will need Make to run build commands.
  • If you plan to work with gRPC definitions, you'll need to install protoc (the Protocol Buffer compiler), protoc-gen-go, and protoc-gen-go-grpc.
  • If you intend to use API documentation generation, make sure you have swag installed.
  • For dependency injection, ensure wire is installed.

Installation

  1. Clone this repository:

    git clone https://github.com/dedyf5/resik.git
    cd resik
    go mod tidy
  2. (Optional) Generate necessary files using Make if you intend to modify proto definitions, API documentation, or dependency injection setup:

    make generate

    This command will:

    • Generate gRPC files.
    • Generate API documentation.
    • Generate Wire dependency injection code.

Configuration

Copy .env.example to .env and modify the values:

cp .env.example .env

Database Migration

Before running the application for the first time, or after any database schema changes, you need to run the database migrations. Use the following command:

go run main.go migrate up

How to run Resik?

Run REST app

go run main.go rest

Run gRPC app

go run main.go grpc

Help

go run main.go --help

API Documentation

REST API

  • Server Address:
    • Default: http://localhost:8081
    • Configurable in .env using: REST_APP_PUBLIC_SCHEMA, REST_APP_PUBLIC_HOST, REST_APP_PUBLIC_PORT.
  • Swagger UI:

gRPC API

  • Server Address:
    • Default: grpc://localhost:7071
    • Configurable in .env using: GRPC_APP_HOST, GRPC_APP_PORT.
  • API Definitions (Proto Files):

Testing

You can run the tests using the following command:

Using make test

make test

Using go test

go test ./...

Credits

License

MIT

About

Clean Architecture implementation in Golang for building REST and gRPC applications. This project provides various ready-to-use features for creating structured and maintainable applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages