This is a backend application template that can be used when starting a new project.
It includes:
- A dockerfile for deployment
- A
/healthcheck
endpoint that returns 200. - A
/api/company
endpoint with an example of DDD + functional programming approach.
This repository adopts a domain driven design approach to separate each part of the code, into these layers:
- Presentation: (controllers): is the entry point to the application. It handles REST requests and executes basic validation.
- Application: this layer is divided into use cases. Its purpose is to orchestrate (call) the domain and infrastructure layers.
- Domain: this is the core of our application. It contains all of the business rules and higher order logic.
- Infrastructure: this layer contains all the logic to interact with the database and other lower level entities.
This repository adopts a functional programming paradigm. I chose it because it promotes small, independent immutable code, that has small clean interfaces that rely on nothing other than their input to produce idempotent output without side effects.
- Composing Software: The Book
- Professor Frisby's Mostly Adequate Guide to Functional Programming
- Railway Oriented Programming
This repository uses an inversion of control pattern based on functional programming. More details here.
This template includes the following tools:
build
: builds your application in the dist folder.start
: starts your application in the dist folder.clean
: deletes the dist folder.test:e2e
: runs end-to-ent integration tests.test:spec
: runs unit tests.lint
: runs prettier and eslint.lint:fix
: runs prettier and eslint and tries to fix all issues.