# 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
Technologies Used
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
Database Setup and Migrations
Before running the service, you need to set up the database and apply the necessary migrations.
-
Database Setup:
- Ensure PostgreSQL is installed and running.
- Create a new database for the service, for example,
uniclubs_user_service
.
-
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
andpassword
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
# 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:
go run cmd/user-server/main.go
Or use the provided Taskfile to run the service:
task run:enviroment
or
task env