Skip to content

Commit 470d911

Browse files
committed
feat: Implement admin dashboard with authentication, you can add projects in the showroom directky through the admin panel , protected routes, and a Code of Conduct page.
1 parent a6ce0f9 commit 470d911

23 files changed

+3671
-360
lines changed

client/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Supabase Configuration
2+
# Copy this file to .env and fill in your values
3+
VITE_SUPABASE_URL=your_supabase_project_url
4+
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

client/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ dist
1212
dist-ssr
1313
*.local
1414

15+
# Environment variables (sensitive!)
16+
.env
17+
.env.local
18+
.env.*.local
19+
1520
# Editor directories and files
1621
.vscode/*
1722
!.vscode/extensions.json

client/package-lock.json

Lines changed: 145 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@react-three/drei": "^10.7.6",
1414
"@react-three/fiber": "^9.3.0",
1515
"@studio-freight/lenis": "^1.0.42",
16+
"@supabase/supabase-js": "^2.93.2",
1617
"framer-motion": "^12.23.21",
1718
"lucide-react": "^0.562.0",
1819
"react": "^19.1.1",
@@ -29,7 +30,7 @@
2930
"@vitejs/plugin-react": "^5.0.3",
3031
"autoprefixer": "^10.4.21",
3132
"babel-plugin-styled-components": "^2.1.4",
32-
"baseline-browser-mapping": "^2.8.30",
33+
"baseline-browser-mapping": "^2.9.19",
3334
"eslint": "^9.36.0",
3435
"eslint-plugin-react-hooks": "^5.2.0",
3536
"eslint-plugin-react-refresh": "^0.4.20",

client/src/App.jsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Routes, Route } from 'react-router-dom';
1+
import { Routes, Route, useLocation } from 'react-router-dom';
22
import Header from './components/Header';
33
import HomePage from './pages/HomePage';
44
import ShowroomPage from './pages/ShowroomPage';
@@ -9,10 +9,35 @@ import JoinPage from './pages/JoinPage';
99
import PrivacyPolicyPage from './pages/PrivacyPolicy';
1010
import ScrollToTop from './components/ScrollTop';
1111
import TermsAndConditionsPage from './pages/TermsAndConditions';
12+
import CodeOfConduct from './pages/CodeOfConduct';
1213

13-
14+
// Admin imports
15+
import AdminLogin from './pages/admin/AdminLogin';
16+
import Dashboard from './pages/admin/Dashboard';
17+
import ProtectedRoute from './components/ProtectedRoute';
1418

1519
export default function App() {
20+
const location = useLocation();
21+
const isAdminRoute = location.pathname.startsWith('/admin');
22+
23+
// Admin routes render without the main site layout
24+
if (isAdminRoute) {
25+
return (
26+
<Routes>
27+
<Route path="/admin/login" element={<AdminLogin />} />
28+
<Route
29+
path="/admin"
30+
element={
31+
<ProtectedRoute>
32+
<Dashboard />
33+
</ProtectedRoute>
34+
}
35+
/>
36+
</Routes>
37+
);
38+
}
39+
40+
// Main site routes
1641
return (
1742
<div className="relative min-h-screen w-full bg-base">
1843
<ScrollToTop />
@@ -28,6 +53,7 @@ export default function App() {
2853
<Route path="/privacy" element={<PrivacyPolicyPage />} />
2954
<Route path="/terms" element={<TermsAndConditionsPage />} />
3055
<Route path="/apply" element={<JoinPage />} />
56+
<Route path="/code-of-conduct" element={<CodeOfConduct />} />
3157
</Routes>
3258
</main>
3359
<Footer />

0 commit comments

Comments
 (0)