create-living-architecture 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +5 -1
- package/templates/ARCHITECTURE.md +56 -0
- package/templates/README.md +28 -0
- package/templates/src/api/README.md +13 -0
- package/templates/src/database/README.md +13 -0
- package/templates/src/domain/README.md +12 -0
- package/templates/src/integrations/README.md +13 -0
- package/templates/starter-template/ARCHITECTURE.md +56 -0
- package/templates/starter-template/README.md +28 -0
- package/templates/starter-template/src/api/README.md +13 -0
- package/templates/starter-template/src/database/README.md +13 -0
- package/templates/starter-template/src/domain/README.md +12 -0
- package/templates/starter-template/src/integrations/README.md +13 -0
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ execSync('git init', { stdio: 'inherit' });
|
|
|
21
21
|
|
|
22
22
|
// Copy starter template
|
|
23
23
|
console.log('\nCreating structure');
|
|
24
|
-
const templatePath = path.join(__dirname, '
|
|
24
|
+
const templatePath = path.join(__dirname, 'templates');
|
|
25
25
|
|
|
26
26
|
function copyRecursive(src, dest) {
|
|
27
27
|
const entries = fs.readdirSync(src, { withFileTypes: true });
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-living-architecture",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Scaffold a Living Architecture project with gravitational code organization",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-living-architecture": "index.js"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.js",
|
|
11
|
+
"templates/"
|
|
12
|
+
],
|
|
9
13
|
"scripts": {
|
|
10
14
|
"test": "echo \"No tests yet\" && exit 0"
|
|
11
15
|
},
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
This project uses [Living Architecture](https://github.com/demos-ra/living-architecture).
|
|
4
|
+
|
|
5
|
+
Code organized by dependency gravity - heavy (pure logic) sinks to bottom, light (adapters) floats to top.
|
|
6
|
+
|
|
7
|
+
## Layers
|
|
8
|
+
|
|
9
|
+
**R1 • Domain** (heaviest - zero dependencies)
|
|
10
|
+
- Core business logic
|
|
11
|
+
- Entities, value objects, domain services
|
|
12
|
+
- No framework dependencies
|
|
13
|
+
|
|
14
|
+
**R2 • Database** (depends on domain only)
|
|
15
|
+
- Data persistence
|
|
16
|
+
- Repositories, DAOs
|
|
17
|
+
- Database adapters
|
|
18
|
+
|
|
19
|
+
**R3 • API** (orchestrates domain + database)
|
|
20
|
+
- Application services
|
|
21
|
+
- Use cases, workflows
|
|
22
|
+
- Business process coordination
|
|
23
|
+
|
|
24
|
+
**R4 • Integrations** (lightest - adapts everything)
|
|
25
|
+
- External system adapters
|
|
26
|
+
- UI/presentation layer
|
|
27
|
+
- Third-party services
|
|
28
|
+
- HTTP, GraphQL, message queues
|
|
29
|
+
|
|
30
|
+
## Dependency Rules
|
|
31
|
+
|
|
32
|
+
Dependencies flow down only:
|
|
33
|
+
```
|
|
34
|
+
R4 → R3 → R2 → R1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- R1 imports nothing
|
|
38
|
+
- R2 imports only R1
|
|
39
|
+
- R3 imports R1, R2
|
|
40
|
+
- R4 imports all
|
|
41
|
+
|
|
42
|
+
Violations caught by git hooks.
|
|
43
|
+
|
|
44
|
+
## Benefits
|
|
45
|
+
|
|
46
|
+
**Swap layers independently:**
|
|
47
|
+
- Change database? Only R2 affected
|
|
48
|
+
- Change UI framework? Only R4 affected
|
|
49
|
+
- Core business logic never touched
|
|
50
|
+
|
|
51
|
+
**Git history = architecture:**
|
|
52
|
+
```bash
|
|
53
|
+
git log --oneline
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Shows which layer each change affected.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Starter Template
|
|
2
|
+
|
|
3
|
+
Example Living Architecture project structure.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
domain/ R1 - Zero dependencies
|
|
10
|
+
database/ R2 - Depends on domain
|
|
11
|
+
api/ R3 - Orchestrates
|
|
12
|
+
integrations/ R4 - External systems + UI
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx create-living-architecture my-project
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Commit Examples
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Domain: Add user entity [R1/C2]
|
|
25
|
+
Database: Add user repository [R2/C2]
|
|
26
|
+
API: Add registration endpoint [R3/C2]
|
|
27
|
+
Integrations: Add SendGrid email [R4/C2]
|
|
28
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
This project uses [Living Architecture](https://github.com/demos-ra/living-architecture).
|
|
4
|
+
|
|
5
|
+
Code organized by dependency gravity - heavy (pure logic) sinks to bottom, light (adapters) floats to top.
|
|
6
|
+
|
|
7
|
+
## Layers
|
|
8
|
+
|
|
9
|
+
**R1 • Domain** (heaviest - zero dependencies)
|
|
10
|
+
- Core business logic
|
|
11
|
+
- Entities, value objects, domain services
|
|
12
|
+
- No framework dependencies
|
|
13
|
+
|
|
14
|
+
**R2 • Database** (depends on domain only)
|
|
15
|
+
- Data persistence
|
|
16
|
+
- Repositories, DAOs
|
|
17
|
+
- Database adapters
|
|
18
|
+
|
|
19
|
+
**R3 • API** (orchestrates domain + database)
|
|
20
|
+
- Application services
|
|
21
|
+
- Use cases, workflows
|
|
22
|
+
- Business process coordination
|
|
23
|
+
|
|
24
|
+
**R4 • Integrations** (lightest - adapts everything)
|
|
25
|
+
- External system adapters
|
|
26
|
+
- UI/presentation layer
|
|
27
|
+
- Third-party services
|
|
28
|
+
- HTTP, GraphQL, message queues
|
|
29
|
+
|
|
30
|
+
## Dependency Rules
|
|
31
|
+
|
|
32
|
+
Dependencies flow down only:
|
|
33
|
+
```
|
|
34
|
+
R4 → R3 → R2 → R1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- R1 imports nothing
|
|
38
|
+
- R2 imports only R1
|
|
39
|
+
- R3 imports R1, R2
|
|
40
|
+
- R4 imports all
|
|
41
|
+
|
|
42
|
+
Violations caught by git hooks.
|
|
43
|
+
|
|
44
|
+
## Benefits
|
|
45
|
+
|
|
46
|
+
**Swap layers independently:**
|
|
47
|
+
- Change database? Only R2 affected
|
|
48
|
+
- Change UI framework? Only R4 affected
|
|
49
|
+
- Core business logic never touched
|
|
50
|
+
|
|
51
|
+
**Git history = architecture:**
|
|
52
|
+
```bash
|
|
53
|
+
git log --oneline
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Shows which layer each change affected.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Starter Template
|
|
2
|
+
|
|
3
|
+
Example Living Architecture project structure.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
domain/ R1 - Zero dependencies
|
|
10
|
+
database/ R2 - Depends on domain
|
|
11
|
+
api/ R3 - Orchestrates
|
|
12
|
+
integrations/ R4 - External systems + UI
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx create-living-architecture my-project
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Commit Examples
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Domain: Add user entity [R1/C2]
|
|
25
|
+
Database: Add user repository [R2/C2]
|
|
26
|
+
API: Add registration endpoint [R3/C2]
|
|
27
|
+
Integrations: Add SendGrid email [R4/C2]
|
|
28
|
+
```
|