-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Yorkie Auth Webhook | ||
|
||
This document covers ㅅhe architecture of CodePair's NestJS backend. | ||
|
||
## Architecture | ||
|
||
Below is the diagram of the CodePair Backend Architecture. Currently, it adheres to the default architecture that can be generated through [NestJS CLI](https://docs.nestjs.com/cli/overview). | ||
If you want to add a new component, you can use the command `nest generate controller [CONTROLLER_NAME]`. | ||
|
||
``` | ||
CodePair Backend | ||
┌───────┐ ┌──────────────────────────────────────────────────────────────────────┐ | ||
│Request├─────►│ │ | ||
└───────┘ │ ┌────┐ ┌─────┐ ┌──────────┐ ┌───────┐ ┌──────────┐ │ | ||
│ │Pipe│────►│Guard│────►│Controller│────►│Service│────►│Repository│ │ | ||
┌────────┐ │ └────┘ └─────┘ └──────────┘ └───────┘ └──────────┘ │ | ||
│Response│◄─────┤ │ | ||
└────────┘ └──────────────────────────────────────────────────────────────────────┘ | ||
``` | ||
|
||
- Pipe: Handles data transformation/validation in the request/response pipeline. | ||
- Guard: Implements access control and validation logic for routes. | ||
- Controller: Defines the endpoints/routes and their corresponding request handling logic. | ||
- Service: Contains the business logic and performs operations required by the application. | ||
- Repository: Handles data persistence and retrieval operations from the data source. | ||
|
||
Note that the naming for the Repository Layer is `PrismaService`. | ||
|
||
## Note | ||
|
||
For now, we are using the architecture recommended by NestJS as a reference. | ||
However, in the future, we can evolve towards implementing Clean Architecture by introducing interfaces between each layer. |