Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/arumandesu/uniclubs-user-service
- Owner: ARUMANDESU
- Created: 2024-01-10T16:46:48.000Z (10 months ago)
- Default Branch: dev
- Last Pushed: 2024-08-04T13:48:14.000Z (3 months ago)
- Last Synced: 2024-08-05T05:32:24.818Z (3 months ago)
- Topics: docker, go, golang, grpc, microservice, postgresql, rabbitmq, redis
- Language: Go
- Homepage:
- Size: 298 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Table of Contents
## 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.## Protofiles
* [Protofiles Repository][protofiles-url]
## 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]## 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
```### 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.### 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=
```## 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
```[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