This project is a basic voting system where an API handles vote requests and publishes messages to a message broker, and a consumer processes these votes asynchronously and save them to a database.
Diagrams
Architecture Diagram
Tech Stack-Backend: Golang
Go 1.22
PostgreSQL
RabbitMQ
Nginx
Setup
Install dependencies:
go mod tidy
Set up environment variables:
Create a .env file from .env.exampl and replace the values with your secrets
cp .env.example .env
Set up docker container
docker-compose up -d
Start HTTP server
go run scripts/loadtest.go
Contributing
Contributions are welcome! Please open an issue or submit a pull request.