diff --git a/README.md b/README.md index df7137c..d1d9443 100644 --- a/README.md +++ b/README.md @@ -1 +1,37 @@ -# React with Apollo and JWT +# react-apollo-jwt + +## Description + +Sample App using MERN stack and JWT Authentication + +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +![badmath](https://img.shields.io/github/languages/top/nitrotap/react-apollo-jwt) +![badmath](https://img.shields.io/github/languages/top/nitrotap/nitrotap/react-apollo-jwt) +![badmath](https://img.shields.io/github/issues/nitrotap/react-apollo-jwt) +![badmath](https://img.shields.io/github/forks/nitrotap/react-apollo-jwt) +![badmath](https://img.shields.io/github/stars/nitrotap/react-apollo-jwt) + +## Table of Contents + +- [Installation](#Installation) +- [Questions](#Questions) +- [License](#License) + +## Installation + +npm i + +## Questions + +Please reach out to me on [GitHub](https://github.com/nitrotap) or by email at kartikinpublic@gmail.com for any additional questions. + +## License + +MIT + +Copyright 2022 nitrotap +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/client/package-lock.json b/client/package-lock.json index 988e5c8..1d80586 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -15,7 +15,7 @@ "@mui/material": "^5.8.1", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.2.0", - "@testing-library/user-event": "^13.5.0", + "@testing-library/user-event": "^14.3.0", "graphql": "^16.5.0", "jwt-decode": "^3.1.2", "react": "^18.2.0", @@ -3923,14 +3923,11 @@ } }, "node_modules/@testing-library/user-event": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-13.5.0.tgz", - "integrity": "sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg==", - "dependencies": { - "@babel/runtime": "^7.12.5" - }, + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.3.0.tgz", + "integrity": "sha512-P02xtBBa8yMaLhK8CzJCIns8rqwnF6FxhR9zs810flHOBXUYCFjLd8Io1rQrAkQRWEmW2PGdZIEdMxf/KLsqFA==", "engines": { - "node": ">=10", + "node": ">=12", "npm": ">=6" }, "peerDependencies": { @@ -20174,12 +20171,10 @@ } }, "@testing-library/user-event": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-13.5.0.tgz", - "integrity": "sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg==", - "requires": { - "@babel/runtime": "^7.12.5" - } + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.3.0.tgz", + "integrity": "sha512-P02xtBBa8yMaLhK8CzJCIns8rqwnF6FxhR9zs810flHOBXUYCFjLd8Io1rQrAkQRWEmW2PGdZIEdMxf/KLsqFA==", + "requires": {} }, "@tootallnate/once": { "version": "1.1.2", diff --git a/client/package.json b/client/package.json index 81a15d2..cb25097 100644 --- a/client/package.json +++ b/client/package.json @@ -14,7 +14,7 @@ "@mui/material": "^5.8.1", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.2.0", - "@testing-library/user-event": "^13.5.0", + "@testing-library/user-event": "^14.3.0", "graphql": "^16.5.0", "jwt-decode": "^3.1.2", "react": "^18.2.0", diff --git a/client/src/App.js b/client/src/App.js index 33db164..bf36993 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -2,9 +2,6 @@ import * as React from 'react'; import Box from '@mui/material/Box'; import CssBaseline from '@mui/material/CssBaseline'; - - - //apollo import { ApolloClient, @@ -42,14 +39,8 @@ const client = new ApolloClient({ cache: new InMemoryCache(), }); - - - - export default function App() { - - return ( @@ -58,7 +49,7 @@ export default function App() { - {/* } /> */} + } /> } /> } /> diff --git a/client/src/assets/images/jumbo.jpg b/client/src/assets/images/jumbo.jpg deleted file mode 100644 index 6b51d16..0000000 Binary files a/client/src/assets/images/jumbo.jpg and /dev/null differ diff --git a/client/src/assets/images/jumbo2.jpg b/client/src/assets/images/jumbo2.jpg deleted file mode 100644 index 4f46f96..0000000 Binary files a/client/src/assets/images/jumbo2.jpg and /dev/null differ diff --git a/client/src/pages/Login.js b/client/src/pages/Login.js index 41db08a..7bc39c6 100644 --- a/client/src/pages/Login.js +++ b/client/src/pages/Login.js @@ -8,7 +8,6 @@ import Auth from '../utils/auth'; import * as React from 'react'; import Avatar from '@mui/material/Avatar'; import Button from '@mui/material/Button'; -import CssBaseline from '@mui/material/CssBaseline'; import TextField from '@mui/material/TextField'; import FormControlLabel from '@mui/material/FormControlLabel'; import Checkbox from '@mui/material/Checkbox'; @@ -18,14 +17,9 @@ import Box from '@mui/material/Box'; import LockOutlinedIcon from '@mui/icons-material/LockOutlined'; import Typography from '@mui/material/Typography'; import Container from '@mui/material/Container'; -import { createTheme, ThemeProvider } from '@mui/material/styles'; import Copyright from '../components/Elements/Copyright'; - - -const theme = createTheme(); - function Login(props) { const [formState, setFormState] = useState({ email: '', password: '' }); const [login, { error }] = useMutation(LOGIN); @@ -87,84 +81,79 @@ function Login(props) { return ( - - - - - + + + + + + Sign in + + + + + } + label="Remember me" + checked={checked} + onChange={() => setChecked(!checked)} + /> + - - - {/* + Sign In + + + + {/* Forgot password? */} - - - - {"Don't have an account? Sign Up"} - - - - - - - - + + + + {"Don't have an account? Sign Up"} + + + + + + ); } diff --git a/client/src/pages/Signup.js b/client/src/pages/Signup.js index 43e25f1..813eb4d 100644 --- a/client/src/pages/Signup.js +++ b/client/src/pages/Signup.js @@ -1,12 +1,11 @@ import React, { useState } from 'react'; -// import { Link } from 'react-router-dom'; -import { useMutation } from '@apollo/client'; import Auth from '../utils/auth'; +import { useMutation } from '@apollo/client'; import { ADD_USER } from '../utils/mutations'; + import Avatar from '@mui/material/Avatar'; import Button from '@mui/material/Button'; -import CssBaseline from '@mui/material/CssBaseline'; import TextField from '@mui/material/TextField'; import FormControlLabel from '@mui/material/FormControlLabel'; import Checkbox from '@mui/material/Checkbox'; @@ -15,7 +14,6 @@ import Box from '@mui/material/Box'; import LockOutlinedIcon from '@mui/icons-material/LockOutlined'; import Typography from '@mui/material/Typography'; import Container from '@mui/material/Container'; -import { createTheme, ThemeProvider } from '@mui/material/styles'; import Copyright from '../components/Elements/Copyright'; @@ -85,82 +83,80 @@ function Signup(props) { }; return ( - - - {/* */} - - - - - - Sign up - - - - - - - Terms - - } - label="I confirm that I have read the legal documents and agree to the terms." - checked={checked} - onChange={() => setChecked(!checked)} - /> - - - - - Already have an account? Log in - - + + {/* */} + + + + + + Sign up + + + + + + + Terms + + } + label="I confirm that I have read the legal documents and agree to the terms." + checked={checked} + onChange={() => setChecked(!checked)} + /> + + + + + Already have an account? Log in + + - - - + + ) }