feat: add authentication and admin features

- Added `jose` library for JWT token generation and verification.
- Implemented login functionality with token storage using cookies.
- Created `HeaderAdmin` component for admin panel with login/logout capabilities.
- Developed `LoginForm` component for user authentication.
- Added `Table` component to display data with caching from localStorage.
- Introduced `SubHeaderAdmin` for additional admin actions.
- Enhanced `database.js` with functions for admin login and fetching table data.
- Updated `server.js` to handle new routes for login and table data retrieval.
- Modified `package.json` and `package-lock.json` to include new dependencies.
This commit is contained in:
2025-08-12 22:56:58 +02:00
parent 97eaf1e484
commit 8c2049fa24
15 changed files with 744 additions and 14 deletions

View File

@@ -11,7 +11,10 @@
},
"dependencies": {
"@tailwindcss/vite": "^4.1.11",
"js-cookie": "^3.0.5",
"lucide-react": "^0.539.0",
"primeicons": "^7.0.0",
"primereact": "^10.9.6",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-router-dom": "^7.8.0",
@@ -24,6 +27,7 @@
},
"devDependencies": {
"@eslint/js": "^9.32.0",
"@types/js-cookie": "^3.0.6",
"@types/react": "^19.1.9",
"@types/react-dom": "^19.1.7",
"@vitejs/plugin-react": "^4.7.0",