Skip to content

Commit 1037d4e

Browse files
Merge pull request #72 from swinn-io/feature/frontend-rebuild
Frontend rebuild: Vite 6 + Vue 3 + Tailwind 4 (atomic design)
2 parents 1839d33 + e5cbbb9 commit 1037d4e

31 files changed

Lines changed: 3399 additions & 16687 deletions

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ jobs:
4646
- name: Install Dependencies
4747
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
4848

49+
- name: Setup Node
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: '20'
53+
cache: npm
54+
55+
- name: Install Node Dependencies
56+
run: npm ci
57+
58+
- name: Build Frontend
59+
run: npm run build
60+
4961
- name: Generate App Key
5062
run: php artisan key:generate
5163

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
.DS_Store
12
/.idea
23
/.worktrees
34
/node_modules
5+
/public/build
6+
/public/css
47
/public/hot
8+
/public/js
59
/public/storage
610
/storage/*.key
711
/vendor

app/Http/Controllers/FrontEnd/DashboardController.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ public function index(MessageServiceInterface $messages)
2020
$user = Auth::user();
2121
$threads = $messages->threads($user);
2222

23-
return view('dashboard', compact('threads'));
23+
return view('dashboard', [
24+
'threads' => $threads->map(fn ($thread) => [
25+
'id' => $thread->id,
26+
'subject' => $thread->subject,
27+
'unread_count' => 0,
28+
'participants' => $thread->participants
29+
->map(fn ($participant) => ['user' => ['name' => $participant->user->name]])
30+
->values()
31+
->all(),
32+
])->values()->all(),
33+
]);
2434
}
2535

2636
/**

app/Http/Controllers/FrontEnd/ThreadController.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,18 @@ public function show(string $thread)
6363
{
6464
$thread = $this->service->thread($thread);
6565

66-
return view('thread', compact('thread'));
66+
return view('thread', [
67+
'thread' => [
68+
'id' => $thread->id,
69+
'subject' => $thread->subject,
70+
'messages' => $thread->messages->map(fn ($message) => [
71+
'id' => $message->id,
72+
'body' => $message->body,
73+
'created_at' => $message->created_at->diffForHumans(),
74+
'user' => ['name' => $message->user->name],
75+
])->values()->all(),
76+
],
77+
]);
6778
}
6879

6980
/**

0 commit comments

Comments
 (0)