A robust authentication service built with Go, featuring JWT-based authentication, user management, and secure password handling.
- Go 1.19 or higher
- PostgreSQL
- Clone and install dependencies:
git clone https://github.com/Masters-Degree-Project/user-service
cd https://github.com/Masters-Degree-Project/user-service
go mod download
- Configure environment:
- Copy
.env.dist
to.env
- Update the variables in
.env
file
- Copy
Start the server:
go run cmd/main.go
Required environment variables:
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=your_database
JWT_SECRET=your_jwt_secret
POST /api/v1/login
- Login with email and password
- Request body:
{"email": "[email protected]", "password": "yourpassword"}