Giter Site home page Giter Site logo

oguzhantasimaz / go-clean-architecture-template Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 0.0 49 KB

Golang Clean Architecture Template with JWT Auth, Google OAuth2 Authentication, MySQL Connection and User CRUD operations

License: Apache License 2.0

Dockerfile 0.29% Go 99.71%
backend backend-template clean-architecture go go-clean-architecture go-template golang golang-template google-oauth2 jwt

go-clean-architecture-template's Introduction

Golang Backend Clean Architecture Template

GitHub GitHub Go Module Version GitHub issues

This is a template repository for building a Golang backend application following the Clean Architecture principles. It includes the following features:

  • Google Auth: Integration with Google OAuth for user authentication.
  • JWT Auth: Token-based authentication and authorization system.
  • MySQL Connection: Database connectivity to MySQL for data storage.
  • User CRUD Operations: Basic user management operations (Create, Read, Update, Delete).

You can use this project as a template to build your Backend project in the Go language on top of this project.

Edit the project to suit your needs after you use it as a template.

Please โญ๏ธ this repository if this project helped you, also contributions are welcome ๐Ÿ™๐Ÿผ

Getting Started

Follow the steps below to set up and start using this template for your Golang backend project.

Prerequisites

Before you begin, ensure you have the following installed:

Installation

There are two ways to start using this template:

  1. Create a new repository based on this template by clicking the Use this template button at the top of this page.

  1. Clone this repository to your local machine:

    git clone https://github.com/oguzhantasimaz/Go-Clean-Architecture-Template.git
    cd your-repo-name
  2. Create a .env file in the root directory based on the .env.example template and fill in your configuration details.

  3. Install the necessary Go packages:

    go mod tidy

Configuration

  1. Set up your Google OAuth credentials in the Google Cloud Console, and update your .env file with the corresponding client ID and client secret.

  2. Configure your MySQL database connection in the .env file with the appropriate credentials.

Usage

Run the following command to start the Golang backend server:

go run main.go

Your server should now be running at port you specified in the .env file.

Project Structure

โ”œโ”€โ”€ api/
โ”‚   โ”œโ”€โ”€ controller/
โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ””โ”€โ”€ route/
โ”œโ”€โ”€ bootstrap/
โ”œโ”€โ”€ cmd/
โ”œโ”€โ”€ domain/
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ tokenutil/
โ”œโ”€โ”€ repository/
โ”œโ”€โ”€ usecase/
โ”œโ”€โ”€ utils/
โ””โ”€โ”€ main.go

About Me

Hello, I am Oguzhan Tasimaz, a software engineer from Turkey. I am interested in backend development, distributed systems, and cloud computing. You can find me on LinkedIn.

Contributing

Feel free to contribute to this project.

If this project helps you in anyway, show your love โค๏ธ by putting a โญ on this project โœŒ๏ธ

Contributing to Go Backend Clean Architecture

All pull requests are welcome.

go-clean-architecture-template's People

Contributors

oguzhantasimaz avatar

Stargazers

 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.