EventHub is a Go-based event management system that leverages Protocol Buffers (Protobuf), gRPC, and MongoDB. It is designed with high-performance logging using Uber Zap and modularized dependency injection through Uber FX.
Ensure you have the following installed:
-
Go 1.20+: The language this project is written in. Installation instructions.
-
MongoDB: The database management system used. Create a free MongoDB Atlas cluster here and follow the installation steps.
-
Mage: A build tool CLI, that automatically uses Go functions as Makefile-like runnable targets. Installation instructions.
- Clone the Repository:
git clone https://github.com/villaleo/eventhub.git
cd eventhub
- Install Dependencies:
After installing the prerequisites, run this command to install all other required tools.
mage
- Generate Protobuf Files: After setup, generate the necessary protobuf files.
mage gen
- Default Port:
Starts the server with the default port 50051.
mage server:run
- Using a Custom Port:
Starts the server using a specific port.
mage server:start 50051
- Default Address:
Runs the client using the default address localhost:50051
.
mage client:run
- Using a Custom Address:
Starts the client using a specific address.
mage client:start localhost:50051
Linting is ran by default before starting the server. It is required and cannot be disabled.
mage lint
To see all the commands available for this project, run this command.
mage -l
Or checkout a specific target's usage.
mage -h server:start