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 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, '../../examples/starter-template');
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.2",
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,13 @@
1
+ # API Layer (R3)
2
+
3
+ Depends on: Domain (R1), Database (R2)
4
+
5
+ ## Examples
6
+ - REST endpoints
7
+ - GraphQL resolvers
8
+ - Request handlers
9
+ - Response formatting
10
+
11
+ ## Rules
12
+ Can import from: R1, R2
13
+ Cannot import from: R4
@@ -0,0 +1,13 @@
1
+ # Database Layer (R2)
2
+
3
+ Depends on: Domain (R1)
4
+
5
+ ## Examples
6
+ - User repository
7
+ - Order repository
8
+ - Database connections
9
+ - Migrations
10
+
11
+ ## Rules
12
+ Can import from: R1
13
+ Cannot import from: R3, R4
@@ -0,0 +1,12 @@
1
+ # Domain Layer (R1)
2
+
3
+ Zero dependencies. Core business logic.
4
+
5
+ ## Examples
6
+ - User entity
7
+ - Order entity
8
+ - Value objects
9
+ - Business rules
10
+
11
+ ## Rules
12
+ Cannot import from: Database (R2), API (R3), Integrations (R4)
@@ -0,0 +1,13 @@
1
+ # Integrations Layer (R4)
2
+
3
+ Depends on: All layers
4
+
5
+ ## Examples
6
+ - SendGrid email
7
+ - Stripe payments
8
+ - Auth0 authentication
9
+ - React/Vue UI components
10
+
11
+ ## Rules
12
+ Can import from: R1, R2, R3
13
+ External systems and UI live here
@@ -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,13 @@
1
+ # API Layer (R3)
2
+
3
+ Depends on: Domain (R1), Database (R2)
4
+
5
+ ## Examples
6
+ - REST endpoints
7
+ - GraphQL resolvers
8
+ - Request handlers
9
+ - Response formatting
10
+
11
+ ## Rules
12
+ Can import from: R1, R2
13
+ Cannot import from: R4
@@ -0,0 +1,13 @@
1
+ # Database Layer (R2)
2
+
3
+ Depends on: Domain (R1)
4
+
5
+ ## Examples
6
+ - User repository
7
+ - Order repository
8
+ - Database connections
9
+ - Migrations
10
+
11
+ ## Rules
12
+ Can import from: R1
13
+ Cannot import from: R3, R4
@@ -0,0 +1,12 @@
1
+ # Domain Layer (R1)
2
+
3
+ Zero dependencies. Core business logic.
4
+
5
+ ## Examples
6
+ - User entity
7
+ - Order entity
8
+ - Value objects
9
+ - Business rules
10
+
11
+ ## Rules
12
+ Cannot import from: Database (R2), API (R3), Integrations (R4)
@@ -0,0 +1,13 @@
1
+ # Integrations Layer (R4)
2
+
3
+ Depends on: All layers
4
+
5
+ ## Examples
6
+ - SendGrid email
7
+ - Stripe payments
8
+ - Auth0 authentication
9
+ - React/Vue UI components
10
+
11
+ ## Rules
12
+ Can import from: R1, R2, R3
13
+ External systems and UI live here