Docman is the sample project written in .NET Core 3.1 to demonstrate how main functional programming and DDD techniques can be combined in the C# code. The domain tackles a simplified document management which revolves around the changing document statuses.
The referencing application uses monolith architecture model. Underneath it relies heavily on the following patterns: CQRS and Event sourcing. Write (command) side uses EventStore DB to store events. Read (query) side uses PostgreSQL DB to return data to the client. Docman uses Google Firebase for the users authentication.
Commands are the earliest source of data. Commands are sent to the application by users and are handled by the command side, which does the following:
- When a command is received, the current state of the affected entity is computed from its history.
- The command is turned into an event and applied to the entity’s state, obtaining its new state.
- The event is persisted and published to interested parties for further processing.
From the root directory execute:
docker-compose up -d
This command will start required infrastructure. Then you can start Docman application using dotnet run
command from the src/Docman.API
folder.
You can find the list of all HTTP requests in Docman.rest file placed in the root folder of the repository. This file is compatible with REST Client plugin for Visual Studio Code.
Document requests should be sent in the following order:
- Create document
- Update document or add file
- Send for approval
- Approve document or reject document