Skip to content

An implementation of microservices oriented in domain driven design making a simple blogging application. The program uses MongoDB, implements caching and makes extensive use of design patterns.

License

Notifications You must be signed in to change notification settings

GustavoBodi/go-blogging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Go Blog

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.

Architecture

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.

Organization

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.

Endpoints

The following endpoints are currently implemented:

Users

  • GET /user/{id}
  • POST /login/{id}
  • POST /user
  • PATCH /user/{id}

Comments

  • GET /post/{postId}/comment/{commentId}
  • POST /post/{postId}/comment
  • PATCH /post/{postId}/comment/{commentId}
  • DELETE /post/{postId}/comment/{commentId}

Posts

  • GET /comment/{id}
  • POST /comment
  • PATCH /comment/{id}

How to run

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

About

An implementation of microservices oriented in domain driven design making a simple blogging application. The program uses MongoDB, implements caching and makes extensive use of design patterns.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published