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
Copy file name to clipboardExpand all lines: README.md
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# task-service
1
+
# Task Service
2
2
3
3
Task Service is a sample application used to handle Tasks by User. The base structure of a `Task` is:
4
4
@@ -15,9 +15,9 @@ Task Service is a sample application used to handle Tasks by User. The base stru
15
15
16
16
The REST API / GraphQL API is protected by user authentication using a `bearer` token (JWT). Before consuming it, you must first authenticate using the `POST /api/v1/auth` endpoint passing the user credentials and a token will be generated. Use it on the `authorization` http request header attribute. Use POSTMAN collection available on the docs folder.
17
17
18
-
**Important**: There is 2 types of user. A `super` user that can handle all the tasks and a `non-super` user which can only handle its own tasks. You may get some `401` or `403` errors if you try to acccess wrong IDs.
18
+
⚠️ **Important**: There is 2 types of user. A `super` user that can handle all the tasks and a `non-super` user which can only handle its own tasks. You may get some `401` or `403` errors if you try to acccess wrong IDs.
19
19
20
-
## Stack
20
+
## 💻 Stack
21
21
22
22
The following list represents the main stack and its dependencies:
23
23
@@ -32,13 +32,13 @@ The following list represents the main stack and its dependencies:
32
32
- jsonwebtoken
33
33
- pino (logging)
34
34
35
-
## Architecture
35
+
## 🥇 Architecture
36
36
37
37
The design was made on the top of `Clean Architecture`, where there are well-separated layers for `Domain` which holds all the abstractions for the domain of the application (Tasks and Users), `Infrastructure` (I/O bound operations) and `UseCases` (business rules). The components of each layer depends on the abstractions of the domain which allows us to inject any derived instance for the abstractions and mock at unit testing level.
38
38
39
39

40
40
41
-
## Scalability
41
+
## ☁️ Scalability
42
42
43
43
To emulate the scalability, you can run it on your machine:
44
44
@@ -58,25 +58,27 @@ yarn prisma:reset
58
58
59
59
To migrate and seed the database. Then you can load the postman collection available on the `docs` folder and use it.
60
60
61
-
Once you are done, just destroy the environment:
61
+
Once it is up, the endpoint to consume the api via load balancer is: `http://localhost:4000`.
62
+
63
+
Finally when you are done, just destroy the environment:
62
64
63
65
```
64
66
docker compose -f docker-compose-test.yml down
65
67
```
66
68
67
-
## Tests
69
+
## ✔️ Tests
68
70
69
71
It uses the native Node Test Runner as tooling for testing. The tests covers the use cases layer mocks are created using objects and injected on the useCases, specially the `TaskUseCases`.
70
72
71
73

72
74
73
-
## CI/CD
75
+
## 📊 CI/CD
74
76
75
77
There is a initial workflow on the `./github/workflows` folder that run a few steps to check the project source code including lint, typescript, build (transpilation process of typescript) and tests.
76
78
77
79
You can see the workflow results at `Actions` tab here: https://github.com/felipeoriani/task-service/actions
78
80
79
-
## Improvements
81
+
## 📓 Improvements
80
82
81
83
- Implement integration tests to cover the infrastructure layer and api layer;
82
84
- Custom error messages for schema validators, maybe considering globalization;
0 commit comments