Introduction
ReSolve is a CQRS, DDD, Event Sourcing framework for Node.js. ReSolve implements an elaborate server-side infrastructure with out-of-the box support for various types of data storages, event export and import, encryption, testing and debugging tools, and more.
On the frontend, you can use the reSolve HTTP API or one of the included client libraries based on your requirements and a client-side technology of choice.
Core Conceptsā
Domain Driven Designā
A domain aggregate is a business model unit. Business logic is defined primarily in aggregate command handlers.
Event Sourcingā
Don't store system state, store events that brought system to this state.
CQRSā
The system is divided in two "sides":
- Write Side accepts commands and generates events that are stored in the Event Store.
- Read Side applies events to Read Models, and process queries.
Write side is optimized for writing, read side - for reading.
Setting Upā
Prerequisitesā
You need to have Node >=14.17 on you development machine and on the server. You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.
Make sure you have Node, NPM, and NPX installed:
$ node --version
v14.17.5
$ npx --version
6.14.14
Getting Startedā
Use the following console input to create and run a minimal reSolve application:
npx create-resolve-app my-awesome-app
cd my-awesome-app
npm run dev
Your app is running at http://localhost:3000
The create-resolve-app tool creates an application based on the latest versions of reSolve packages. If you want to update an existing application to a newer version of reSolve, ensure that all
resolve-*
dependencies in the application's package.json file have the same version number to avoid version conflicts.
Examples and Template Projectsā
The reSolve repository contains example and template projects. You can use them to study various use-case scenarios or to create new reSolve applications. The example projects are available in the repository's examples folder. The template projects are available in the repository's templates folder.
You can install any of these projects on your machine using the create-resolve-app
tool with the -e
flag followed by an example or template name.
npm
npm install -g create-resolve-app
create-resolve-app resolve-example -e <example name>
npx
npx create-resolve-app resolve-example -e <example name>
yarn
yarn create resolve-app resolve-example -e <example name>