Files
old-svijetlastrana/docs/wiki/03 - Folders.md
2018-04-25 13:16:36 +02:00

1.8 KiB

Folders

Reason

The goals for a common project's folder structure is to mantain the organization and to promote a common language between the programmers, decreasing the new members' learning curve.

Definitions

Structure

  • domain:

    • service: contains the business logic and persistence, i.e. validating values based on business rules

    • contract: contains the interfaces for the whole app; useful for mocking dependencies on the tests and also decoupling the packages from each other, making the code independent from external technologies, e.g. databases

    • entity: represents the values our domain understands

  • infra: contains utilities that will be used across the whole app

  • data: contains the connection with the database or any other way to do the persistence

    • data*: an "implementation"
  • application: represents our application as a whole

    • applicationservice: contains the application logic, i.e. parses and validates the data received, calls many domain's services, parses the output data and sends it

    • entitymapping: contains the functions that parses the application's view model to the domain's entities, and vice-versa

    • viewmodel: the data that will be sent and received from the app; it differs from the entity because it does not represent the values of our app, but rather the values the front-end server will understand

  • server: contains the definitions for the web server

    • router: defines the routes and its handlers; contains no logic, only calls the application package

    • serverconfig: defines the middlewares and the server's configurations

  • static: not required; mostly used for static files, such as large texts, email templates, static values, etc, or temporary files (commonly in static/temp)