GOlerplate is a template for web applications in Golang. This means it can be a starting point for web applications in Golang, designed to facilitate development with a clean and modular architecture.
- Language: Go
- Frameworks and Libraries: Gorilla Mux, GORM
- Containers: Docker, Docker Compose
- Documentation: Swagger
- Docker
- Docker Compose
- Go (optional if you want to use CLI)
-
Clone the repository:
git clone https://github.com/Figaarillo/golerplate.git cd golerplate
-
Copy the
.env.example
file to.env
:cp .env.example .env
-
Run the server and database through Docker
make docker.run
-
Run the server locally and the database with Docker
make run
To run all unit tests:
make test.unit
To run a single unit test:
make test.unit.[entity_name]
For example, to run the unit test for category:
make test.unit.category
To run all integration tests:
make test.e2e
To run a single integration test:
make test.e2e.[entity_name]
For example, to run the integration test for category:
make test.e2e.category
.
├── cmd
│ └── api # Main entry point of the application
├── docs # Swagger generated documentation
├── internal
│ ├── application
│ │ └── usecase # Application use cases
│ ├── domain
│ │ ├── entity # Domain entity definitions
│ │ ├── exception # Domain exception handling
│ │ └── repository # Repository interfaces
│ ├── infrastructure
│ │ ├── handler # HTTP handlers
│ │ ├── middleware # HTTP middlewares
│ │ ├── repository # Repository implementations
│ │ └── router # Route definitions
│ ├── setup # Initial setup
│ ├── share
│ │ ├── config # Shared configuration
│ │ ├── exception # Shared exception handling
│ │ ├── utils # Shared utilities
│ │ └── validation # Shared validations
│ └── test # Unit and integration tests
└── scripts # Automation scripts
- REST API: CRUD implementation for entities.
- Tests: Unit and integration tests.
- Documentation: API documentation with Swagger.
- Architecture: Implements clean and hexagonal architecture principles.
License
This project is licensed under the MIT License.