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
+19-6Lines changed: 19 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# task-service
2
2
3
-
Task Service is a sample application used to handle tasks by User. The base structure of a `Task` is:
3
+
Task Service is a sample application used to handle Tasks by User. The base structure of a `Task` is:
4
4
5
5
```typescript
6
6
{
@@ -34,9 +34,9 @@ The following list represents the main stack and its dependencies:
34
34
35
35
## Architecture
36
36
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, and the concrete types are injected as optional parameters (no DI container here), easy to mock on the tests.
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
-
There is a `Dockerfile` and `docker-compose.yml` file in the root of the repo that build the project in a container.
39
+

40
40
41
41
## Scalability
42
42
@@ -46,7 +46,9 @@ To emulate the scalability, you can run it on your machine:
46
46
docker-compose -f docker-compose-test.yml up -d
47
47
```
48
48
49
-
It will up database, two instances of the container and a `nginx` as a load balancer which will distribute the requests across the containers emulating a situation where we have more than a single instance running for the application. The image for the app container is ready and published on docker hub. You can check it here: https://hub.docker.com/r/felipeoriani/tasks-api-nodejs-typescript
49
+
It will up database, two instances of the container app and a `nginx` as a load balancer which will distribute the requests across the containers emulating a situation where we have more than a single instance running for the application. The image for the container app is ready and published on docker hub, you can check it here: https://hub.docker.com/r/felipeoriani/tasks-api-nodejs-typescript
50
+
51
+
You also can see how the image was build at `Dockerfile`.
50
52
51
53
But from this repository you will need to run:
52
54
@@ -66,22 +68,33 @@ docker compose -f docker-compose-test.yml down
66
68
67
69
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`.
68
70
71
+

72
+
69
73
## CI/CD
70
74
71
75
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.
72
76
77
+
You can see the workflow results at `Actions` tab here: https://github.com/felipeoriani/task-service/actions
78
+
73
79
## Improvements
74
80
75
81
- Implement integration tests to cover the infrastructure layer and api layer;
76
82
- Custom error messages for schema validators, maybe considering globalization;
77
83
- Implement hashing strategy for user password (security issue);
78
84
- Standardize the http response messages using the Problem Details;
79
85
- GraphQL configurations, it was my first time dealing with it, I would investigate how to implement the `Mutation` and maybe consider it just a GraphQL API instead of a Mix of REST and GraphQL.
80
-
- Improve the test coverage, currently using the `c8` package since node test runner is not stable (hope in node 22 it will);
81
-
- Improve the route configuration on the API level within the express framework;
86
+
- Improve the test coverage, currently using the `c8` package since node test runner is not able yet (hope in node 22 it will);
87
+
- Improve the route configuration on the API level with the express framework;
88
+
- Move environment variables to AWS Secrets Manager and adapt the application to read from there;
89
+
- Deploy at AWS ECS (Fargate - serverless) and configure the Task Definitions properly to run the container;
90
+
- Use AWS RDS (Aurora) to run the PostgreSQL database;
91
+
- Use AWS Elasticache (Redis) to implement some caching strategy;
92
+
- Use IaC tool (Terraform or AWS Cloud Formation) to provision the infrastructure and automate it for dev/staging/prod;
0 commit comments