How silentcoder52626/commonportfolio-server works
Main Components
• API Layer (CommonPortfolio.Api):
– Contains HTTP endpoints organized by feature (Account, Education, Experience, Skill, etc.).
– Contains configurations (e.g., Dockerfile, launchSettings, and .NET tooling setups), seeding, and extension methods.
• Domain Layer (CommonPortfolio.Domain):
– Contains the core business models (entities, enums, exceptions, constants).
– Holds service interfaces and domain-level helper utilities.
– This is where business rules and validations live.
• Infrastructure Layer(s):
– CommonPortfolio.Infrastructure.Sql and CommonPortfolio.Infrastructure:
▪ They handle database interactions using Entity Framework with migrations, mappings, and database context configurations.
▪ Include configurations for dependency injection, external services (Cloudinary for image upload), and email services.
Relationships and Interactions
• The API Layer (controllers/endpoints) acts as the entry point of the system. Requests hit REST endpoints which are then routed to the corresponding service in the Domain Layer.
• The Domain Layer contains business logic and orchestrates operations using its service implementations.
• The Infrastructure Layer implements the interfaces defined in the Domain. It handles data persistence, external API integrations (such as email or cloud storage), and data migrations.
• Optional components include DB seeding (under the API project) to initialize data and helper extensions.
Architectural Patterns and Technologies
• Layered (or Clean) Architecture: Separation into API (presentation), Domain (business logic), and Infrastructure (data access, integrations).
• Dependency Injection: Likely used to inject Domain service implementations from the Infrastructure into the API controllers.
• RESTful API Design: Notice endpoints split by feature with HTTP verbs/actions.
• ORM/Entity Framework: Evident from the mapping files and migrations in the Infrastructure SQL project.
• External Services Integration: For instance, Cloudinary for image handling and possibly an email sender service.
• .NET Core project structure with .csproj files for dependency and build management.
• Within the API section, illustrate individual controllers or endpoint groups (Account, Education, Experience, etc.) that all point to the Domain layer.
• In the Domain section, include blocks for Core Business Logic, Models/Entities, Service Interfaces, and Domain-level Utilities.
• In the Infrastructure section, break out the SQL/EF part (mappings, migrations, DB context) and a separate block for other external integrations (Cloudinary, Email Services).
• Optionally, add a side note for cross-cutting concerns such as configuration (Docker files, appsettings.json) and testing components.
Be sure to include clear labels, directional data flows, and a distinction between the different layers and components to make it easily readable by both team members and stakeholders.