Compare commits
25 Commits
dev_next-j
...
1406f28f86
| Author | SHA1 | Date | |
|---|---|---|---|
| 1406f28f86 | |||
| c803e42a76 | |||
| 76c0e6a64b | |||
| ebda6424c7 | |||
| 38d1091e9b | |||
| f82efecb8c | |||
| 1f12bc8839 | |||
| f19750f6f3 | |||
| 808b3fd5c4 | |||
| e362515eff | |||
| 0891598eb9 | |||
| 39ff02f2e7 | |||
| cc67fb4f85 | |||
| 75ff4aadc1 | |||
| 6f998d07c1 | |||
| f2bb326040 | |||
| 8c701db900 | |||
| d1664338a6 | |||
| 1a2624cd9e | |||
| a138190cc6 | |||
| 993e0cd74b | |||
| dab004a7b6 | |||
| d039336f39 | |||
| 4c781e9325 | |||
| 451e6b3646 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -112,4 +112,8 @@ backend/public/uploads/
|
|||||||
secrets/
|
secrets/
|
||||||
keys/
|
keys/
|
||||||
|
|
||||||
ToDo.txt
|
ToDo.txt
|
||||||
|
|
||||||
|
|
||||||
|
# only in development branch
|
||||||
|
next-env.d.ts
|
||||||
@@ -31,10 +31,10 @@ Include an API key in the route as `:key` parameter:
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```http
|
```http
|
||||||
GET /api/items/ABC123
|
GET /api/items/12345678
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `ABC123` is your API key.
|
Where `12345678` is your API key.
|
||||||
The API key is validated server-side.
|
The API key is validated server-side.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -59,7 +59,7 @@ Returns a list of all items.
|
|||||||
|
|
||||||
#### Path Parameters
|
#### Path Parameters
|
||||||
|
|
||||||
- `:key` – API key (string)
|
- `:key` – API key (8-digit number)
|
||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
|
|
||||||
@@ -70,14 +70,7 @@ Returns a list of all items.
|
|||||||
#### Request Example
|
#### Request Example
|
||||||
|
|
||||||
```http
|
```http
|
||||||
GET /api/items/ABC123 HTTP/1.1
|
GET /api/items/12345678 HTTP/1.1
|
||||||
Host: backend.insta.the1s.de
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```http
|
|
||||||
GET /api/items/dummyKey HTTP/1.1
|
|
||||||
Host: backend.insta.the1s.de
|
Host: backend.insta.the1s.de
|
||||||
Authorization: Bearer <JWT_TOKEN>
|
Authorization: Bearer <JWT_TOKEN>
|
||||||
```
|
```
|
||||||
@@ -123,7 +116,7 @@ Toggles `in_safe` between `0` and `1` for a given item.
|
|||||||
|
|
||||||
#### Path Parameters
|
#### Path Parameters
|
||||||
|
|
||||||
- `:key` – API key (string)
|
- `:key` – API key (8-digit number)
|
||||||
- `:itemId` – Item ID (integer)
|
- `:itemId` – Item ID (integer)
|
||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
@@ -133,7 +126,7 @@ Toggles `in_safe` between `0` and `1` for a given item.
|
|||||||
#### Request Example
|
#### Request Example
|
||||||
|
|
||||||
```http
|
```http
|
||||||
POST /api/change-state/ABC123/42 HTTP/1.1
|
POST /api/change-state/12345678/42 HTTP/1.1
|
||||||
Host: backend.insta.the1s.de
|
Host: backend.insta.the1s.de
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -165,7 +158,7 @@ Fetch loan information by `loan_code`.
|
|||||||
|
|
||||||
#### Path Parameters
|
#### Path Parameters
|
||||||
|
|
||||||
- `:key` – API key (string)
|
- `:key` – API key (8-digit number)
|
||||||
- `:loan_code` – Loan code (string)
|
- `:loan_code` – Loan code (string)
|
||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
@@ -175,7 +168,7 @@ Fetch loan information by `loan_code`.
|
|||||||
#### Request Example
|
#### Request Example
|
||||||
|
|
||||||
```http
|
```http
|
||||||
GET /api/get-loan-by-code/ABC123/12345 HTTP/1.1
|
GET /api/get-loan-by-code/12345678/12345 HTTP/1.1
|
||||||
Host: backend.insta.the1s.de
|
Host: backend.insta.the1s.de
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -214,7 +207,7 @@ Sets `returned_date = NOW()` on a loan and updates related items:
|
|||||||
|
|
||||||
#### Path Parameters
|
#### Path Parameters
|
||||||
|
|
||||||
- `:key` – API key (string)
|
- `:key` – API key (8-digit number)
|
||||||
- `:loan_code` – Loan code (string)
|
- `:loan_code` – Loan code (string)
|
||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
@@ -224,7 +217,7 @@ Sets `returned_date = NOW()` on a loan and updates related items:
|
|||||||
#### Request Example
|
#### Request Example
|
||||||
|
|
||||||
```http
|
```http
|
||||||
POST /api/set-return-date/ABC123/12345 HTTP/1.1
|
POST /api/set-return-date/12345678/12345 HTTP/1.1
|
||||||
Host: backend.insta.the1s.de
|
Host: backend.insta.the1s.de
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -257,7 +250,7 @@ Sets `take_date = NOW()` on a loan and updates related items:
|
|||||||
|
|
||||||
#### Path Parameters
|
#### Path Parameters
|
||||||
|
|
||||||
- `:key` – API key (string)
|
- `:key` – API key (8-digit number)
|
||||||
- `:loan_code` – Loan code (string)
|
- `:loan_code` – Loan code (string)
|
||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
@@ -267,7 +260,7 @@ Sets `take_date = NOW()` on a loan and updates related items:
|
|||||||
#### Request Example
|
#### Request Example
|
||||||
|
|
||||||
```http
|
```http
|
||||||
POST /api/set-take-date/ABC123/LOAN-12345 HTTP/1.1
|
POST /api/set-take-date/12345678/LOAN-12345 HTTP/1.1
|
||||||
Host: backend.insta.the1s.de
|
Host: backend.insta.the1s.de
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -297,7 +290,7 @@ Looks up an item by its `door_key`, toggles `in_safe`, and returns safe informat
|
|||||||
|
|
||||||
#### Path Parameters
|
#### Path Parameters
|
||||||
|
|
||||||
- `:key` – API key (string)
|
- `:key` – API key (8-digit number)
|
||||||
- `:doorKey` – Door key/token (string) used by hardware to identify the locker.
|
- `:doorKey` – Door key/token (string) used by hardware to identify the locker.
|
||||||
|
|
||||||
#### Authentication
|
#### Authentication
|
||||||
@@ -307,7 +300,7 @@ Looks up an item by its `door_key`, toggles `in_safe`, and returns safe informat
|
|||||||
#### Request Example
|
#### Request Example
|
||||||
|
|
||||||
```http
|
```http
|
||||||
GET /api/open-door/ABC123/123 HTTP/1.1
|
GET /api/open-door/12345678/123 HTTP/1.1
|
||||||
Host: backend.insta.the1s.de
|
Host: backend.insta.the1s.de
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { Box, Flex } from "@chakra-ui/react";
|
|||||||
import { Footer } from "./components/footer/Footer";
|
import { Footer } from "./components/footer/Footer";
|
||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
import { API_BASE } from "@/config/api.config";
|
import { API_BASE } from "@/config/api.config";
|
||||||
|
import { NotFoundPage } from "./pages/NotFoundPage";
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
@@ -83,6 +84,7 @@ function App() {
|
|||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route path="/login" element={<LoginPage />} />
|
<Route path="/login" element={<LoginPage />} />
|
||||||
|
<Route path="/not-found" element={<NotFoundPage />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</UserContext.Provider>
|
</UserContext.Provider>
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
import { ChakraProvider, defaultSystem } from "@chakra-ui/react"
|
import { ChakraProvider, defaultSystem } from "@chakra-ui/react";
|
||||||
import {
|
import * as React from "react";
|
||||||
ColorModeProvider,
|
import type { ReactNode } from "react";
|
||||||
type ColorModeProviderProps,
|
import { ColorModeProvider as ThemeColorModeProvider } from "./color-mode";
|
||||||
} from "./color-mode"
|
|
||||||
|
|
||||||
export function Provider(props: ColorModeProviderProps) {
|
export interface ColorModeProviderProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ColorModeProvider({ children }: ColorModeProviderProps) {
|
||||||
|
// Wrap children with the real color-mode provider
|
||||||
|
return <ThemeColorModeProvider>{children}</ThemeColorModeProvider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Provider({ children }: { children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<ChakraProvider value={defaultSystem}>
|
<ChakraProvider value={defaultSystem}>
|
||||||
<ColorModeProvider {...props} />
|
<ColorModeProvider>{children}</ColorModeProvider>
|
||||||
</ChakraProvider>
|
</ChakraProvider>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
9
FrontendV2/src/pages/NotFoundPage.tsx
Normal file
9
FrontendV2/src/pages/NotFoundPage.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export const NotFoundPage = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -1,16 +1,23 @@
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
|
||||||
import svgr from "vite-plugin-svgr";
|
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
import tsconfigPaths from "vite-tsconfig-paths";
|
import path from "node:path";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), svgr(), tailwindcss(), tsconfigPaths()],
|
plugins: [tailwindcss()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
port: 8001,
|
allowedHosts: ["insta.the1s.de"],
|
||||||
watch: {
|
port: 8101,
|
||||||
usePolling: true,
|
watch: { usePolling: true },
|
||||||
|
hmr: {
|
||||||
|
host: "insta.the1s.de",
|
||||||
|
port: 8101,
|
||||||
|
protocol: "wss",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -193,7 +193,12 @@ const ItemTable: React.FC = () => {
|
|||||||
|
|
||||||
{/* make table fill available width, like UserTable */}
|
{/* make table fill available width, like UserTable */}
|
||||||
{!isLoading && (
|
{!isLoading && (
|
||||||
<Table.Root size="sm" striped w="100%" style={{ tableLayout: "auto" }}>
|
<Table.Root
|
||||||
|
size="sm"
|
||||||
|
striped
|
||||||
|
w="100%"
|
||||||
|
style={{ tableLayout: "auto" }} // Spalten nach Content
|
||||||
|
>
|
||||||
<Table.Header>
|
<Table.Header>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader>
|
||||||
@@ -208,10 +213,10 @@ const ItemTable: React.FC = () => {
|
|||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader>
|
||||||
<strong>Im Schließfach</strong>
|
<strong>Im Schließfach</strong>
|
||||||
</Table.ColumnHeader>
|
</Table.ColumnHeader>
|
||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader width="1%" whiteSpace="nowrap">
|
||||||
<strong>Schließfachnummer</strong>
|
<strong>Schließfachnummer</strong>
|
||||||
</Table.ColumnHeader>
|
</Table.ColumnHeader>
|
||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader width="1%" whiteSpace="nowrap">
|
||||||
<strong>Schlüssel</strong>
|
<strong>Schlüssel</strong>
|
||||||
</Table.ColumnHeader>
|
</Table.ColumnHeader>
|
||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader>
|
||||||
@@ -226,7 +231,7 @@ const ItemTable: React.FC = () => {
|
|||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader>
|
||||||
<strong>Dav **</strong>
|
<strong>Dav **</strong>
|
||||||
</Table.ColumnHeader>
|
</Table.ColumnHeader>
|
||||||
<Table.ColumnHeader>
|
<Table.ColumnHeader width="1%" whiteSpace="nowrap">
|
||||||
<strong>Aktionen</strong>
|
<strong>Aktionen</strong>
|
||||||
</Table.ColumnHeader>
|
</Table.ColumnHeader>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
@@ -314,7 +319,7 @@ const ItemTable: React.FC = () => {
|
|||||||
<Table.Cell>{formatDateTime(item.entry_updated_at)}</Table.Cell>
|
<Table.Cell>{formatDateTime(item.entry_updated_at)}</Table.Cell>
|
||||||
<Table.Cell>{item.last_borrowed_person}</Table.Cell>
|
<Table.Cell>{item.last_borrowed_person}</Table.Cell>
|
||||||
<Table.Cell>{item.currently_borrowing}</Table.Cell>
|
<Table.Cell>{item.currently_borrowing}</Table.Cell>
|
||||||
<Table.Cell>
|
<Table.Cell whiteSpace="nowrap">
|
||||||
<Button
|
<Button
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
handleEditItems(
|
handleEditItems(
|
||||||
|
|||||||
@@ -8,9 +8,13 @@ export default defineConfig({
|
|||||||
plugins: [react(), svgr(), tailwindcss(), tsconfigPaths()],
|
plugins: [react(), svgr(), tailwindcss(), tsconfigPaths()],
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
port: 8003,
|
allowedHosts: ["admin.insta.the1s.de"],
|
||||||
watch: {
|
port: 8103,
|
||||||
usePolling: true,
|
watch: { usePolling: true },
|
||||||
|
hmr: {
|
||||||
|
host: "admin.insta.the1s.de",
|
||||||
|
port: 8103,
|
||||||
|
protocol: "wss",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"backend-info": {
|
"backend-info": {
|
||||||
"version": "v2.0.1 (dev)"
|
"version": "v2.0.1"
|
||||||
},
|
},
|
||||||
"frontend-info": {
|
"frontend-info": {
|
||||||
"version": "v2.0 (dev)"
|
"version": "v2.0"
|
||||||
},
|
},
|
||||||
"admin-panel-info": {
|
"admin-panel-info": {
|
||||||
"version": "v1.3 (dev)"
|
"version": "v1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ import apiRouter from "./routes/api/api.route.js";
|
|||||||
|
|
||||||
env.config();
|
env.config();
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 8004;
|
const port = 8102;
|
||||||
|
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
// Body-Parser VOR den Routen registrieren
|
// Body-Parser VOR den Routen registrieren
|
||||||
|
|||||||
@@ -1,23 +1,29 @@
|
|||||||
services:
|
services:
|
||||||
# usr-frontend_v2:
|
usr-frontend_v2:
|
||||||
# container_name: borrow_system-usr-frontend
|
container_name: borrow_system-usr-frontend
|
||||||
# build: ./FrontendV2
|
networks:
|
||||||
# ports:
|
- proxynet
|
||||||
# - "8001:80"
|
build: ./FrontendV2
|
||||||
# restart: unless-stopped
|
ports:
|
||||||
|
- "8101:80"
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
# admin-frontend:
|
admin-frontend:
|
||||||
# container_name: borrow_system-admin-frontend
|
container_name: borrow_system-admin-frontend
|
||||||
# build: ./admin
|
networks:
|
||||||
# ports:
|
- proxynet
|
||||||
# - "8003:80"
|
build: ./admin
|
||||||
# restart: unless-stopped
|
ports:
|
||||||
|
- "8103:80"
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
backend_v2:
|
backend_v2:
|
||||||
container_name: borrow_system-backend_v2
|
container_name: borrow_system-backend_v2
|
||||||
|
networks:
|
||||||
|
- proxynet
|
||||||
build: ./backendV2
|
build: ./backendV2
|
||||||
ports:
|
ports:
|
||||||
- "8004:8004"
|
- "8102:8102"
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
DB_HOST: mysql_v2
|
DB_HOST: mysql_v2
|
||||||
@@ -30,6 +36,8 @@ services:
|
|||||||
|
|
||||||
mysql_v2:
|
mysql_v2:
|
||||||
container_name: borrow_system-mysql-v2
|
container_name: borrow_system-mysql-v2
|
||||||
|
networks:
|
||||||
|
- proxynet
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@@ -39,9 +47,11 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- mysql-v2-data:/var/lib/mysql
|
- mysql-v2-data:/var/lib/mysql
|
||||||
- ./mysql-timezone.cnf:/etc/mysql/conf.d/timezone.cnf:ro
|
- ./mysql-timezone.cnf:/etc/mysql/conf.d/timezone.cnf:ro
|
||||||
ports:
|
|
||||||
- "3310:3306"
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data:
|
mysql-data:
|
||||||
mysql-v2-data:
|
mysql-v2-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxynet:
|
||||||
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user