Create your service domain wih clean code principals.
npm install clean-blacksmithGenerate a clean-architecture skeleton project easy and fast!.

Or as a CLI tool
> npm install [-g] clean-blacksmith
var cleanBlacksmith = require('clean-blacksmith');var command = 'forge';
var details = { target: '/some/url', blueprint: '/some/url/blueprint.json' };
cleanBlacksmith(command, details)
.then(result => { console.log('success') })
.catch(error => { console.log('ups!') });
`The blacksmith will give you some feedback through log messages to see what has been created:
`
Sample console output:
createdDomainFiles: '/domain/entities/Sword.js'
createdDomainFiles: '/domain/entities/index.js'
createdDomainFiles: '/domain/interactors/swordInteractor.js'
createdDomainFiles: '/domain/interactors/index.js'
createdDomainFiles: '/domain/stores/swordStore.js'
createdDomainFiles: '/domain/stores/index.js'
createdDomainFiles: '/domain/useCases/forgeSword.js'
createdDomainFiles: '/domain/useCases/index.js'
createdDomainFiles: '/domain/domain/index.js'
forge: Finished forging! Happy coding :)
`
As CLI tool
If you like to use your terminal to create your domain, this module offers as well a CLI tool called
vulcan). _Vulcan_ recieves a command and some
parameters in order to create your service domain.
Example:
`
vulcan --target --blueprint vulcan forge --target "/path-to-project/" --blueprint "/path-to-blueprint/blueprint.json"
`If you need to learn what is the current available commands, you can display the help:
`
vulcan --help [-h]
`Blueprint file
The blueprint file defines the way our domain is constructed, this is required in order to know
how layers are defined. The file at the moment only supports JSON format but it will be target later to
support more formats._NOTE_: This project contains two full blueprint examples definitions in the
/examples folder.`
for example:
{
"entities": [
{
"name": "Sword",
"props": ["type","weight"]
}
],
"interactors": [
{
"name": "swordInteractor",
"dependencies": ["entities", "stores"],
"functions": {
"requestMaterials": { "args": [] },
"meltSilver": { "args": [], "isAsync": true }
}
}
],
"stores": [...],
"useCases": [
{
"name": "forgeKatana",
"dependencies": ["swordInteractor"],
"args": ["swordMaterials"]
}
]
}
`Further plans
- Inlude more command options: ammend, enhance, destroy`.