This service is part of the University Clubs Management application, focusing on user management and authentication. It handles operations such as user registration, authentication, role management, and more.
- User Registration
- User Authentication
- Role-based Access Control
- Additional features include user profile management...
- Go
- gRPC
- PostgreSQL
- Docker
- Redis
- Taskfile
- Go version 1.21.4
- PostgreSQL 16
- Docker 4.26.1
Clone the repository:
git clone https://github.com/ARUMANDESU/uniclubs-user-service.git
cd uniclubs-user-service
go mod download
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
username
andpassword
with your database credentials.
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.
# Example configuration snippet
ENV=dev
# Database Configuration
DATABASE_DSN=postgresql://postgres:password@172.17.0.1:5432/uniclubs_user_service
REDIS_URL=redis://:@localhost:6379
# Server Configuration
GRPC_PORT=44044
GRPC_TIMEOUT=1h
# RabbitMQ Configuration
RABBITMQ_USER=user
RABBITMQ_PASSWORD=password
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
# JWT Configuration
ACCESS_TOKEN_DURATION=15m
ACCESS_TOKEN_SECRET=hart_secret_key
REFRESH_TOKEN_SECRET=very_hard_secret_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:enviroment
#or
task env