MCPcopy Index your code
hub / github.com/Adaptech/les

github.com/Adaptech/les @release-0.10.5-test

Chat with this repo
repository ↗ · DeepWiki ↗ · release release-0.10.5-test ↗ · + Follow
253 symbols 642 edges 73 files 58 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LES

Join the chat at https://gitter.im/Adaptech/les

"Let's Event Source"

Event sourcing and CQRS/ES based "microservices" are increasingly seen as a nice way to build cohesive, loosely coupled systems with good transactional integrity. There is a knack to building software that way, so although the resulting systems tend to be much simpler and easier to understand than traditional (e.g.) object oriented implementations, there is a bit of a learning curve.

LES attempts to address this in three ways:

  1. Fast microservice prototyping: Go directly from an event storming to a working event sourced API.

  2. "Architect in a box": les validate assesses whether a prototype will result in a "good" event sourced microservice - cohesive, loosely-coupled, transactionally consistent. Then les-node -b builds a deployment-ready NodeJS API with plenty of guide fences and best practices in place as developers go forward customizing it. If you have your own coding standards or don't like NodeJS, implement your own in a language of your choice.

  3. "Citizen IT Developer". One of the goals of the LES project is to enable "business coders", "power users" and entrepreneurs with little technical knowledge to build highly scalable event sourced microservices from scratch, basically "I've made this API for my startup - could you build me an app for that?"

LES is currently in alpha. We have started using 1. and 2. in Real Life projects. But no.3 (Citizen IT Developer) especially is still quite experimental, with a good number of features missing.

See also: LES FAQ

LESTER Pipeline

Getting Started

Prerequisites

Installation

Latest version from source:

git clone https://github.com/Adaptech/les.git
make install

... or ...

Instructions for Linux, Windows Mac & Docker

Hello World

Step 1:

Create an Event Markdown file. Event Markdown (EMD) is a simple language used to describe an event storming:

# TODO List
Add Item -> // description, dueDate
Todo Added // description, dueDate
TODO List* // todoId, description, dueDate

Save it to Eventstorming.emd.

Step 2:

les convert && les-node -b && cd api && npm install && docker-compose up -d --force-recreate

Or using Docker:

docker run -v $(pwd):/les les convert && docker run -v $(pwd):/les les-node -b && cd api && npm install && docker-compose up -d

(If you doing this in Linux and encounter "permission denied" errors, your USER or GROUP ID need to be specified. Say your USER ID is 1003, then add --user 1003 after each docker run in the above command.)

Step 3:

There is no step 3.

  • Add some items to the TODO list: http://localhost:3001/api-docs (Swagger/OpenAPI)
  • View the items: http://localhost:3001/api/v1/r/TODOList
  • Look at the "TodoAdded" events in the Eventstore DB: http://localhost:2113 (username 'admin', password 'changeit')
  • Check out the source code for the "TODO List" system: ./api

What next ...

  • A collection of Event Markdown (EMD) examples: https://github.com/Adaptech/les/src/master/samples**

  • Learn Event Storming: http://eventstorming.com

  • Learn Event Markdown: https://webeventstorming.com

  • EMD Cheat Sheet: https://github.com/Adaptech/letseventsource/raw/master/EMD-Cheatsheet-0.10.0-alpha-alpha.pdf

  • https://gitter.im/Adaptech/les

IDE Integrations & Tools

Known UX Impacting Issues

The issues below have been known to mystify EMD users:

"DromedaryCase": myaggregateId GOOD, myAggregateId BAD

https://github.com/Adaptech/les/issues/9

Sporadic Race condition when doing cd api && npm install && docker-compose up -d

API doesn't start because Eventstore isn't up yet. (Workaround: docker-compose restart api)

https://github.com/Adaptech/les/issues/11

Need to have at least one read model parameter which is not an aggregate ID

https://github.com/Adaptech/les/issues/10

Running The Tests

make test-all

Extension points exported contracts — how you extend this code

Item (Interface)
Item is a line item in an Event Markdown file.
pkg/emd/emd_specification.go

Core symbols most depended-on inside this repo

Validate
called by 42
pkg/eml/validate.go
LoadYAML
called by 37
pkg/eml/load.go
ensureDirectoryExists
called by 7
pkg/eml/generate/common.go
fileExists
called by 5
cmd/les/fileio.go
printError
called by 4
cmd/les/main.go
fileExists
called by 4
cmd/les-viz/fileio.go
RuleExists
called by 3
pkg/eml/commandParameterRules.go
isFileValidEmdOrEml
called by 3
cmd/les/runContinuousValidation.go

Shape

Function 207
Struct 32
Method 13
Interface 1

Languages

Go100%

Modules by API surface

pkg/convert/emdToEml_commands_test.go14 symbols
pkg/convert/emdToEml.go13 symbols
pkg/eml/validateCommands_test.go11 symbols
pkg/eml/generate/common.go9 symbols
pkg/eml/eml_specification.go9 symbols
pkg/emd/emd_specification.go9 symbols
cmd/compliance-test/emd/main.go9 symbols
pkg/eml/validateEvents_test.go8 symbols
pkg/eml/validateReadmodels_test.go7 symbols
pkg/emd/parseEvent_test.go7 symbols
pkg/convert/emdToEml_readmodels_test.go7 symbols
cmd/compliance-test/eml/main.go7 symbols

For agents

$ claude mcp add les \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact