goapisuit is a lightweight and easy-to-use Golang framework that simplifies API creation and database management using GoFiber. It aims to accelerate the development of APIs by providing built-in commands for generating models, routers, and handling database migrations.
- Fast API Creation: Automatically generate routes and models.
- Database Management: Seamlessly handle migrations with built-in commands.
- GoFiber Integration: Utilize the powerful and efficient GoFiber web framework.
To use goapisuit, you need the following installed:
- Golang
- A relational database (e.g., MySQL etc.)
- Git for cloning the repository
-
Install CLI
heykrit
for thegoapisuit
:go install -v github.com/krittakondev/goapisuit/cmd/heykrit@latest
-
Make your project:
mkdir nameproject cd nameproject go mod init you/projectpath heykrit init
-
Config your project in
.env
-
Run your project:
go run cmd/server.go
Here's a brief overview of the generated directory structure:
nameproject/
├── cmd/
│ └── server.go # Entry point of your project
├── internal/
│ ├── models/ # Contains your data models (e.g., user.go)
│ └── routes/ # Contains API route handlers
├── public/ # Directory for static files (e.g., CSS, JavaScript, images)
├── go.mod
└── go.sum
└── .env # config project
Once the setup is complete, you can build upon this project by adding new models and routes using the provided commands. For example, to create a new module for handling products:
-
Generate a new
product
Route and Model:heykrit make product
Generate 2 files
internal/routes/Product.go
andinternal/models/Product.go
-
Modify the generated
internal/models/Product.go
model as needed, and then apply the migration (gorm model):heykrit db:migrate product
-
Run server:
go run cmd/server.go
If you'd like to contribute to goapisuit
, feel free to open a pull request or issue on the GitHub repository.
This project is licensed under the MIT License.
A web framework that brings lightning-fast performance to your Golang applications. A powerful ORM library for Golang, simplifying database handling and migrations.