2.9 KiB
2.9 KiB
기술 스택
| 기술 | 스택 |
|---|---|
| Framework | .NET 9.0 / ASP.NET Core |
| Database | MariaDB |
| ORM | Entity Framework Core |
| API Documentation | Swagger |
| Logging | Serilog |
프로젝트 구조
프로젝트는 다음과 같은 구조로 구성되어 있다.
Clean Architecture
- 프로젝트는 클린 아키텍처(Clean Architecture)를 기반으로 설계한다.
- 의존성 방향은 항상
외부에서내부로 향한다.- 외부 : DB, UI, API 등
- 내부 : 비즈니스 로직, 도메인, 애플리케이션 서비스 등
폴더 구조
SPMS.Server/
├── 1.Domain/ # 순수 비즈니스 영역 : 외부 의존성 절대 금지!
│ ├── Entities/ # DB 테이블과 매핑될 핵심 객체 (Service, Device, Log...)
│ ├── Enums/ # OsType, SendStatus, TargetType 등
│ ├── Constants/ # 시스템 전역 상수 (에러 메시지 등)
│ └── Exceptions/ # 비즈니스 로직 전용 예외 (BusinessException)
│
├── 2.Application/ # [중재자] 흐름 제어 및 인터페이스 정의
│ ├── Common/ # 공통 응답 포맷 (ResultWrapper, PagedResult)
│ ├── DTOs/ # Request/Response 모델 (서비스 간 데이터 전달용)
│ ├── Interfaces/ # 구현체가 없는 설계도 모음
│ │ ├── Services/ # IServiceService, IPushService
│ │ ├── Repositories/ # IServiceRepository (DB 접근용 인터페이스)
│ │ └── Infra/ # ICryptoHelper, IFcmClient (외부 기술 인터페이스)
│ └── Services/ # 비즈니스 로직 구현체 (ServiceService, PushService)
│ # 주의: 여기서는 DB나 암호화 라이브러리를 직접 쓰지 않고 '인터페이스'만 주입받아 씀
│
├── 3.Infrastructure/ # 실제 기술 구현 (DB, 암호화, FCM)
│ ├── Persistence/ # DB 관련
│ │ ├── Context/ # AppDbContext (EF Core 설정)
│ │ └── Repositories/ # ServiceRepository (실제 쿼리 수행)
│ ├── Security/ # 암호화/인증 구현 (AesHelper, RsaHelper, JwtGenerator)
│ └── External/ # 외부 시스템 연동 (FcmClient, ApnsClient)
│
├── 4.Presentation/ # 외부와 연결
│ ├── Controllers/ # API 엔드포인트
│ ├── Middlewares/ # GlobalExceptionHandling, Logging
│ └── Filters/ # 권한 체크 등 (AuthFilter)
│
├── appsettings.json
├── appsettings.Development.json
└── Program.cs
```아