This is a simple blogging application developed in golang with the purpose of implementing a microservice architecture while using Domain Driven Design and good development practices.
As a proof of concept, there are two microservices, one for the blogging application itself (that uses mongodb and redis for caching). And another microservice that receives messages by RabbitMQ, that works as a logging service.
In addition, the application implements the following patterns:
- Repository Pattern
- Mediator Pattern (via go-mediatr)
- CQRS Pattern
- Controller contracts
The whole app is developed with Domain Driven Design in mind.
All the microservices and databases are handled by docker compose, its configuration can be found at the root of the project. All the endpoints are handled by golang's echo framework, but most dependencies are abstracted away to keep the code clean.
The following endpoints are currently implemented:
- GET /user/{id}
- POST /login/{id}
- POST /user
- PATCH /user/{id}
- GET /post/{postId}/comment/{commentId}
- POST /post/{postId}/comment
- PATCH /post/{postId}/comment/{commentId}
- DELETE /post/{postId}/comment/{commentId}
- GET /comment/{id}
- POST /comment
- PATCH /comment/{id}
Running the application is quite simple, clone the repository and run it with docker compose:
git clone github.com/GustavoBodi/go-blogging
cd go-blogging
docker compose up