From 2972df1d7cd6750bf185fe7151dc6a5d72bcf6c7 Mon Sep 17 00:00:00 2001 From: harish Date: Wed, 31 Jan 2024 10:37:55 +0530 Subject: [PATCH 1/3] docs: update folder structure readme --- FOLDER_STRUCTURE.md | 79 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 15 deletions(-) diff --git a/FOLDER_STRUCTURE.md b/FOLDER_STRUCTURE.md index 16e3d40..24b2bf8 100644 --- a/FOLDER_STRUCTURE.md +++ b/FOLDER_STRUCTURE.md @@ -5,23 +5,72 @@ This document outlines the recommended folder structure for the project, focusin ## Folder Structure -### `DotnetFoundation.DAL` -The `DotnetFoundation.DAL` folder contains files relating to database calls(repositories and interfaces) and objects(DBOs and DTOs) +### `DotnetFoundation.API` +The `DotnetFoundation.API` folder contains all files and folders related to presenting data for client interaction in the form of JSON objects through HTTP requests. This facilitates the consumption of data by front-end applications. Front-end applications can consume these APIs to display and interact with the data in a user-friendly manner through the UI. -1. `DatabaseContext`: This directory consists of contains code that defines and configures the data model, including entity classes that represent database tables, relationships between these entities, and configuration settings related to database connectivity, schema, etc. -2. `Models`: This contains all database objects and data transfer objects that store attributes of a tables which can be used for input or output. -3. `Repositories`: This folder stores all interfaces and repository code files that deal with implementation/interactions of different tables. +**Components** + + `Controller`: This folder consists of controller files that act as an intermediary between the user interface and the application logic. + + `Properties`: This folder usually consists of launchsettings.json which determines the type of launch profiles to be used to launch the application during development. + + `program.cs`: This file contains the entry point for the application and is responsible for configuring and building the web host. + + `appsettings.json`: This file contains application-specific settings, configurations, and connection strings. + +**Function** +- Responsible for handling HTTP requests. +- Follows RESTful API design principles. +- Contains controllers for user management, authentication, and authorization. + +### `DotnetFoundation.Application` +The `DotnetFoundation.Application` folder contains the business logic. All the business logic will be written in this layer. It is in this layer that services interfaces are kept, separate from their implementation, for loose coupling and separation of concerns. + +**Components** + +`DTO`: Data Transfer Object. Define the DTO for clean data transfer between different layers of the application + +`Interfaces`: Contain the interfaces for the services and the repositories providing a contract for interactions between different layers of the application + +`Services`: Contain the implementations of the various application services centralizing and managing the business logic and application-specific rules + +**Function** +- Manages business logic and application-specific rules. +- Consists of Data Transfer Objects (DTOs), interfaces, and services. +- Interfaces define contracts for interacting with the domain and infrastructure layers. +- Services implement application logic, ensuring separation from infrastructure concerns. + +### `DotnetFoundation.Domain` +The `DotnetFoundation.Domain` folder contains the enterprise logic, like the entities and their specifications + +**Components** + +`Entities`: Defines the Core business entities, representing the fundamental building blocks of the business model + +**Function** + +- Defines core entities representing the business model. +- Encapsulates business rules, validation, and domain-specific logic. +- Remains independent of infrastructure details. + +### `DotnetFoundation.Infrastructure` +The `DotnetFoundation.Infrastructure` folder contains all the database migrations and database context Objects. Here, we have the repositories of all the domain model objects + +**Components** + +`Identity`: This directory defines entities related to identity models within the ASP.NET Identity framework + +`Migrations`: Contain database migration scripts + +`Persistence`: Contain database context object and repositories + +**Function** + +- Implements data storage, external integrations, and identity. +- Includes Identity Models extending the ASP.NET Identity framework. +- UserRepository serves as the bridge between the application and the data storage mechanism. +- Configures dependency injection for infrastructure services. -### `DotnetFoundation.API` -The `DotnetFoundation.API` folder contains all files and folders related to business logic layer which is more in concern with client interaction. - -1. `BLL`: This folder contains BLL files which deal with http responses to an api request. -2. `Controller`: This folder consists of controller files that act as an intermediary between the user interface and the application logic. -3. `Helpers`: This folder consists of files that are used to encapsulate reusable methods or functionalities that can be used across an application. -4. `Models`: This folder consists of file that deals with error response when an exception has occured. -5. `Properties`: This folder usually consists of launchsettings.json which determines the type of launch profiles to be used to launch the application during development. -6. `appsettings.json`: This file contains application-specific settings, configurations, and connection strings. -7. `program.cs`: This file contains the entry point for the application and is responsible for configuring and building the web host. ## Best Practices From c392f78f6a438df35c18bd373266d51066fe7f42 Mon Sep 17 00:00:00 2001 From: harish Date: Thu, 1 Feb 2024 11:03:18 +0530 Subject: [PATCH 2/3] docs: fix Case of program.cs --- FOLDER_STRUCTURE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FOLDER_STRUCTURE.md b/FOLDER_STRUCTURE.md index 24b2bf8..f0117e8 100644 --- a/FOLDER_STRUCTURE.md +++ b/FOLDER_STRUCTURE.md @@ -14,7 +14,7 @@ The `DotnetFoundation.API` folder contains all files and folders related to pres `Properties`: This folder usually consists of launchsettings.json which determines the type of launch profiles to be used to launch the application during development. - `program.cs`: This file contains the entry point for the application and is responsible for configuring and building the web host. + `Program.cs`: This file contains the entry point for the application and is responsible for configuring and building the web host. `appsettings.json`: This file contains application-specific settings, configurations, and connection strings. From a5862f897ccce45f729c58ee1c3cb188793adb3f Mon Sep 17 00:00:00 2001 From: harish Date: Wed, 7 Feb 2024 12:04:20 +0530 Subject: [PATCH 3/3] docs: update heading markdown --- FOLDER_STRUCTURE.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/FOLDER_STRUCTURE.md b/FOLDER_STRUCTURE.md index f0117e8..11dab7b 100644 --- a/FOLDER_STRUCTURE.md +++ b/FOLDER_STRUCTURE.md @@ -8,7 +8,7 @@ This document outlines the recommended folder structure for the project, focusin ### `DotnetFoundation.API` The `DotnetFoundation.API` folder contains all files and folders related to presenting data for client interaction in the form of JSON objects through HTTP requests. This facilitates the consumption of data by front-end applications. Front-end applications can consume these APIs to display and interact with the data in a user-friendly manner through the UI. -**Components** +#### Components `Controller`: This folder consists of controller files that act as an intermediary between the user interface and the application logic. @@ -18,7 +18,8 @@ The `DotnetFoundation.API` folder contains all files and folders related to pres `appsettings.json`: This file contains application-specific settings, configurations, and connection strings. -**Function** +#### Function + - Responsible for handling HTTP requests. - Follows RESTful API design principles. - Contains controllers for user management, authentication, and authorization. @@ -26,7 +27,7 @@ The `DotnetFoundation.API` folder contains all files and folders related to pres ### `DotnetFoundation.Application` The `DotnetFoundation.Application` folder contains the business logic. All the business logic will be written in this layer. It is in this layer that services interfaces are kept, separate from their implementation, for loose coupling and separation of concerns. -**Components** +#### Components `DTO`: Data Transfer Object. Define the DTO for clean data transfer between different layers of the application @@ -34,7 +35,8 @@ The `DotnetFoundation.Application` folder contains the business logic. All the b `Services`: Contain the implementations of the various application services centralizing and managing the business logic and application-specific rules -**Function** +#### Function + - Manages business logic and application-specific rules. - Consists of Data Transfer Objects (DTOs), interfaces, and services. - Interfaces define contracts for interacting with the domain and infrastructure layers. @@ -43,11 +45,11 @@ The `DotnetFoundation.Application` folder contains the business logic. All the b ### `DotnetFoundation.Domain` The `DotnetFoundation.Domain` folder contains the enterprise logic, like the entities and their specifications -**Components** +#### Components `Entities`: Defines the Core business entities, representing the fundamental building blocks of the business model -**Function** +#### Function - Defines core entities representing the business model. - Encapsulates business rules, validation, and domain-specific logic. @@ -56,7 +58,7 @@ The `DotnetFoundation.Domain` folder contains the enterprise logic, like the ent ### `DotnetFoundation.Infrastructure` The `DotnetFoundation.Infrastructure` folder contains all the database migrations and database context Objects. Here, we have the repositories of all the domain model objects -**Components** +#### Components `Identity`: This directory defines entities related to identity models within the ASP.NET Identity framework @@ -64,7 +66,7 @@ The `DotnetFoundation.Infrastructure` folder contains all the database migration `Persistence`: Contain database context object and repositories -**Function** +#### Function - Implements data storage, external integrations, and identity. - Includes Identity Models extending the ASP.NET Identity framework.