Skip to content

Commit

Permalink
doc(readme): added readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-id committed Sep 11, 2023
1 parent ed46da8 commit a68224e
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Go Notes example

### Tech stack:

* [GRPC Gateway](https://github.com/grpc-ecosystem/grpc-gateway) - gRPC Gateway
* [GRPC](https://grpc.io/) - gRPC
* [Protobuf](https://developers.google.com/protocol-buffers) - Protobuf
* [Wire](https://github.com/google/wire) - Automated Initialization in Go
* [SQLC](https://github.com/kyleconroy/sqlc) - A SQL Compiler
* [Go-redis](https://github.com/go-redis/redis) - Redis client for Golang
* [Zap](https://github.com/uber-go/zap) - Logger
---

* [Docker](https://www.docker.com/) - Docker
* [Docer Compose](https://docs.docker.com/compose/) - Docker Compose
* [Helm](https://helm.sh/) - Helm
* [k8s](https://kubernetes.io/) - k8s
* [GitHub Actions](https://github.com/features/actions) - GitHub Actions (_for lint and unit tests_)
---

* [Postman Collection](https://www.postman.com/) - Postman Collection (_third_party/PostmanCollection_)
* [OpenAPI](https://swagger.io/specification/) - OpenAPI (_third_party/OpenAPI_)
---

* [Excalidraw](https://excalidraw.com) - Excalidraw for diagrams

![go-notes.svg](doc/go-notes.svg)

---

### Usage local:

```bash
make docker-up // run all containers with application
```

The service is available at http://localhost:5555/v1/api. You can check it using Postman by importing the collection
located at `third_party/PostmanCollection/Notes.postman_collection.json`.

### Stop containers:

```bash
make docker-down // stop containers
```

---

### TESTS

### 1. Postman

To import a collection into Postman, you should use the `Import` button in the top-left corner of the Postman window.

Before running the tests, it's necessary to set the required environment variables:

`baseUrl`: the address of the server where the project is running.

Example: `http://localhost:5555/v1/api`

To run the tests in Postman, you should select the collection (`Notes -> Tests`), and then click the
button (`Run folder -> Run Notes`).

The passed tests will appear as follows:

![postman_tests.png](doc/postman_tests.png)

---

### Unit tests

```bash
make test-run // run unit tests
```

---

## k8s

To deploy the project in Kubernetes (k8s), Helm is used.

```bash
cd .charts/go-notes/proxy && \
helm dependency update && \
helm install -f values.yaml go-notes .
```

---

### Checking the Swagger documentation:

Take the generated file `{{service}}.swagger.json` from the `third_party/OpenAPI` directory.
Paste it into the [Swagger Editor](https://editor.swagger.io).

![open_api.png](doc/open_api.png)
17 changes: 17 additions & 0 deletions doc/go-notes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/open_api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/postman_tests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a68224e

Please sign in to comment.