Skip to content

Commit 19aef12

Browse files
committed
docs: finalized readme
1 parent 8d07ef9 commit 19aef12

File tree

2 files changed

+45
-10
lines changed

2 files changed

+45
-10
lines changed

.github/workflows/elixir-ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ defaults:
1414
working-directory: backend
1515

1616
jobs:
17-
check_lint:
18-
name: Check Lint
17+
check_format:
18+
name: Check Format
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
@@ -37,11 +37,11 @@ jobs:
3737
restore-keys: ${{ runner.os }}-mix-
3838
- name: deps
3939
run: mix deps.get
40-
- name: LINT CODE
41-
run: mix credo --strict
40+
- name: FORMAT
41+
run: mix format --check-formatted
4242

43-
check_format:
44-
name: Check Format
43+
check_lint:
44+
name: Check Lint
4545
runs-on: ubuntu-latest
4646
steps:
4747
- uses: actions/checkout@v2
@@ -63,8 +63,8 @@ jobs:
6363
restore-keys: ${{ runner.os }}-mix-
6464
- name: deps
6565
run: mix deps.get
66-
- name: FORMAT
67-
run: mix format --check-formatted
66+
- name: LINT CODE
67+
run: mix credo --strict
6868

6969
check_security:
7070
name: Check Security

backend/README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ mix coveralls.html
5050
mix phx.server
5151
```
5252

53-
After these commands, you can access the following features at [`localhost:4000`](http://localhost:4000). The API documentation is avaliable at `/docs` path only in `dev` or `test` environment. I wrote with [API Blueprint](https://apiblueprint.org),
53+
After these commands, you can access the following features at [`localhost:4000`](http://localhost:4000) and the API documentation is avaliable at `/docs` path only in `dev` or `test` environment.
5454

55-
> **Note:** I used [apiary](https://apiary.io) editor and generated the static `HTML` with [aglio](https://github.com/danielgtaylor/aglio).
55+
> **Note:** I wrote API documentation with [API Blueprint](https://apiblueprint.org), I used [apiary](https://apiary.io) editor and generated the static `HTML` with [aglio](https://github.com/danielgtaylor/aglio).
5656
5757
## :dart: My decisions
5858

@@ -208,3 +208,38 @@ sequenceDiagram
208208
O_COMMAND-->>-BACKEND: :200 ++ :order
209209
BACKEND-->>-FRONTEND: :200 ++ :order
210210
```
211+
212+
## CI / CD
213+
214+
> Flow chart:
215+
216+
```mermaid
217+
graph LR
218+
A([code]) -->|"push (master) or <br/> pull_request"| B{is backend ?}
219+
220+
subgraph "Github Action (elixir ci)"
221+
B -->|yes| E[[check format]]
222+
E --> F[[check lint]]
223+
F --> H[[check security]]
224+
H --> I[[check quality]]
225+
I --> J{passed?}
226+
227+
B -->|no| D([released merge])
228+
J --> |no| L[/failed build/]
229+
J --> |yes| N[/successed build/]
230+
end
231+
232+
L --> M([locked merge])
233+
N --> |"merge (master)"| O
234+
235+
subgraph Heroku
236+
O[[deploy]]
237+
end
238+
```
239+
240+
## Future improvements
241+
242+
- [ ] Review returned status code https://github.com/raulpe7eira/backend-exercise/issues/28
243+
- [ ] Improve observability in general (logging and metrics) https://github.com/raulpe7eira/backend-exercise/issues/29
244+
- [ ] Access security to resources https://github.com/raulpe7eira/backend-exercise/issues/30
245+
- [ ] Product catalog with cache https://github.com/raulpe7eira/backend-exercise/issues/31

0 commit comments

Comments
 (0)