This service is part of the University Clubs Management application, focusing on connecting API endpoints with other microservices.
Table of Contents
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.
-
Go version 1.22
-
Docker 4.29.0
-
go version docker --version vips --version
-
Clone the repository:
git clone https://github.com/ARUMANDESU/university-clubs-backend.git cd university-clubs-backend go mod download
The UCMS API Gateway requires a configuration file to specify various settings such as service-specific parameters and other microservices addresses.
Create .env file:
touch .env
# 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=
After setting up the database and configuring the service, you can run it as follows:
go run cmd/user-server/main.go
Or use the provided Taskfile to run the service:
task run:environment
or
task env