zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.41k stars 3.97k forks source link

What is the best directory structure for microservice projects #4254

Open 814704261 opened 4 months ago

814704261 commented 4 months ago

I am a beginner learning go-zero. When creating a microservice project, I encountered a problem: how should the directory structure of the microservice project be organized? I carefully read the layout explanation on the official website. I tried to set up the directory structure as described on the official website. Below is my project directory:

example
├── internal
├── pkg
├── restful
 │       └── app
 │       └── admin
├── script
├── service
 │       └── user

I have two HTTP services, app and admin, and an RPC service user.

If I want to create a configuration file or utility package that both app and admin can use, how should I do it? Also, how can I quickly start all services instead of running go run . one by one?