GoCore is a comprehensive Golang API starter kit that provides a solid foundation for building scalable and maintainable APIs using the Go programming language. It comes with project templates, best practices, and a set of tools to streamline the development process.
-
Modular Structure: Organize your project into modules for better code organization and maintainability.
-
Middleware Support: Easily integrate middleware for handling cross-cutting concerns such as authentication, logging, and error handling.
-
Configuration Management: Manage configuration settings efficiently with support for environment-specific configurations.
-
Database Integration: Includes support for popular databases like PostgreSQL, MySQL, and SQLite.
-
API Documentation: Automatic generation of API documentation using Swaggo.
-
Security Best Practices: Enforce security best practices for handling authentication, authorization, and data protection.
-
Logging and Monitoring: Integrated logging and monitoring for better visibility into the application's behavior
root
├── cmd // first entry for run command
├── config // logic for process config
├── docs // auto gen swagger api docs
├── functions // function run independent with api service
├── internal // main logic of service
├── pkg // for reusable
├── scripts // bash script for run command
└── vendor // dependencies package
- Initialize the app for the first time:
make provision
- Generate swagger API docs:
make specs
- Run the development server:
make dev
- Documentation Apis:
GoCore uses swagger open api, navigate to
/docs/index.html
for getting the list endpoints. The application runs as an HTTP server at port 8080. You can log in as superadmin to the application by:
POST /login HTTP/1.1
Host: localhost:8080
Content-Type: application/json
{
"username": "superadmin",
"password": "superadmin123!@#"
}
Then grab the access_token
for authorization HTTP header:
GET /v1/users HTTP/1.1
Host: localhost:8080
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ...
Comming soon
go get -u github.com/vuduongtp/go-core
This project is made available under the MIT license. See LICENSE for details.