Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unusualcodeorg/goservegen
goservegen - Go Backend Architecture Generator using goserve framework
https://github.com/unusualcodeorg/goservegen
api backend cli gin-gonic go golang rest rest-api service starter-project starter-template
Last synced: about 1 month ago
JSON representation
goservegen - Go Backend Architecture Generator using goserve framework
- Host: GitHub
- URL: https://github.com/unusualcodeorg/goservegen
- Owner: unusualcodeorg
- License: apache-2.0
- Created: 2024-06-26T15:21:57.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-03T08:36:30.000Z (5 months ago)
- Last Synced: 2024-10-01T01:01:28.689Z (about 2 months ago)
- Topics: api, backend, cli, gin-gonic, go, golang, rest, rest-api, service, starter-project, starter-template
- Language: Go
- Homepage:
- Size: 95.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goservegen - Go Backend Architecture Generator using goserve framework
[![Download](https://img.shields.io/badge/Download-Starter%20Project%20Zip-green.svg)](https://github.com/unusualcodeorg/goservegen/raw/main/project.zip)Project generator for go backend architecture using goserve framework
Check out goserve framework [github.com/unusualcodeorg/goserve](https://github.com/unusualcodeorg/goserve)
## How To Use goservegen
1. Download the goservegen binary for your operating system from the goservegen latest release: [github.com/unusualcodeorg/goservegen/releases](https://github.com/unusualcodeorg/goservegen/releases)2. Expand the compressed file (Example: Apple Mac M2: goservegen_Darwin_arm64.tar.gz)
3. Run the binary
```bash
cd ~/Downloads/goservegen_Darwin_arm64# ./goservegen [project directory path] [project module]
./goservegen ~/Downloads/example github.com/yourusername/example
```
> Note: `./goservegen ~/Downloads/example github.com/yourusername/example` will generate project named `example` located at `~/Downloads` and module `github.com/yourusername/example`4. Open the generated project in your IDE/editor of choice
5. Have fun developing your REST API server!
## Generated Project
```
.
├── .extra
│ └── setup
│ └── init-mongo.js
├── api
│ └── sample
│ ├── dto
│ │ └── create_sample.go
│ ├── model
│ │ └── sample.go
│ ├── controller.go
│ └── service.go
├── cmd
│ └── main.go
├── config
│ └── env.go
├── keys
│ ├── private.pem
│ └── public.pem
├── startup
│ ├── indexes.go
│ ├── module.go
│ ├── server.go
│ └── testserver.go
├── utils
│ └── convertor.go
├── .env
├── .test.env
├── .gitignore
├── .dockerignore
├── Dockerfile
├── docker-compose.yml
├── go.mod
└── go.sum
```## Run the project using Docker
```bash
docker-compose up --build
```
#### Check the API
```cURL
curl --location 'http://localhost:8080/sample/ping'
```
Response
```
{
"code": "10000",
"status": 200,
"message": "pong!"
}
```## Working on the project
You can read about using this framework here [github.com/unusualcodeorg/goserve](https://github.com/unusualcodeorg/goserve)## Read the Article to understand this project
[How to Architect Good Go Backend REST API Services](https://medium.com/@janishar.ali/how-to-architecture-good-go-backend-rest-api-services-14cc4730c05b)## Troubleshoot
Sometimes your operating system will block the binary from execution, you will have to provide permission to run it.> In Mac you have to go System Settings > Privacy & Security > Allow goservegen