Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/arumandesu/uniclubs-user-service

User Service of a University Club Management Web Application
https://github.com/arumandesu/uniclubs-user-service

docker go golang grpc microservice postgresql rabbitmq redis

Last synced: 5 days ago
JSON representation

User Service of a University Club Management Web Application

Awesome Lists containing this project

README

        





Logo

AITU UCMS User Service


Table of Contents


  1. About The Project

  2. Protofiles

  3. Technologies Used

  4. Getting Started


  5. Running the Service

## About The Project
This service is part of the University Clubs Management application, focusing on user management and authentication.
It handles operations such as user registration, authentication, global role management, and more.

(back to top)

## Protofiles

* [Protofiles Repository][protofiles-url]

(back to top)

## Technologies Used

* [![Go][go-shield]][go-url]
* [![PostgreSQL][postgres-shield]][postgres-url]
* [![Redis][redis-shield]][redis-url]
* [![gRPC][grpc-shield]][go-url]
* [![RabbitMQ][rabbitmq-shield]][rabbitmq-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.21.4
- PostgreSQL 16
- Docker 4.26.1

### Installation
Clone the repository:
```bash
git clone https://github.com/ARUMANDESU/uniclubs-user-service.git
cd uniclubs-user-service
go mod download
```

(back to top)

### Database Setup and Migrations
Before running the service, you need to set up the database and apply the necessary migrations.

1. **Database Setup**:
- Ensure PostgreSQL is installed and running.
- Create a new database for the service, for example, `uniclubs_user_service`.

2. **Applying Migrations**:
- Install [migration tool](https://github.com/golang-migrate/migrate/tree/master/cmd/migrate)
- Run the migration command to set up the schema:
```bash
migrate -path ./migrations -database postgresql://username:password@localhost:5432/uniclubs_user_service up
```
- Replace `uniclubs_user_service`, `username` and `password` with your database credentials.

(back to top)

### Configuration
The Uniclubs User Service requires a configuration file to specify various settings like database connections,
and service-specific parameters.
Depending on your environment (development, test, or production), different configurations may be needed.

#### Setting Up Configuration
```dotenv
# Example configuration snippet
ENV=dev
# Database Configuration
DATABASE_DSN=postgresql://postgres:[email protected]:5432/uniclubs_user_service
REDIS_URL=redis://:@localhost:6379
# Server Configuration
GRPC_PORT=
GRPC_TIMEOUT=
# RabbitMQ Configuration
RABBITMQ_USER=
RABBITMQ_PASSWORD=
RABBITMQ_HOST=
RABBITMQ_PORT=
# JWT Configuration
ACCESS_TOKEN_DURATION=15m
ACCESS_TOKEN_SECRET=
REFRESH_TOKEN_SECRET=
```

(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:enviroment
```
or
```bash
task env
```

(back to top)

[aitu-url]: https://astanait.edu.kz/
[aitu-ucms-url]: https://www.ucms.space/
[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/
[redis-url]: https://redis.io/
[postgres-url]: https://www.postgresql.org/
[grpc-url]: https://grpc.io/
[tasks-url]: https://taskfile.dev/
[rabbitmq-url]: https://www.rabbitmq.com/

[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
[redis-shield]: https://img.shields.io/badge/Redis-DC382D?style=for-the-badge&logo=redis&logoColor=white
[postgres-shield]: https://img.shields.io/badge/PostgreSQL-336791?style=for-the-badge&logo=postgresql&logoColor=white
[grpc-shield]: https://img.shields.io/badge/gRPC-008FC7?style=for-the-badge&logo=google&logoColor=white
[tasks-shield]: https://img.shields.io/badge/Taskfile-00ADD8?style=for-the-badge&logo=go&logoColor=white
[rabbitmq-shield]: https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white