https://github.com/planetarium/emptychronicle
https://github.com/planetarium/emptychronicle
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/planetarium/emptychronicle
- Owner: planetarium
- Created: 2023-07-19T01:39:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T17:08:49.000Z (12 months ago)
- Last Synced: 2024-05-20T16:07:04.340Z (12 months ago)
- Language: C#
- Size: 20.8 MB
- Stars: 2
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EmptyChronicle
EmptyChronicle (or 0c) is simple node for NineChronicles providing HTTP APIs about block, state, etc.
## Architecture
I recommend reading this section and follow this guide if you want to contribute to this project.
```
EmptyChronicle
├── Domain
│ ├── Model
│ │ ├── Entity
│ │ └── Repository (** Interface)
│ └── Service (** Domain Service)
├── Application
│ ├── Application (** Application Service)
│ └── ApplicationInjectionExtensions.cs
│ You should add applications as dependancy into AIE.cs
├── Controller
│ └── Controller
├── Infrastructure
│ └── Repository (** Implementations)
└── Program.cs
```I recommend to follow these steps to add new API
1. Create or modify domain objects with only domain logic.
- Entity: Basically, entity should have all domain logic.
- Repository: Interface (definition of method) to persistence entity.
- Domain Service: Simply, it's collection of static method of entity but we seperated it into another class to inject repository.
2. With domain objects, write usecase in application (service).
- Application can inject repository so inquire entity that you want with repository, and invoke some domain logic, finally persist domain with repository if you need.
- It's an usecase so you can test it with repository implemented with mock
3. Implement repository interface.
4. Write controller to invoke application. (Mostly HTTP)