All Projects → andorp → order-taking

andorp / order-taking

Licence: other
Idris version of Domain Modeling Made Functional Book.

Programming Languages

Idris
72 projects
javascript
184084 projects - #8 most used programming language
Svelte
593 projects

Projects that are alternatives of or similar to order-taking

tradeio
A disciplined way to purely functional domain models in Scala
Stars: ✭ 19 (-83.19%)
Mutual labels:  ddd, fp
Rhodddoobie
My little sandbox for playing around with the FP + OOP + DDD combination, in particular using Rho, doobie, Docker, testing, etc in a project.
Stars: ✭ 38 (-66.37%)
Mutual labels:  ddd, fp
Interviews
A list of fancy questions I've been asked during the interviews I had. Some of them I ask when interviewing people.
Stars: ✭ 140 (+23.89%)
Mutual labels:  ddd, fp
functional-typescript-playground
A create-react-app based boilerplate featuring great functional programming oriented TypeScript-friendly libraries preinstalled for convenient forking & experimentation
Stars: ✭ 34 (-69.91%)
Mutual labels:  fp
go-ddd-api
API with domain driven design approach using golang, gorm, and mysql
Stars: ✭ 136 (+20.35%)
Mutual labels:  ddd
DDD
Domain-Driven Design is a software development approach in which it utilizes concepts and good practices related to object-oriented programming.
Stars: ✭ 51 (-54.87%)
Mutual labels:  ddd
IEManageSystem
基于 Asp.net core + React + ReactNative 的 可视化编辑,所见即所得 的 CMS,具有 浏览器 和 App 两个前端
Stars: ✭ 51 (-54.87%)
Mutual labels:  ddd
city-codes
Brazilian city names and official codes, IBGE, LexML and others
Stars: ✭ 39 (-65.49%)
Mutual labels:  ddd
food-ordering-demo
Demo application focusing on the Food Ordering domain - Used in our video series
Stars: ✭ 28 (-75.22%)
Mutual labels:  ddd
Clean-Architecture-Template
Configurable Clean Architecture template containing the DDD + CQRS approach for .NET Core applications.
Stars: ✭ 14 (-87.61%)
Mutual labels:  ddd
standard-projections
Standard projections to use with Prooph EventStore
Stars: ✭ 14 (-87.61%)
Mutual labels:  ddd
cofree
Fun and Games with Fix, Cofree, and Doobie
Stars: ✭ 37 (-67.26%)
Mutual labels:  fp
fs2-ssh
A wrapper around Apache SSHD targeting cats-effect and fs2
Stars: ✭ 36 (-68.14%)
Mutual labels:  fp
QrF.Core
基于.net core 2.2 的微服务框架
Stars: ✭ 19 (-83.19%)
Mutual labels:  ddd
pdo-snapshot-store
PDO Snapshot Store
Stars: ✭ 24 (-78.76%)
Mutual labels:  ddd
MonolithicArchitecture
This repository presents an approach on how to build an application using Monolithic architecture, ASP.NET Core, EntityFrameworkCore, Identity Server, CQRS, DDD
Stars: ✭ 18 (-84.07%)
Mutual labels:  ddd
apropos
Fast strong typed 'Either' data structure for typescript and flow
Stars: ✭ 20 (-82.3%)
Mutual labels:  fp
typescript-ddd-example
🔷🎯 TypeScript DDD Example: Complete project applying Hexagonal Architecture and Domain-Driven Design patterns
Stars: ✭ 607 (+437.17%)
Mutual labels:  ddd
micro
Functional prooph for microservices
Stars: ✭ 53 (-53.1%)
Mutual labels:  ddd
MiCake
🍰一款基于.Net Core平台的“超轻柔“领域驱动设计(DDD)组件
Stars: ✭ 112 (-0.88%)
Mutual labels:  ddd

Idris Full Stack DDD NodeJS example

Order Taking Service

Idris version of Domain Modeling Made Functional Book.

The Domain Modeling Made Functional by Scott Wlaschin introduces domain driven design and shows how well it fits to the world of functional programming via the lens of the F# programming language. As Scott showed us that DDD is indeed a nice fit for functional programming, questions arise naturally; could we push further the abstractions if we use a dependently typed programming language, like Idris? Where are the sweet spots of depedent types in the world of everyday programming? Everyday programming needs to be focused on delivery, maintanability, reliability, and being correct. The sad truth is that many applications needs to be more maintanable than correct. Being correct is not a clear concept because its meaning changes as the software evolves. In many cases, stakeholders only get a deeper understanding of the domain as the software solution/product evolves over time. In this setting, depedent typed programming helps us achieve maintanability rather than being correct. In this repository I show a simple layered architecture and I show how to use simple dependent types to draw explicit connections between the high level design of a service and its NodeJS deployed implementation. Ideas and practices originated, but reshuffled from the Type Driven Development with Idris by Edwin Brady and the Domain Modeling Made Functional by Scott Wlaschin. This architecture includes; An abstraction to talk about Bounded Context and Workflow, type safe description of a state transition system, a free monad approach for domain implementation, and an actual implementation of the domain on NodeJS back-end. Because of dependent types, this architecture becomes explicit, rather than implicit, meaning that connections between the high level design and the low level implementation are done via functions, changing the code anywhere requires to think at the whole, as possible type errors propagates to top or to bottom. Idris could immensely benefit from simple FFIs for NodeJS libraries. The FFIs would grant access to thousands of libraries from the NodeJS ecosystem almost for free. This approach would position Idris to be used even in production settings and the Idris userbase could be bootstrapped, later the Idris version of these libraries could be written.

Request: Please consider buying both of the books mentioned above. Boths are excellent resources for further studying of the applied subject.

Work In Progress parts:

  • The documentation is still under development. Please come back regurarly to see what changed.
  • Client needs lots of improvements.
  • Better error Handling around workflow runners.
  • Dependently driven testing needs to be implemented.

Financial Support

Talk

Youtube

Notes

This project meant to be a blue-print, example for micro-services written in Idris. Its main focus is to reproduce abstractions in dependently typed setting, that can be found in Scott Wlashin's book. The main focus is around the dependently typed implementation of BoundedContext, but several other parts of the architecture had to be worked on to be able to demostrate that Idris can host such solutions. Although during the implementation many other problems were required to think about in the dependently typed setting. This repository can be considered as a mine practices for dependently typed software development. Enjoy digging up those gems.

You may find the style of the explanations strange, maybe a bit chaotic, but if you follow path suggested in the READMAP.md you will learn many things about the Idris language. This style feels chaotic that could be because I have a slight ADHD and I try to linarize the content here, but sometimes quickly the explanations go deep. Although I believe a short explanation after every Idris snippet helps to view this reposity as a hand-book for Idris development.

High level overview

This repository contains more than just the Idris one to one translation of the F# code from the Domain Modeling Made Functional book. I wanted to show how Idris can be used to interface with existing NodeJS libraries. For that reason I added the following parts:

  • FFI for NodeJS interfacing libraries
  • Sketch of type-safe SQL library
  • Minimal scaffolding of a NodeJS server
  • Dependently typed framework for Bound-Context and Workflows
  • State transition of the PlaceOrder example
  • Free monadic DSL formalization of the PlaceOrder example
  • One backend implementation of the operations of PlaceOrder DSL

See the slides

Run

After setted up; start the microservice with make start-opt, start the client service npm run dev, and open localhost:5000 in a browser.

Setup

Server

  • Install Idris2 which version must match the one marketd the VERSIONS file. OR
  • If you Idris2 release version installed, check out the corresponding tag from 0.4.0

For dependencies install nodejs, npm and packages:

npm install google-closure-compiler
npm install sqlite
npm install md5

To start the OrderTaking service, which will create the initial Sqlite DB and starts the service on 127.0.0.1:3000

make init-db
make start-opt

Client

An example client can be found in the client/svelte-client directory. Follow the instructions from its README.md

To run the client, call the following command:

cd client/svelte-client
npm run dev

Which starts the client in development mode, any changes in its code, will be picked up.

Important note, use the g21 as product code on the client side for testing. The client is very in pre-alpha state, best to open the developer console to see, what happens before and after submitting the order. I will work on these details soon.

Have fun!

ASCII ART

ASCII ART

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].