Skip to content

Commit 458bc04

Browse files
authored
chore: Refactor CI/CD pipeline documentation and enhance Docker configurations (#92)
- Deleted outdated CI/CD pipeline documentation to streamline project resources. - Updated docker-compose.yml to improve performance on macOS by using :cached for volume mounts. - Enhanced environment.example by adding LORDICON_API_KEY for better configuration management. - Expanded .dockerignore to exclude additional build artifacts and environment files. - Introduced LoadingSpinner component for consistent loading indicators across the application. - Integrated Lordicon components for improved iconography in various UI components. - Updated theme-switching functionality with a new ThemeSwitcher component for better user experience.
1 parent b4be10a commit 458bc04

33 files changed

+6299
-738
lines changed

CI-CD-PIPELINE.md

Lines changed: 0 additions & 225 deletions
This file was deleted.

client/.dockerignore

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1+
# Dependencies
12
node_modules
2-
npm-debug.log*
3+
npm-debug.log
4+
pnpm-debug.log
5+
yarn-debug.log
6+
yarn-error.log
7+
8+
# Next.js build output
39
.next
4-
.nuxt
10+
out
511
dist
6-
.cache
7-
.parcel-cache
12+
build
13+
14+
# Testing
15+
coverage
16+
.turbo
17+
18+
# Environment files
19+
.env
820
.env.local
9-
.env.development.local
10-
.env.test.local
11-
.env.production.local
21+
.env.development
22+
.env.production
23+
.env.test
24+
25+
# Misc
1226
.DS_Store
1327
*.log
1428
.git
1529
.gitignore
1630
README.md
31+
32+
# IDE
1733
.vscode
1834
.idea
35+
*.swp
36+
*.swo
37+
*~

client/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ FROM node:18-alpine
33

44
WORKDIR /app
55

6+
# Install pnpm
67
RUN npm install -g pnpm
78

9+
# Copy only package files first for better caching
810
COPY package.json pnpm-lock.yaml ./
9-
RUN pnpm install
1011

11-
COPY . .
12+
# Install dependencies
13+
RUN pnpm install --frozen-lockfile
1214

1315
# Build arguments
1416
ARG NEXT_PUBLIC_API_URL
@@ -22,6 +24,9 @@ ENV NEXT_PUBLIC_MAPBOX_TOKEN=$NEXT_PUBLIC_MAPBOX_TOKEN
2224
ENV NODE_ENV=$NODE_ENV
2325
ENV NEXT_PUBLIC_VERSION=$VERSION
2426

27+
# Copy source files
28+
COPY . .
29+
2530
EXPOSE 3000
2631

2732
CMD ["pnpm", "dev"]

client/app/admin/dev-tools/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
77
import { Badge } from "@/components/ui/badge";
88
import { Input } from "@/components/ui/input";
99
import { adminApiGet, adminApiPost } from "@/lib/admin-api-client";
10+
import { LoadingSpinner } from "@/components/loading-spinner";
1011

1112

1213
type TaskRecord = {
@@ -132,7 +133,7 @@ export default function DevToolsPage() {
132133
if (loading) {
133134
return (
134135
<div className="min-h-screen flex items-center justify-center">
135-
<div className="text-muted-foreground">Loading...</div>
136+
<LoadingSpinner size={64} />
136137
</div>
137138
);
138139
}

client/app/admin/page.tsx

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
import { useState, useEffect } from "react";
44
import { useRouter } from "next/navigation";
5-
import { useTheme } from "next-themes";
65
import { Logo } from "@/components/logo";
76
import { Button } from "@/components/ui/button";
87
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
98
import { Badge } from "@/components/ui/badge";
109
import { Input } from "@/components/ui/input";
1110
import { Skeleton } from "@/components/ui/skeleton";
12-
import { Shield, LogOut, Users, Settings, Activity, Clock, AlertTriangle, TrendingUp, CheckCircle2, XCircle, Search, Wrench, MapPin, Sun, Moon } from "lucide-react";
11+
import { ThemeSwitcher } from "@/components/theme-switcher";
12+
import { Shield, LogOut, Users, Settings, Activity, Clock, AlertTriangle, TrendingUp, CheckCircle2, XCircle, Search, Wrench, MapPin } from "lucide-react";
1313
import {
1414
getAdminStats,
1515
getRecentCrises,
@@ -19,6 +19,7 @@ import {
1919
type RecentUser
2020
} from "@/lib/admin-api-client";
2121
import { formatActivityTime } from "@/lib/utils";
22+
import { LoadingSpinner } from "@/components/loading-spinner";
2223

2324
interface AdminUser {
2425
id: string;
@@ -27,8 +28,6 @@ interface AdminUser {
2728
}
2829

2930
export default function AdminDashboard() {
30-
const { theme, setTheme } = useTheme();
31-
const [mounted, setMounted] = useState(false);
3231
const [adminUser, setAdminUser] = useState<AdminUser | null>(null);
3332
const [loading, setLoading] = useState(true);
3433
const [statsLoading, setStatsLoading] = useState(true);
@@ -40,10 +39,6 @@ export default function AdminDashboard() {
4039
const [searchQuery, setSearchQuery] = useState("");
4140
const router = useRouter();
4241

43-
useEffect(() => {
44-
setMounted(true);
45-
}, []);
46-
4742
useEffect(() => {
4843
const checkAuth = async () => {
4944
const token = localStorage.getItem('admin_token') || sessionStorage.getItem('admin_token');
@@ -167,7 +162,7 @@ export default function AdminDashboard() {
167162
if (loading && !adminUser) {
168163
return (
169164
<div className="min-h-screen flex items-center justify-center">
170-
<div className="text-muted-foreground">Loading...</div>
165+
<LoadingSpinner size={64} />
171166
</div>
172167
);
173168
}
@@ -186,29 +181,7 @@ export default function AdminDashboard() {
186181
</Badge>
187182
</div>
188183
<div className="flex items-center gap-2">
189-
<Button
190-
variant="outline"
191-
size="icon"
192-
onClick={() => {
193-
const currentTheme = theme || "system";
194-
if (currentTheme === "dark") {
195-
setTheme("light");
196-
} else if (currentTheme === "light") {
197-
setTheme("dark");
198-
} else {
199-
// If system, toggle to opposite of current resolved theme
200-
const isDark = document.documentElement.classList.contains("dark");
201-
setTheme(isDark ? "light" : "dark");
202-
}
203-
}}
204-
aria-label="Toggle theme"
205-
>
206-
{mounted && theme === "dark" ? (
207-
<Sun className="h-4 w-4" aria-hidden="true" />
208-
) : (
209-
<Moon className="h-4 w-4" aria-hidden="true" />
210-
)}
211-
</Button>
184+
<ThemeSwitcher />
212185
<Button variant="outline" onClick={handleLogout} aria-label="Log out from admin dashboard">
213186
<LogOut className="mr-2 h-4 w-4" aria-hidden="true" />
214187
Logout

0 commit comments

Comments
 (0)