This project is a microservice-based mailing list management system built with Go, gRPC, and Docker. It includes an HTTP API for handling JSON requests and a gRPC API for more efficient communication between microservices. The system uses SQLite as its database.
├── db
│ └── db.go
├── docker-compose.yml
├── go.mod
├── go.sum
├── grpc_api
│ ├── grpc_client
│ │ ├── Dockerfile
│ │ └── grpc_client.go
│ └── grpc_server
│ └── grpc_server.go
├── json_api
│ └── handlers.go
├── LICENSE
├── mailinglist.db
├── proto
│ ├── email_grpc.pb.go
│ ├── email.pb.go
│ └── email.proto
├── README.md
└── server
├── Dockerfile
└── server.go
7 directories, 16 files
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/younesious/mailing-list-microservice.git cd mailing-list-microservice
-
Build and start the services using Docker Compose:
docker compose up --build
-
The HTTP server will be available on
http://localhost:8080
and the gRPC server onhttp://localhost:8081
.
- Add Email:
POST /email/add
- Get Email:
GET /email/get
- Update Email:
PUT /email/update
- Delete Email:
DELETE /email/delete
- Get Email Batch:
GET /email/batch
The gRPC API can be accessed using any gRPC client. Refer to the proto/email.proto
file for the service definitions.
To build the project manually:
-
Build the server:
docker build -t myserver -f server/Dockerfile .
-
Build the client:
docker build -t myclient -f grpc_api/grpc_client/Dockerfile .
To run the gRPC server and client:
docker compose up --build
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to contribute and I'll be happy to see you :)