BlackBoxVision / typescript-hapi-starter

🚀 Starter for building APIs with Hapi + Typescript!
MIT License
128 stars 28 forks source link

Explanation: Project Architecture #31

Open renilbabu03 opened 4 years ago

renilbabu03 commented 4 years ago

It would be really nice if you could explain the project architecture. Like explaining the following:

  1. Resolve file
  2. Repository file
  3. Controller file (not necessary)

I don't understand the use of a resolve file. Looks like you are using a Architectural Pattern. Please explain to us which pattern and a general flow as it is quite hard for newbies to understand the flow and the reason behind the structure

laurilarjo commented 4 years ago

Yes we could add some description of that architecture. The resolver decouples the repository from the controller, but you're right that it makes it harder to understand the project.

You can also use this as a base by ignoring the common base-controller, base-repository and base-resolver and just writing your own methods to the user-controller. That's how I started to use this project, as I didn't have any database, but instead I was proxying and transforming data from another backend.

Could you tell us your use case why you're looking at this starter kit, and what your needs are? That would also give insight on how to improve this.