Skip to content

Commit 8ce9814

Browse files
committed
Update README
1 parent ecd23ac commit 8ce9814

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# task-service
22

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:
44

55
```typescript
66
{
@@ -34,9 +34,9 @@ The following list represents the main stack and its dependencies:
3434

3535
## Architecture
3636

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.
3838

39-
There is a `Dockerfile` and `docker-compose.yml` file in the root of the repo that build the project in a container.
39+
![Postman collection](docs/project-structure.png)
4040

4141
## Scalability
4242

@@ -46,7 +46,9 @@ To emulate the scalability, you can run it on your machine:
4646
docker-compose -f docker-compose-test.yml up -d
4747
```
4848

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`.
5052

5153
But from this repository you will need to run:
5254

@@ -66,22 +68,33 @@ docker compose -f docker-compose-test.yml down
6668

6769
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`.
6870

71+
![Postman collection](docs/test-results.png)
72+
6973
## CI/CD
7074

7175
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.
7276

77+
You can see the workflow results at `Actions` tab here: https://github.com/felipeoriani/task-service/actions
78+
7379
## Improvements
7480

7581
- Implement integration tests to cover the infrastructure layer and api layer;
7682
- Custom error messages for schema validators, maybe considering globalization;
7783
- Implement hashing strategy for user password (security issue);
7884
- Standardize the http response messages using the Problem Details;
7985
- 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;
8293

8394
## Endpoints
8495

96+
![Postman collection](docs/postman-collection.png)
97+
8598
<table>
8699
<tr>
87100
<th>Method</th>

docs/postman-collection.png

25.9 KB
Loading

docs/project-structure.png

20.4 KB
Loading

docs/test-results.png

77.4 KB
Loading

0 commit comments

Comments
 (0)