Skip to content

Commit d2fe57a

Browse files
committed
Merge branch 'features/cache' of github.com:thuan2172001/rust-api-server into features/cache
2 parents 10ef954 + af498b1 commit d2fe57a

File tree

16 files changed

+268
-179
lines changed

16 files changed

+268
-179
lines changed

Cargo.lock

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tags [here](https://hub.docker.com/r/thuan2172001/rust-server/tags).
1919

2020
**Release Binaries:**
2121
For every release, separate `cli` binaries are built. These binaries can be downloaded
22-
from [here](https://github.com/sonntuet1997/rust-web-api-microservice-template/releases) and are available for various operating
22+
from [here](https://github.com/sonntuet1997/rust-web-api-microservice-template/releases) and are available for various operating
2323
systems and architectures. You are welcome to use the automated binaries or build your own.
2424

2525
**Contributions and PRs:**
@@ -95,26 +95,28 @@ options:
9595

9696
Hierarchical child config via env, separated by using `__`. Specify list values by using `,` separator
9797

98-
| ENV | DEFAULT VALUE | NOTE |
99-
|------------------------------------------------------------------------|---------------|-----------|
100-
| [RUST_LOG](https://docs.rs/env_logger/latest/env_logger/) > LOG__LEVEL | "INFO" | Log level |
101-
| SERVER__URL | | |
102-
| SERVER__PORT | | |
103-
| SERVICE_NAME | | |
104-
| EXPORTER_ENDPOINT | | |
105-
| DB__PG__URL | | |
106-
| DB__PG__MAX_SIZE | | |
98+
| ENV | DEFAULT VALUE | NOTE |
99+
| ------------------------------------------------------------------------ | ------------- | --------- |
100+
| [RUST_LOG](https://docs.rs/env_logger/latest/env_logger/) > LOG\_\_LEVEL | "INFO" | Log level |
101+
| SERVER\_\_URL | | |
102+
| SERVER\_\_PORT | | |
103+
| SERVICE_NAME | | |
104+
| EXPORTER_ENDPOINT | | |
105+
| DB\_\_PG\_\_URL | | |
106+
| DB\_\_PG\_\_MAX_SIZE | | |
107+
| REDIS\_\_HOST | | |
108+
| REDIS\_\_PORT | | |
107109

108110
Make sure to set these environment variables according to your needs before running the server.
109111

110112
## GitHub Flow CI Configuration
111113

112114
1. **Set Docker Hub Secrets:**
113-
- Go to repository Settings > Secrets.
114-
- Add `DOCKER_USERNAME` and `DOCKERHUB_TOKEN`.
115+
- Go to repository Settings > Secrets.
116+
- Add `DOCKER_USERNAME` and `DOCKERHUB_TOKEN`.
115117

116118
2. **Enable Dependabot Alerts:**
117-
- In repository Insights, enable "Dependabot alerts" and "Security & Analysis."
119+
- In repository Insights, enable "Dependabot alerts" and "Security & Analysis."
118120

119121
## Checklist
120122

@@ -126,7 +128,7 @@ include:
126128
1. [x] Incorporating descriptive comments to enhance code readability.
127129
2. [x] Implementing tracing mechanisms for effective debugging.
128130
3. [x] Writing comprehensive test cases to validate functionality.
129-
1. [x] Using https://testcontainers.com for integration tests.
131+
1. [x] Using https://testcontainers.com for integration tests.
130132
4. [x] Utilizing version control with [Git](https://git-scm.com/) for code management.
131133
5. [x] Structuring code in a logical and maintainable manner.
132134
6. [x] Containerizing the application using [Docker](https://www.docker.com/) for portability and scalability.
@@ -136,19 +138,19 @@ include:
136138
Demonstrate proficiency in advanced development practices including:
137139

138140
1. [x] CLI Interface.
139-
1. [x] Embed Git Info, Config Tool.
141+
1. [x] Embed Git Info, Config Tool.
140142
2. [x] Load Configuration from a File.
141143
3. [x] Multiple Implementations.
142144
4. [x] Advanced Tracing.
143145
5. [x] CI/CD.
144-
1. [x] Publish binary artifacts in [Github](https://github.com/).
145-
2. [x] Push Docker images.
146-
3. [x] Build pipeline on amd arch.
147-
4. [ ] Build pipeline on arm arch.
146+
1. [x] Publish binary artifacts in [Github](https://github.com/).
147+
2. [x] Push Docker images.
148+
3. [x] Build pipeline on amd arch.
149+
4. [ ] Build pipeline on arm arch.
148150
6. [x] Docker Image Optimization.
149151
7. [x] Load test using [K6](https://k6.io/).
150-
1. [x] Use [Flamegraph](https://github.com/flamegraph-rs/flamegraph) for profiling.
151-
2. [ ] [Better UI](https://medium.com/swlh/beautiful-load-testing-with-k6-and-docker-compose-4454edb3a2e3).
152+
1. [x] Use [Flamegraph](https://github.com/flamegraph-rs/flamegraph) for profiling.
153+
2. [ ] [Better UI](https://medium.com/swlh/beautiful-load-testing-with-k6-and-docker-compose-4454edb3a2e3).
152154
8. [ ] Comprehensive DB query filter for list().
153155
9. [ ] Optimize release binary performance.
154156
10. [ ] Docs on how to use this repo, the design behind the scene.
@@ -162,4 +164,4 @@ Feel free to explore and expand upon these functionalities as needed for your pr
162164

163165
For load testing and profiling your Rust API server, refer to
164166
the [Load Testing and Profiling with K6 and Flamegraph](./load-tests/README.md) guide. This document provides
165-
detailed instructions on using K6 and Flamegraph for load testing and profiling purposes.
167+
detailed instructions on using K6 and Flamegraph for load testing and profiling purposes.

deploy/docker/01-custom.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ level = "info"
1010

1111
[db.pg]
1212
url = "postgres://postgres:changeme@postgres:5432/postgres"
13-
max_size = 10
13+
max_size = 10
14+
15+
[redis]
16+
host = "0.0.0.0"
17+
port = 6379

0 commit comments

Comments
 (0)