Add create-admin script to package.json and set up /api/users route in server.js for user management functionality.

This commit is contained in:
Alvin committed 2025-06-10 09:47:17 +02:00
1 parent ef07016a14
commit d44338aa95
39 files changed
+22271 -1

No files matched your search

+113
View File
@@ -0,0 +1,113 @@
import React from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import Login from './components/Login';
import Dashboard from './components/Dashboard';
import CustomerList from './components/CustomerList';
import CustomerDetail from './components/CustomerDetail';
import CarModifications from './components/CarModifications';
import ContactHistory from './components/ContactHistory';
import PrivateRoute from './components/PrivateRoute';
import UserManagement from './components/UserManagement';
// Create a theme that matches the "stoer en snel" (tough and fast) requirement
const theme = createTheme({
palette: {
mode: 'dark',
primary: {
main: '#ff3d00', // Bright orange for speed and energy
},
secondary: {
main: '#212121', // Dark gray for toughness
},
background: {
default: '#121212',
paper: '#1e1e1e',
},
},
typography: {
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
h1: {
fontWeight: 700,
},
h2: {
fontWeight: 700,
},
},
components: {
MuiButton: {
styleOverrides: {
root: {
borderRadius: 0,
textTransform: 'none',
fontWeight: 600,
},
},
},
},
});
function App() {
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<Router>
<Routes>
<Route path="/login" element={<Login />} />
<Route
path="/"
element={
<PrivateRoute>
<Dashboard />
</PrivateRoute>
}
/>
<Route
path="/customers"
element={
<PrivateRoute>
<CustomerList />
</PrivateRoute>
}
/>
<Route
path="/customers/:id"
element={
<PrivateRoute>
<CustomerDetail />
</PrivateRoute>
}
/>
<Route
path="/modifications"
element={
<PrivateRoute>
<CarModifications />
</PrivateRoute>
}
/>
<Route
path="/contacts"
element={
<PrivateRoute>
<ContactHistory />
</PrivateRoute>
}
/>
<Route
path="/users"
element={
<PrivateRoute>
<UserManagement />
</PrivateRoute>
}
/>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Router>
</ThemeProvider>
);
}
export default App;