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 ๐๐ผ
Follow the steps below to set up and start using this template for your Golang backend project.
Before you begin, ensure you have the following installed:
- Go
- MySQL (or a compatible database)
- Google Cloud Console project for Google Auth setup.
There are two ways to start using this template:
- Create a new repository based on this template by clicking the Use this template button at the top of this page.
-
Clone this repository to your local machine:
git clone https://github.com/oguzhantasimaz/Go-Clean-Architecture-Template.git cd your-repo-name
-
Create a
.env
file in the root directory based on the.env.example
template and fill in your configuration details. -
Install the necessary Go packages:
go mod tidy
-
Set up your Google OAuth credentials in the Google Cloud Console, and update your
.env
file with the corresponding client ID and client secret. -
Configure your MySQL database connection in the
.env
file with the appropriate credentials.
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.
โโโ api/
โ โโโ controller/
โ โโโ middleware/
โ โโโ route/
โโโ bootstrap/
โโโ cmd/
โโโ domain/
โโโ internal/
โ โโโ tokenutil/
โโโ repository/
โโโ usecase/
โโโ utils/
โโโ main.go
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.
Feel free to contribute to this project.
All pull requests are welcome.