diff --git a/api/static/js/api.js b/api/static/js/api.js deleted file mode 100644 index 243edf7..0000000 --- a/api/static/js/api.js +++ /dev/null @@ -1,26 +0,0 @@ -// Description: This file contains functions to access the API with JWT authentication. - -/** - * Accept an API endpoint, method, and body to send to the API. - * - If successful, return the response - * - If not, return false - * @param {*} endpoint API endpoint - * @param {*} method String (GET, POST, PUT, DELETE) - * @param {*} body Data to send to the API - * @returns response.json or false - */ -async function accessAPI(endpoint, method, body) { - let response = await fetch(`/api${endpoint}`, { - method: method, - body: body, - }); - - if (response.ok) { - let data = await response.json(); - data = await data; - return data; - - } - - return false; -} \ No newline at end of file diff --git a/api/templates/dashboard.html b/api/templates/dashboard.html deleted file mode 100644 index 25372bd..0000000 --- a/api/templates/dashboard.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - LinkLogger | Dashboard - - - - - - -
- - - - - - - - -
LinkVisitsRedirectExpire Date
-
- - - \ No newline at end of file diff --git a/api/templates/login.html b/api/templates/login.html deleted file mode 100644 index 8e59481..0000000 --- a/api/templates/login.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - LinkLogger | Login - - -
-

Incorrect username/password. Please try again.

-
- - - -
-
-

Don't have an account? Create one now

-
- - - - - - \ No newline at end of file diff --git a/api/templates/signup.html b/api/templates/signup.html deleted file mode 100644 index 32962b7..0000000 --- a/api/templates/signup.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - LinkLogger | Signup - - -
-

-
- - - -
-
-

Already have an account? Log in now

-

Passwords must be at least 8 characters long and contain a number, special character, and uppercase character.

-
- - - - - - \ No newline at end of file diff --git a/app/README.md b/app/README.md deleted file mode 100644 index 74872fd..0000000 --- a/app/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - -- Configure the top-level `parserOptions` property like this: - -```js -export default tseslint.config({ - languageOptions: { - // other options... - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - }, -}) -``` - -- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` -- Optionally add `...tseslint.configs.stylisticTypeChecked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: - -```js -// eslint.config.js -import react from 'eslint-plugin-react' - -export default tseslint.config({ - // Set the react version - settings: { react: { version: '18.3' } }, - plugins: { - // Add the react plugin - react, - }, - rules: { - // other rules... - // Enable its recommended rules - ...react.configs.recommended.rules, - ...react.configs['jsx-runtime'].rules, - }, -}) -``` diff --git a/app/index.html b/app/index.html index e4b78ea..882ffc0 100644 --- a/app/index.html +++ b/app/index.html @@ -2,9 +2,8 @@ - - Vite + React + TS + LinkLogger
diff --git a/app/src/assets/react.svg b/app/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/app/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/components/Dashboard.tsx b/app/src/components/Dashboard.tsx index 373a07f..ccbfd99 100644 --- a/app/src/components/Dashboard.tsx +++ b/app/src/components/Dashboard.tsx @@ -6,6 +6,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTrash } from '@fortawesome/free-solid-svg-icons'; function Dashboard() { + document.title = 'LinkLogger | Dashboard' + interface Log { id: number; link: string; diff --git a/app/src/components/Login.tsx b/app/src/components/Login.tsx index 8235b65..a3e5cf9 100644 --- a/app/src/components/Login.tsx +++ b/app/src/components/Login.tsx @@ -5,6 +5,8 @@ import { useNavigate } from 'react-router-dom'; import axios from 'axios'; function Login() { + document.title = 'LinkLogger | Login' + const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); diff --git a/app/src/components/Signup.tsx b/app/src/components/Signup.tsx index 293b51a..547fa9e 100644 --- a/app/src/components/Signup.tsx +++ b/app/src/components/Signup.tsx @@ -5,6 +5,8 @@ import { useNavigate } from 'react-router-dom'; import axios from 'axios'; function Signup() { + document.title = 'LinkLogger | Signup' + const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [passwordConfirm, setPasswordConfirm] = useState(''); diff --git a/app/src/index.css b/app/src/index.css deleted file mode 100644 index 6119ad9..0000000 --- a/app/src/index.css +++ /dev/null @@ -1,68 +0,0 @@ -:root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} diff --git a/app/src/main.tsx b/app/src/main.tsx index bef5202..4aff025 100644 --- a/app/src/main.tsx +++ b/app/src/main.tsx @@ -1,6 +1,5 @@ import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' -import './index.css' import App from './App.tsx' createRoot(document.getElementById('root')!).render(