The FinMan User Service is a microservice responsible for managing user information in the FinMan system. It includes functionalities for creating, retrieving, updating, and deleting users, as well as handling user authentication and pagination. Please note that the default username and password is admin.
- Features
- Requirements
- Installation
- Usage
- Environment Variables
- API Documentation
- Contributing
- License
- Create a new user
- Retrieve user by ID
- Retrieve all users
- Update user details
- Delete a user
- Get user by username and password
- Get users with pagination
- Handle user authentication
- Database migrations using golang-migrate
- JWT authentication
- Password hashing with bcrypt
- Go 1.22+
- Docker (for containerized deployment)
-
Clone the repository:
git clone https://github.com/yourusername/finman-user-service.git cd finman-user-service
-
Install dependencies:
go mod tidy
-
Set up the environment variables in a
.env
file (see Environment Variables section).
or simply run it with docker
-
Build the service:
go build -o user-service .
-
Run the service:
./user-service
-
Build the Docker image:
docker build -t finman-user-service .
-
Run the Docker container:
docker-compose up --build
Create a .env
file in the root directory with the following content:
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=finman-user
PORT=8081
IP=0.0.0.0
```