diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..3519a95 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Attribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Chrome mit \"localhost/dog\" starten", + "url": "http://localhost:3000/dog", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..46704a8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 3001 +} \ No newline at end of file diff --git a/docs/dog.sql b/docs/dog.sql new file mode 100644 index 0000000..c6d301b --- /dev/null +++ b/docs/dog.sql @@ -0,0 +1,56 @@ +-- phpMyAdmin SQL Dump +-- version 5.2.0 +-- https://www.phpmyadmin.net/ +-- +-- Host: localhost +-- Erstellungszeit: 14. Dez 2022 um 22:08 +-- Server-Version: 10.4.27-MariaDB +-- PHP-Version: 8.1.12 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Datenbank: `dog` +-- + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `dogs` +-- + +CREATE TABLE `dogs` ( + `id` int(11) NOT NULL, + `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, + `qr_id` char(31) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, + `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, + `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, + `qr_code` mediumblob NOT NULL, + `picture` mediumblob NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Indizes der exportierten Tabellen +-- + +-- +-- Indizes für die Tabelle `dogs` +-- +ALTER TABLE `dogs` + ADD PRIMARY KEY (`id`), + ADD UNIQUE KEY `index_qr_id` (`qr_id`), + ADD UNIQUE KEY `index_email` (`email`); +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/docs/frame.png b/docs/frame.png new file mode 100644 index 0000000..f31c957 Binary files /dev/null and b/docs/frame.png differ diff --git a/docs/qrcode_hope-fly.de.png b/docs/qrcode_hope-fly.de.png new file mode 100644 index 0000000..75b3c08 Binary files /dev/null and b/docs/qrcode_hope-fly.de.png differ diff --git a/docs/threema-20221205-122402281.jpg b/docs/threema-20221205-122402281.jpg new file mode 100644 index 0000000..7cb9c3c Binary files /dev/null and b/docs/threema-20221205-122402281.jpg differ diff --git a/package-lock.json b/package-lock.json index 6974401..3bda589 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@types/react-dom": "^18.0.9", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-router-dom": "^6.4.5", "react-scripts": "5.0.1", "typescript": "^4.9.4", "web-vitals": "^2.1.4" @@ -3071,6 +3072,14 @@ } } }, + "node_modules/@remix-run/router": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.5.tgz", + "integrity": "sha512-my0Mycd+jruq/1lQuO5LBB6WTlL/e8DTCYWp44DfMTDcXz8DcTlgF0ISaLsGewt+ctHN+yA8xMq3q/N7uWJPug==", + "engines": { + "node": ">=14" + } + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -13938,6 +13947,36 @@ "node": ">=0.10.0" } }, + "node_modules/react-router": { + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.5.tgz", + "integrity": "sha512-1RQJ8bM70YEumHIlNUYc6mFfUDoWa5EgPDenK/fq0bxD8DYpQUi/S6Zoft+9DBrh2xmtg92N5HMAJgGWDhKJ5Q==", + "dependencies": { + "@remix-run/router": "1.0.5" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.5.tgz", + "integrity": "sha512-a7HsgikBR0wNfroBHcZUCd9+mLRqZS8R5U1Z1mzLWxFXEkUT3vR1XXmSIVoVpxVX8Bar0nQYYYc9Yipq8dWwAA==", + "dependencies": { + "@remix-run/router": "1.0.5", + "react-router": "6.4.5" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, "node_modules/react-scripts": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz", diff --git a/package.json b/package.json index ee89837..5af2a39 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@types/react-dom": "^18.0.9", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-router-dom": "^6.4.5", "react-scripts": "5.0.1", "typescript": "^4.9.4", "web-vitals": "^2.1.4" @@ -39,5 +40,6 @@ "last 1 firefox version", "last 1 safari version" ] - } + }, + "homepage": "http://localhost/li" } diff --git a/src/App.test.tsx b/src/App.test.tsx deleted file mode 100644 index 2a68616..0000000 --- a/src/App.test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/src/App.tsx b/src/App.tsx index a53698a..78b45b5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,24 +1,41 @@ import React from 'react'; -import logo from './logo.svg'; import './App.css'; +import { BrowserRouter, Routes, Route, Navigate} from 'react-router-dom'; +import "./App.css"; +import Login from './components/Login'; +import Register from './components/Register'; +import Home from './components/Home'; + +type UserT = +{ + email: string; + password: string; +} + +function App() +{ + const user : UserT = + { + email: 'user@user.de', + password: 'GrüneWiese' + }; -function App() { return (
-
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn React - -
+
+ + + { user && } /> } + {user && ( + <> + } /> + } /> + + )} + } /> + + +
); } diff --git a/src/components/Home.tsx b/src/components/Home.tsx new file mode 100644 index 0000000..a7d6df8 --- /dev/null +++ b/src/components/Home.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export default function Home() { + return ( +
+

Home

+ +
+ ) +} diff --git a/src/components/Login.tsx b/src/components/Login.tsx new file mode 100644 index 0000000..ed18fe9 --- /dev/null +++ b/src/components/Login.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export default function Login() +{ + return ( +
+

Login

+
+ ) +} diff --git a/src/components/Register.tsx b/src/components/Register.tsx new file mode 100644 index 0000000..0667b18 --- /dev/null +++ b/src/components/Register.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +export default function Register() { + return ( +
+

Register

+
+ ) +} diff --git a/src/index.css b/src/index.css index ec2585e..e69de29 100644 --- a/src/index.css +++ b/src/index.css @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..c76bde3 --- /dev/null +++ b/src/index.php @@ -0,0 +1,52 @@ + $callback) { + if ($path !== $uri) continue; + + $found = true; + $callback(); + } + + if (!$found) { + $notFoundCallback = $routes['/404']; + $notFoundCallback(); + } +} +?> \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 032464f..1fd12b7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,7 +2,6 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; -import reportWebVitals from './reportWebVitals'; const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement @@ -12,8 +11,3 @@ root.render( ); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/reportWebVitals.ts b/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16..0000000 --- a/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/src/setupTests.ts b/src/setupTests.ts deleted file mode 100644 index 8f2609b..0000000 --- a/src/setupTests.ts +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom';