Categorygithub.com/ARUMANDESU/uniclubs-user-service
repository
0.0.0-20240804134810-2a71eb09fc53
Repository: https://github.com/arumandesu/uniclubs-user-service.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# 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

(back to top)

Technologies Used

  • Go
  • PostgreSQL
  • Redis
  • gRPC
  • RabbitMQ
  • Docker
  • Docker Compose
  • Taskfile

(back to top)

Getting Started

Prerequisites

  • Go version 1.21.4
  • PostgreSQL 16
  • Docker 4.26.1

Installation

Clone the repository:

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
    • Run the migration command to set up the schema:
      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

# 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:

go run cmd/user-server/main.go

Or use the provided Taskfile to run the service:

task run:enviroment

or

task env

(back to top)