#What do you think about this folder structure?

2 messages · Page 1 of 1 (latest)

pseudo vessel
#

Hi, I would like to know what do you think about this file structure:

  |-- apimodule
  |-- module1
  |-- module2
  |-- module3
    |-- components
      |-- component1
      |-- component2
      |-- component3
        |-- component3.component.ts
        |-- component3.component.html
        |-- component3.component.scss
    |-- pages
      |-- page1
      |-- page2
      |-- page3
        |-- page3.component.ts
        |-- page3.component.html
        |-- page3.component.scss
    |-- services
      |-- service1.service.ts
    |-- module3.constant.ts
    |-- module3.interface.ts
    |-- module3.component.ts
    |-- module3.component.html
    |-- module3.component.scss
    |-- module3-routing.module.ts
    |-- module3.module.ts
  |-- shared-general
    |-- components
    |-- directives
    |-- pipes
    |-- services
    |-- utils
  |-- shared-module1
  |-- shared-module2
  |-- shared-module3
    |-- components
    |-- services
  |-- app-routing.module.ts
  |-- app.component.html
  |-- app.component.ts
  |-- app.module.ts
  |-- core
    |-- guards
    |-- constants
    |-- interceptors
    |-- interfaces
    |-- models
    |-- services```
#
  • APIMODULE: Consist on a module generated by @openapitools/openapi-generator-cli. Every time there are changes on the backend, I need to run a command to update this module.
  • MODULE:
    • The folder COMPONENTS contains most of the time dumb/presentational components. Sometimes there are 1 or 2 smart components that internally use the other components in this folder.
    • The folder PAGES contains components that are always smart. They have services injected from the same module, a shared or core. These components use the components inside the components folder and they are called in the module.routing.ts file.
    • The folder SERVICES contains services (some store-like contains BehaviorSubjects and expose them as observables) related to that module. These serivces use another services, wether from core, a shard module, but most of the time from apimodule.
    • The file CONSTANT contains constants/enums related to that module.
    • The file INTERFACE contains interfaces related to that module (interfaces like inputs of the dumb components, observables in services, etc.).
  • SHARED-GENERAL: Its a shared-module I use almost in every other module.
    • The folder COMPONENTS contains generic components that are going to be used in the whole application.
    • Its the same with directives, pipes, services, utils in this folder.