Skip to content

Commit 4c5b148

Browse files
committed
feat: Introduce module-based architecture for Remix fullstack projects, organizing features into dedicated modules with services and components.
1 parent 96c3858 commit 4c5b148

8 files changed

Lines changed: 187 additions & 894 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,24 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v4
2121

22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: latest
26+
2227
- name: Setup Node.js ${{ matrix.node-version }}
2328
uses: actions/setup-node@v4
2429
with:
2530
node-version: ${{ matrix.node-version }}
2631

2732
- name: Install dependencies
28-
run: npm ci
33+
run: bun install
2934

3035
- name: Build TypeScript
31-
run: npm run build
36+
run: bun run build
3237

3338
- name: Run tests
34-
run: npm test
39+
run: bun run test
3540

3641
- name: Check CLI works
3742
run: |
@@ -48,17 +53,22 @@ jobs:
4853
- name: Checkout
4954
uses: actions/checkout@v4
5055

56+
- name: Setup Bun
57+
uses: oven-sh/setup-bun@v1
58+
with:
59+
bun-version: latest
60+
5161
- name: Setup Node.js
5262
uses: actions/setup-node@v4
5363
with:
5464
node-version: 20
5565
registry-url: 'https://registry.npmjs.org'
5666

5767
- name: Install dependencies
58-
run: npm ci
68+
run: bun install
5969

6070
- name: Build TypeScript
61-
run: npm run build
71+
run: bun run build
6272

6373
- name: Publish to npm
6474
run: npm publish --access public

.github/workflows/publish.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v4
2121

22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: latest
26+
2227
- name: Setup Node.js
2328
uses: actions/setup-node@v4
2429
with:
2530
node-version: '20'
2631
registry-url: 'https://registry.npmjs.org'
2732

2833
- name: Install dependencies
29-
run: npm ci
34+
run: bun install
3035

3136
- name: Publish to NPM
3237
run: npm publish --provenance --access public

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ release/
55
*.log
66
.env
77
.env.*
8+
9+
package-lock.json

assets/architecture/laravel-backend.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Request Services (optional: cache, external APIs)
6464
app/Domain/
6565
├── Story/
6666
│ ├── Entities/
67-
│ │ └── StoryDTO.php
67+
│ │ └── Story.php
6868
│ ├── Events/
6969
│ │ └── StoryCreated.php
7070
│ ├── Exceptions/
@@ -297,19 +297,7 @@ class GetStoryBySlugUseCaseTest extends TestCase
297297
}
298298
}
299299
```
300+
# Documentation
300301

301-
## Artisan Commands
302-
303-
```bash
304-
# No built-in command for UseCase, create manually or use custom command
305-
php artisan make:controller Web/StoryController
306-
php artisan make:model Story -mfs
307-
php artisan make:request Story/StoreStoryRequest
308-
php artisan make:resource StoryResource
309-
php artisan make:event StoryCreated
310-
php artisan make:listener NotifyOnStoryCreated
311-
312-
# Testing
313-
php artisan test
314-
php artisan test --filter=StoryTest
315-
```
302+
- When you create a new UseCase, make sure to document it in the project dir `docs/{domain}/{usecase}.md` file.
303+
- The usecase spectation documentation flow UML or Cockburn

assets/architecture/monorepo.md

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,40 @@
3232
│ └── agents/
3333
├── CLAUDE.md
3434
├── package.json # Root package.json
35-
├── pnpm-workspace.yaml # pnpm workspaces
35+
├── pnpm-workspace.yaml # (If pnpm) Workspace config
3636
├── turbo.json # Turborepo config
37-
├── docker-compose.yml
3837
└── README.md
3938
```
4039

40+
## Package Manager Selection
41+
42+
**Ask the user to choose a package manager:**
43+
44+
1. **pnpm** (Recommended):
45+
* Uses `pnpm-workspace.yaml`.
46+
2. **Bun** / **Yarn** / **NPM**:
47+
* Uses `workspaces` in `package.json`.
48+
4149
## Workspace Configuration
4250

43-
### pnpm-workspace.yaml
51+
### Option 1: pnpm (pnpm-workspace.yaml)
4452
```yaml
4553
packages:
4654
- 'apps/*'
4755
- 'packages/*'
4856
```
4957
58+
### Option 2: Bun / Yarn / NPM (package.json)
59+
Add to root `package.json`:
60+
```json
61+
{
62+
"workspaces": [
63+
"apps/*",
64+
"packages/*"
65+
]
66+
}
67+
```
68+
5069
### turbo.json
5170
```json
5271
{
@@ -122,43 +141,7 @@ export function Button({ variant, children, onClick }: ButtonProps) {
122141
}
123142
```
124143

125-
## Docker Compose
126144

127-
```yaml
128-
version: '3.8'
129-
services:
130-
web:
131-
build:
132-
context: .
133-
dockerfile: apps/web/Dockerfile
134-
ports:
135-
- "3000:3000"
136-
depends_on:
137-
- api
138-
139-
api:
140-
build:
141-
context: .
142-
dockerfile: apps/api/Dockerfile
143-
ports:
144-
- "8080:8080"
145-
environment:
146-
- DATABASE_URL=postgres://user:pass@db:5432/app
147-
depends_on:
148-
- db
149-
150-
db:
151-
image: postgres:15
152-
environment:
153-
POSTGRES_USER: user
154-
POSTGRES_PASSWORD: pass
155-
POSTGRES_DB: app
156-
volumes:
157-
- pgdata:/var/lib/postgresql/data
158-
159-
volumes:
160-
pgdata:
161-
```
162145

163146
## Conventions
164147

0 commit comments

Comments
 (0)