Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arumandesu/university-clubs-backend

API Gateway of a University Club Management Web Application
https://github.com/arumandesu/university-clubs-backend

api-gateway backend go golang grpc grpc-client

Last synced: 5 days ago
JSON representation

API Gateway of a University Club Management Web Application

Awesome Lists containing this project

README

        





Logo

AITU UCMS API Gateway



This service is part of the University Clubs Management application, focusing on connecting API endpoints with other microservices.


Table of Contents


  1. About The Project

  2. Other Microservices

  3. Protofiles

  4. Technologies Used

  5. Getting Started


  6. Running the Service

## About The Project

This API Gateway service is a critical component of the University Clubs Management System (UCMS) at AITU. It serves as the intermediary, routing requests to various backend microservices.

![High Level Architecture](https://github.com/user-attachments/assets/dda8fb46-1233-4d9f-a816-38d9ef5050fd)

(back to top)

## Other Microservices

* [User Service][user-service-url]
* [Club Service][club-service-url]
* [Posts Service][posts-service-url]
* [Comments Service][comments-service-url]
* [Notification Service][notification-service-url]

(back to top)

## Protofiles

* [Protofiles Repository][protofiles-url]

(back to top)

## Technologies Used

* [![Go][go-shield]][go-url]
* [![Gin][gin-shield]][gin-url]
* [![gRPC][grpc-shield]][go-url]
* [![Docker][docker-shield]][docker-url]
* [![Docker Compose][docker-compose-shield]][docker-compose-url]
* [![Taskfile][tasks-shield]][tasks-url]

(back to top)

## Getting Started

### Prerequisites

* Go version 1.22
* Docker 4.29.0
* [Libvips](https://www.libvips.org) (required for [bimg](https://github.com/h2non/bimg))

```sh
go version
docker --version
vips --version
```

### Installation

1. Clone the repository:

```bash
git clone https://github.com/ARUMANDESU/university-clubs-backend.git
cd university-clubs-backend
go mod download
```

(back to top)

### Configuration

The UCMS API Gateway requires a configuration file to specify various settings such as service-specific parameters and other microservices addresses.

Create .env file:
```bash
touch .env
```

#### Example Configuration Snippet

```dotenv
# Example configuration snippet
ENV=dev
SHUTDOWN_TIMEOUT=10s
JWT_SECRET=

# HTTP
HTTP_ADDRESS=
HTTP_TIMEOUT=5s
HTTP_IDLE_TIMEOUT=3s

# Microservices
USER_SERVICE_ADDRESS=
USER_SERVICE_TIMEOUT=10s
USER_SERVICE_RETRIES_COUNT=

CLUB_SERVICE_ADDRESS=
CLUB_SERVICE_TIMEOUT=10s
CLUB_SERVICE_RETRIES_COUNT=

EVENT_SERVICE_ADDRESS=localhost:44046
EVENT_SERVICE_TIMEOUT=10s
EVENT_SERVICE_RETRIES_COUNT=2

COMMENT_SERVICE_ADDRESS=localhost:44047
COMMENT_SERVICE_TIMEOUT=10s
COMMENT_SERVICE_RETRIES_COUNT=2

# OIDC
MICROSOFT_OIDC_SECRET=
MICROSOFT_OIDC_AUTHORITY=
MICROSOFT_OIDC_CLIENT_ID=

# S3
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
```

(back to top)

## Running the Service

After setting up the database and configuring the service, you can run it as follows:

```bash
go run cmd/user-server/main.go
```

Or use the provided Taskfile to run the service:

```bash
task run:environment
```
or
```bash
task env
```

(back to top)

[aitu-url]: https://astanait.edu.kz/
[aitu-ucms-url]: https://www.ucms.space/

[user-service-url]: https://github.com/ARUMANDESU/uniclubs-user-service
[club-service-url]: https://github.com/ARUMANDESU/uniclubs-club-service
[posts-service-url]: https://github.com/ARUMANDESU/uniclubs-posts-service
[comments-service-url]: https://github.com/ARUMANDESU/uniclubs-comments-service
[notification-service-url]: https://github.com/ARUMANDESU/uniclubs-notification-service
[protofiles-url]: https://github.com/ARUMANDESU/uniclubs-protos

[go-url]: https://golang.org/
[docker-url]: https://www.docker.com/
[docker-compose-url]: https://docs.docker.com/compose/
[grpc-url]: https://grpc.io/
[gin-url]: https://gin-gonic.com/
[tasks-url]: https://taskfile.dev/

[go-shield]: https://img.shields.io/badge/Go-00ADD8?style=for-the-badge&logo=go&logoColor=white
[docker-shield]: https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white
[docker-compose-shield]: https://img.shields.io/badge/Docker_Compose-2496ED?style=for-the-badge&logo=docker&logoColor=white
[grpc-shield]: https://img.shields.io/badge/gRPC-008FC7?style=for-the-badge&logo=google&logoColor=white
[gin-shield]: https://img.shields.io/badge/Gin-00ADD8?style=for-the-badge&logo=go&logoColor=white
[tasks-shield]: https://img.shields.io/badge/Taskfile-00ADD8?style=for-the-badge&logo=go&logoColor=white