vault backup: 2025-06-23 00:01:29
@@ -1,113 +0,0 @@
|
||||
# Domain
|
||||
|
||||
> subject area in which we build an application
|
||||
|
||||
> We have some core domains and some sub domains
|
||||
|
||||
|
||||
> Working out all domains is an iterative process
|
||||
|
||||
Bounded Context -> Each subdomain has its own bounded context so that they can each have their own "language"
|
||||
|
||||
Context Map -> outlines which domains communicate with each other and how
|
||||
|
||||
Anti-Corruption Level
|
||||
|
||||
Tactical Design
|
||||
|
||||
|
||||
Domain Objects -> 1. Entity Objects 2. Value Objects
|
||||
![[Pasted image 20250306182113.png]]
|
||||
![[Pasted image 20250306182209.png]]
|
||||
![[Pasted image 20250306182246.png]]
|
||||
![[Pasted image 20250306182324.png]]
|
||||
|
||||
|
||||
## **Solution Name: MyApp (or your project name)**
|
||||
|
||||
📂 **MyApp.sln** (Solution file)
|
||||
|
||||
### **1. Presentation Layer** (📂 `MyApp.WebAPI`)
|
||||
|
||||
- **Purpose:** Exposes the application via a web API.
|
||||
|
||||
📂 `MyApp.WebAPI`
|
||||
- 📂 **Controllers** – Defines API endpoints.
|
||||
- 📂 **Middlewares** – Implements custom middleware (logging, exception handling).
|
||||
|
||||
### Dependencies:
|
||||
> Projects: ApplicationProject, DomainProject
|
||||
> Packages: AutoMapper, Microsoft.EntityFrameworkCore.Design, Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools, Newtonsoft.Json
|
||||
---
|
||||
|
||||
### **2. Application Layer** (📂 `MyApp.Application`)
|
||||
|
||||
- **Purpose:** Contains the application logic, use cases, and service abstractions.
|
||||
|
||||
📂 `MyApp.Application`
|
||||
- 📂 **Interfaces** – Defines services like `IUserService`, `IOrderService`, etc.
|
||||
- 📂 **Services** – Defines services like `IUserService`, `IOrderService`, etc.
|
||||
- 📂 **DTOs** – Data Transfer Objects for input/output models.
|
||||
- 📂 **Mappers** – Maps domain models to DTOs (using AutoMapper or manual mapping).
|
||||
- 📂 **Validators** – Contains validation rules using FluentValidation.
|
||||
>- 📂 **Queries** – Handles read operations (CQRS pattern).
|
||||
>- 📂 **Commands** – Handles write operations (CQRS pattern).
|
||||
>- 📂 **Exceptions** – Defines application-layer exceptions.
|
||||
>- 📂 **UseCases** – Implements application logic (e.g., `CreateOrderHandler`).
|
||||
|
||||
### Dependencies:
|
||||
>Projects: DomainProjec
|
||||
>Packages: AutoMapper, Microsoft.Extensions.DependencyInjection
|
||||
---
|
||||
|
||||
### **3. Core Domain Layer** (📂 `MyApp.Domain`)
|
||||
|
||||
- **Purpose:** Represents the core business logic and entities without dependencies on infrastructure or frameworks.
|
||||
|
||||
📂 `MyApp.Domain`
|
||||
|
||||
- 📂 **Aggregates** – Groups related entities following DDD principles.
|
||||
- 📂 **Framework** - **Interfaces** – Contains domain-level abstractions like repository interfaces and entity interface.
|
||||
- 📂 **Framework** - **Interfaces** – **Repositories**
|
||||
- 📂 **Framework** - **Base**
|
||||
- 📂 **Enums** – Defines domain-specific enumerations.
|
||||
- 📂 **Factories**
|
||||
>- 📂 **ValueObjects** – Defines immutable objects that don’t have an identity.
|
||||
>- 📂 **Exceptions** – Custom exceptions related to domain logic.
|
||||
>- 📂 **Specifications** – Encapsulates domain rules and query logic.
|
||||
|
||||
### Dependencies:
|
||||
>Packages: Microsoft.Extensions.DependencyInjection
|
||||
---
|
||||
|
||||
### **4. Infrastructure Layer** (📂 `MyApp.Infrastructure`)
|
||||
|
||||
- **Purpose:** Implements external dependencies such as databases, logging, APIs, and caching.
|
||||
|
||||
📂 `MyApp.Infrastructure`
|
||||
|
||||
- 📂 **Framework** - **Base** – Implements `IRepository<TEntity>` for data access.
|
||||
- 📂 **Configurations** – Stores EF Core entity configurations.
|
||||
- 📂 **Services** - Repositories
|
||||
- 📂 **Migrations** - Auto Created
|
||||
- **DB-Context**
|
||||
>- 📂 **Persistence** – Implements repositories and EF Core DbContext.
|
||||
>- 📂 **Logging** – Implements logging strategies (e.g., Serilog, NLog).
|
||||
>- 📂 **Identity** – Manages authentication and authorization.
|
||||
>- 📂 **Caching** – Implements caching strategies (Redis, MemoryCache).
|
||||
>- 📂 **Email** – Handles email services (SMTP, SendGrid).
|
||||
>- 📂 **ExternalServices** – Integrations with third-party APIs.
|
||||
|
||||
|
||||
### Dependencies:
|
||||
>Projects: DomainProjec
|
||||
>Packages: Microsoft.EntityFrameworkCore.SqlServer
|
||||
---
|
||||
|
||||
### **Additional Projects (Optional)**
|
||||
|
||||
- 📂 `MyApp.Tests` – Unit and integration tests.
|
||||
- 📂 `MyApp.Shared` – Shared utilities (cross-cutting concerns like constants, helpers).
|
||||
|
||||
|
||||
Check the structure and git and stuff
|
||||
@@ -1,116 +0,0 @@
|
||||
# Name: alibaba.ir
|
||||
|
||||
## Stack
|
||||
> .NET 8 (LTS) - Domain Driven Design (DDD)
|
||||
> Database: MS SQL Server - Code First - EF Core
|
||||
> Front: React with TS
|
||||
|
||||
## Entities
|
||||
|
||||
### Person
|
||||
id
|
||||
firstname
|
||||
lastname
|
||||
...
|
||||
### Role
|
||||
Id
|
||||
Title (User, Admin, Emp)
|
||||
### Account
|
||||
PersonId
|
||||
RoleId
|
||||
password
|
||||
|
||||
### Company
|
||||
id
|
||||
title
|
||||
|
||||
### Transportation
|
||||
id
|
||||
srcId
|
||||
destId
|
||||
startTime
|
||||
endTime
|
||||
capacity
|
||||
remainingPlaces
|
||||
vehicleId
|
||||
price
|
||||
companyId
|
||||
|
||||
### City
|
||||
id
|
||||
title
|
||||
|
||||
### Location
|
||||
id
|
||||
location
|
||||
type
|
||||
cityId
|
||||
|
||||
### Vehicle
|
||||
id
|
||||
typeId
|
||||
|
||||
|
||||
### LocationType
|
||||
id
|
||||
typeId
|
||||
|
||||
### Ticket
|
||||
tranportationId
|
||||
seatId
|
||||
buyerId
|
||||
travellerId
|
||||
cancelled
|
||||
|
||||
### Seat
|
||||
vehicleId
|
||||
row
|
||||
column
|
||||
vipFlag
|
||||
|
||||
### Transaction
|
||||
buyerId
|
||||
amount?
|
||||
ticketId
|
||||
couponId
|
||||
serialNo
|
||||
|
||||
|
||||
Not Mapped
|
||||
### Search
|
||||
###
|
||||
###
|
||||
|
||||
## Phases
|
||||
|
||||
|
||||
|
||||
## Questions
|
||||
### Authentication and Authorization
|
||||
### Roles in database, how to handle multiple roles
|
||||
### DB Management of person sub classes
|
||||
### Should we complete the whole db
|
||||
### How to handle tickets
|
||||
|
||||
## Tasks
|
||||
|
||||
- [x] Review ERD
|
||||
- [x] Create a Project
|
||||
- [x] Name + Structure
|
||||
- [x] Talk about the privacy
|
||||
- [x] Should we all fork the structure?
|
||||
- [x] We should keep the site and keep it running
|
||||
- [x] Picking the react course
|
||||
- [x] A quick talk about the plans and timing.
|
||||
|
||||
|
||||
|
||||
[https://www.youtube.com/watch?v=SqcY0GlETPk](https://www.youtube.com/watch?v=SqcY0GlETPk)
|
||||
|
||||
[https://www.youtube.com/watch?v=g3is3wQK70Q](https://www.youtube.com/watch?v=g3is3wQK70Q)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 570 KiB After Width: | Height: | Size: 570 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 358 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 359 KiB After Width: | Height: | Size: 359 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 670 KiB After Width: | Height: | Size: 670 KiB |
|
Before Width: | Height: | Size: 817 KiB After Width: | Height: | Size: 817 KiB |
|
Before Width: | Height: | Size: 815 KiB After Width: | Height: | Size: 815 KiB |
|
Before Width: | Height: | Size: 854 KiB After Width: | Height: | Size: 854 KiB |
|
Before Width: | Height: | Size: 854 KiB After Width: | Height: | Size: 854 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 719 KiB After Width: | Height: | Size: 719 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 6.4 MiB After Width: | Height: | Size: 6.4 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 576 KiB After Width: | Height: | Size: 576 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 2.6 MiB |