Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ardem authored Sep 26, 2024
1 parent 0b0f52b commit e996a2c
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions backend/users/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
# User service
User service is responsible for storing user data and performing an authorization.
# YLEM USER MICROSERVICE

![Static Badge](https://img.shields.io/badge/Go-1.21-black)
<a href="https://github.com/ylem-co/ylem?tab=Apache-2.0-1-ov-file">![Static Badge](https://img.shields.io/badge/license-Apache%202.0-black)</a>
<a href="https://ylem.co" target="_blank">![Static Badge](https://img.shields.io/badge/website-ylem.co-black)</a>
<a href="https://docs.ylem.co" target="_blank">![Static Badge](https://img.shields.io/badge/documentation-docs.ylem.co-black)</a>
<a href="https://join.slack.com/t/ylem-co/shared_invite/zt-2nawzl6h0-qqJ0j7Vx_AEHfnB45xJg2Q" target="_blank">![Static Badge](https://img.shields.io/badge/community-join%20Slack-black)</a>

# Installation & running
Ylem User Microservice is responsible for storing user data, performing authorization, and providing an API for the UI.

## With Docker
# Usage

## Build an app

``` bash
$ docker-compose up
$ go build
```

## Run data migrations
## Run database migrations

``` bash
$ migrate -path /go/src/ylem_users/db/migration -database "mysql://${DATABASE_USER}:${DATABASE_PASSWORD}@(${DATABASE_HOST}:${DATABASE_PORT})/${DATABASE_NAME}" -verbose up
$ ./ylem_users db migrations migrate
```

# Usage

## Build an app
## Start application server

``` bash
$ go build
$ ./ylem_users server serve
```

It is now available inside the Ylem network on http://ylem_users:7333 or from the host machine on http://127.0.0.1:7333

## Run tests

``` bash
Expand All @@ -36,7 +42,7 @@ $ go test ./tests/... -v -vet=off
$ go test ./tests/... -coverpkg=./...
```

Or if you want an advanced coverage report
## Run tests with an advanced coverage report

``` bash
$ go test ./tests/... -coverpkg=./... -coverprofile cover.out
Expand All @@ -45,14 +51,6 @@ $ go tool cover -html cover.out -o cover.html

And then open cover.html

## Run server

``` bash
$ ./ylem_users server serve
```

It is available on http://localhost:7333

# Linter

## Install Golang linter on MacOS
Expand All @@ -67,5 +65,5 @@ $ brew upgrade golangci-lint
``` bash
$ golangci-lint run
```
More information is in the official documentation: https://golangci-lint.run/

More information is in the official documentation: https://golangci-lint.run/

0 comments on commit e996a2c

Please sign in to comment.