Skip to content

Commit c2e4e92

Browse files
authored
feat: initial release v0.1.0 with core engine system and examples
1 parent 08645f3 commit c2e4e92

32 files changed

+4064
-378
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ _build/
3030
.eunit/
3131

3232
.engine/
33-
**_compiled.ex
33+
**_compiled.ex
34+
assets/docs.css

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Changelog
2+
3+
All notable changes to the EngineSystem project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## v0.1.0
9+
10+
### Goals of this release
11+
12+
- **Engine Definition DSL**: User-friendly macro system for defining engines
13+
- **Mailbox-as-Actors**: First-class mailbox engines for message handling
14+
- **Type-Safe Messaging**: Interface validation and message contracts
15+
- **Effect System**: Composable effects for state and communication
16+
- **System Management**: Comprehensive lifecycle and monitoring APIs
17+
18+
### What's new?
19+
20+
- Initial implementation of the Engine Model, one single-node system with a single registry
21+
- DSL for engine definition (`defengine` macro)
22+
- Processing engines with GenStage consumers
23+
- Mailbox engines with GenStage producers
24+
- System registry for engine specifications and instances
25+
- Message passing and validation system
26+
- Configuration and environment management
27+
- Effects system for state management and communication
28+
- Comprehensive example engines (Echo, Calculator, Counter, KV Store)
29+
- System lifecycle management
30+
- Supervision tree with fault tolerance
31+
32+
### Documentation
33+
34+
- Comprehensive ExDoc documentation configuration
35+
- Interactive Livebook tutorial integration (README.livemd)
36+
- First-person documentation convention across all modules
37+
- System management functions documentation with practical examples
38+
- Enhanced API documentation with error handling examples
39+
- Documentation guide for contributors
40+
- Module grouping and navigation structure for better organization
41+
42+
### Examples Included
43+
44+
- Simple Echo Engine
45+
- Stateless Calculator Engine
46+
- Stateful Counter Engine
47+
- Advanced Key-Value Store Engine
48+
- Ping/Pong Communication Examples
49+
- Interactive Demo Systems
50+
51+
### Architecture
52+
53+
- Clean separation between processing and mailbox engines
54+
- GenStage-based backpressure and demand management
55+
- Registry-based instance and specification tracking
56+
- Dynamic supervision for engine lifecycle management
57+
- Formal model adherence with operational semantics
58+
59+
### Development Tools
60+
61+
- Credo for code quality
62+
- Dialyzer for type checking
63+
- Comprehensive test suite
64+
- ExDoc documentation generation

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Anoma
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 101 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,112 @@
1-
.PHONY: install deps compile test livebook
1+
# EngineSystem Makefile
22

3-
# Default target
4-
all: deps compile
3+
.PHONY: help docs livebook test compile clean deps check
54

6-
# Compile the project
5+
# Default target
6+
help:
7+
@echo "EngineSystem Development Commands:"
8+
@echo ""
9+
@echo " 📚 Documentation & Tutorials:"
10+
@echo " docs - Generate ExDoc documentation"
11+
@echo " livebook - Start Livebook with the interactive tutorial"
12+
@echo ""
13+
@echo " 🔧 Development:"
14+
@echo " compile - Compile the project"
15+
@echo " test - Run tests"
16+
@echo " check - Run quality checks (credo, dialyzer)"
17+
@echo " deps - Get dependencies"
18+
@echo " clean - Clean build artifacts"
19+
@echo ""
20+
@echo " 🚀 Quick Start:"
21+
@echo " make livebook # Start the interactive tutorial"
22+
@echo " make docs # Generate documentation"
23+
24+
# Documentation generation
25+
docs:
26+
@echo "📚 Generating ExDoc documentation..."
27+
mix docs
28+
@echo "✅ Documentation generated at doc/index.html"
29+
@echo " You can also view it online after publishing to hex.pm"
30+
31+
# Start Livebook with the tutorial
32+
livebook:
33+
@echo "🚀 Starting Livebook with EngineSystem tutorial..."
34+
@echo " The tutorial will open at: http://localhost:8080"
35+
@echo " 📓 Interactive examples and guided learning ahead!"
36+
@echo ""
37+
livebook server README.livemd --open
38+
39+
# Alternative livebook command for systems without livebook installed
40+
livebook-docker:
41+
@echo "🐳 Starting Livebook via Docker..."
42+
docker run -p 8080:8080 -v $(PWD):/data livebook/livebook
43+
44+
# Development tasks
745
compile:
46+
@echo "🔨 Compiling EngineSystem..."
847
mix compile
948

10-
# Run tests
1149
test:
50+
@echo "🧪 Running tests..."
1251
mix test
1352

14-
# Format code
15-
format:
16-
@echo "Formatting code..."
17-
@mix format
53+
deps:
54+
@echo "📦 Getting dependencies..."
55+
mix deps.get
56+
57+
clean:
58+
@echo "🧹 Cleaning build artifacts..."
59+
mix clean
60+
rm -rf doc/
61+
rm -rf _build/
62+
63+
# Quality checks
64+
check: credo dialyzer
65+
@echo "✅ All quality checks completed"
66+
67+
credo:
68+
@echo "🔍 Running Credo..."
69+
mix credo
1870

19-
# Run dialyzer
2071
dialyzer:
21-
@echo "Running dialyzer..."
22-
@mix dialyzer
23-
24-
# Check if code is properly formatted
25-
check.format:
26-
@echo "Checking code format..."
27-
@mix format --check-formatted
28-
29-
# Run linting
30-
lint: deps
31-
@echo "Running linter..."
32-
@mix credo --strict
33-
34-
# Run all checks
35-
check: check.format
36-
@echo "Running compilation check..."
37-
@mix compile --warnings-as-errors
38-
@mix test
39-
@mix dialyzer
40-
@mix credo --strict
41-
@mix format --check-formatted
42-
43-
# Generate documentation
44-
docs:
45-
@echo "Generating documentation..."
46-
@mix docs
72+
@echo "🔬 Running Dialyzer..."
73+
mix dialyzer
74+
75+
# Setup for new developers
76+
setup: deps compile test docs
77+
@echo ""
78+
@echo "🎉 EngineSystem development environment setup complete!"
79+
@echo ""
80+
@echo "Next steps:"
81+
@echo " 📓 Start learning: make livebook"
82+
@echo " 📚 View docs: open doc/index.html"
83+
@echo " 🧪 Run tests: make test"
84+
85+
# Publishing (for maintainers)
86+
publish-docs: docs
87+
@echo "📤 Publishing documentation to hex.pm..."
88+
@echo " Note: This happens automatically when publishing the package"
89+
90+
# Development server (if you want to serve docs locally)
91+
serve-docs: docs
92+
@echo "🌐 Serving documentation locally..."
93+
@echo " Available at: http://localhost:8000"
94+
cd doc && python -m http.server 8000
95+
96+
# Install development dependencies
97+
dev-deps:
98+
@echo "🛠️ Installing development dependencies..."
99+
mix deps.get
100+
@echo " Consider installing:"
101+
@echo " - Livebook: https://livebook.dev/"
102+
@echo " - ExDoc: included in deps"
47103

48-
# Install dependencies
49-
deps:
50-
@echo "Installing dependencies..."
51-
@mix deps.get
52-
53-
# Update dependencies
54-
deps.update:
55-
@echo "Updating dependencies..."
56-
@mix deps.update --all
57-
58-
# Check for outdated dependencies
59-
outdated:
60-
@echo "Checking for outdated dependencies..."
61-
@mix hex.outdated --all
62-
63-
# Ensure notebooks directory exists
64-
ensure-notebooks-dir:
65-
@mkdir -p notebooks
66-
67-
# Install Livebook if not already installed
68-
install-livebook:
69-
@if ! ls ~/.mix/escripts/livebook >/dev/null 2>&1; then \
70-
echo "Installing Livebook..."; \
71-
mix escript.install hex livebook --force; \
72-
else \
73-
echo "Livebook is already installed."; \
74-
fi
75-
76-
# Start Livebook with the engine examples notebook
77-
livebook: install-livebook ensure-notebooks-dir
78-
@echo "Starting Livebook..."
79-
@~/.mix/escripts/livebook server
80-
81-
# Start Livebook in detached mode (background)
82-
livebook-detached: install-livebook ensure-notebooks-dir
83-
@echo "Starting Livebook in the background..."
84-
@~/.mix/escripts/livebook server --no-auto-shutdown &
85-
86-
# Start Livebook with notebooks directory as home
87-
livebook-home: install-livebook ensure-notebooks-dir
88-
@echo "Starting Livebook with notebooks directory as home..."
89-
@~/.mix/escripts/livebook server --home notebooks
90-
# Help target
91-
help:
92-
@echo "Available targets:"
93-
@echo " deps - Install dependencies"
94-
@echo " deps.update - Update dependencies"
95-
@echo " compile - Compile the project"
96-
@echo " test - Run tests"
97-
@echo " check - Run all checks (format, compile)"
98-
@echo " check.format - Check code formatting"
99-
@echo " docs - Generate documentation"
100-
@echo " install-livebook - Install Livebook if not already installed"
101-
@echo " livebook - Start Livebook"
102-
@echo " livebook-detached - Start Livebook in detached mode"
103-
@echo " livebook-home - Start Livebook with notebooks directory as home"
104-
@echo " help - Show this help"
104+
# Format code
105+
format:
106+
@echo "💅 Formatting code..."
107+
mix format
108+
109+
# Run all checks before committing
110+
pre-commit: format compile test credo
111+
@echo "✅ Pre-commit checks completed successfully!"
112+
@echo " Ready to commit! 🚀"

0 commit comments

Comments
 (0)