You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For information about the project's database, see the [DB.md](docs/DB.md) file.
59
+
2. Install the dependencies:
67
60
68
-
### Protocol Buffer
61
+
```bash
62
+
make dep
63
+
```
69
64
70
-
To use protocol buffer for gRPC communication please refer to [Protohub](https://github.com/infranyx/protobuf-template). Protohub is a hub for managing your protobuf files and with auto generation feature you can simply `go get`the generated code of your proto.
65
+
3. Run the development server:
71
66
72
-
### API docs
67
+
```bash
68
+
make run_dev
69
+
```
73
70
74
-
The template doesn't have API docs. For auto-generated API docs that you include, you can also give instructions on the
75
-
build process.
71
+
This will start the http server on port 4000 and grpc server on port 3000. You can customize the ports by setting the `HTTP_PORT` and `GRPC_PORT` environment variable.
76
72
77
-
### Docker Compose
73
+
##Testing
78
74
79
-
Using Compose is an easy way to manage multi-container applications on any system that supports Docker.
75
+
To run the tests, use the following command:
80
76
81
77
```bash
82
-
docker-compose up -d # it runs all necessary docker images that is needed
78
+
make test
79
+
```
80
+
81
+
To generate a test coverage report, use the following command:
83
82
84
-
docker-compose -f docker-compose.e2e-local.yaml up -d # it runs all necessary docker images for Testing environment
83
+
```bash
84
+
make test_coverage
85
85
```
86
86
87
87
### Linting
88
88
89
-
Linting is an important part of any Go project. It helps to ensure that code is written in a consistent and maintainable way, and can help to catch potential errors before they become problems. It is important to note that linting should be done regularly throughout the development process, not just at the end. This will help ensure that any potential issues are caught early on and can be fixed quickly and easily.
89
+
To lint the code, use the following command:
90
+
91
+
```bash
92
+
make lint
93
+
```
94
+
95
+
This will run all available linters, including Go lint, Dockerfile lint, and YAML lint.
96
+
97
+
### Building
98
+
99
+
To build the binary, use the following command:
100
+
101
+
```bash
102
+
make build
103
+
```
104
+
105
+
This will create a binary in the `out/bin` directory. You can run the binary with the following command:
106
+
107
+
```bash
108
+
make run
109
+
```
110
+
111
+
### Cleaning
112
+
113
+
To clean the build artifacts and generated files, use the following command:
90
114
91
-
To lint your Go project, you can simply use makefile
115
+
```bash
116
+
make clean
117
+
```
92
118
93
-
```makefile
94
-
lint-dockerfile: # Lint your Dockerfile
119
+
This will remove the `bin` and `out` directories, as well as any build-related files.
95
120
96
-
lint-go: # Use golintci-lint on your project
121
+
### Continuous Integration
122
+
123
+
To run the continuous integration tasks, use the following command:
124
+
125
+
```bash
126
+
make ci
97
127
```
98
128
129
+
This will run the tests, linting, and code coverage tasks, and generate the corresponding reports. The reports will be saved to the `out` directory.
Copy file name to clipboardExpand all lines: docs/design.md
+11
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,8 @@
5
5
-[Key Components and Features](#key-components-and-features)
6
6
-[Design Decisions](#design-decisions)
7
7
-[See also](#see-also)
8
+
-[Protocol Buffer](#protocol-buffer)
9
+
-[API docs](#api-docs)
8
10
-[Layout](#layout)
9
11
-[Error Handling](#error-handling)
10
12
-[Diagrams and Mockups](#diagrams-and-mockups)
@@ -52,6 +54,15 @@ The following design decisions were made:
52
54
-[errors](https://github.com/pkg/errors) for error handling and adding stack trace to golang
53
55
-[OZZO](github.com/go-ozzo/ozzo-validation) for data validation
54
56
57
+
## Protocol Buffer
58
+
59
+
To use protocol buffer for gRPC communication please refer to [Protohub](https://github.com/infranyx/protobuf-template). Protohub is a hub for managing your protobuf files and with auto generation feature you can simply `go get` the generated code of your proto.
60
+
61
+
## API docs
62
+
63
+
The template doesn't have API docs. For auto-generated API docs that you include, you can also give instructions on the
64
+
build process.
65
+
55
66
## Layout
56
67
57
68
The project is organized into a number of directories and subdirectories, as shown in the following tree structure:
0 commit comments