diff --git a/README.md b/README.md
index 15ea86d..3ae2f1f 100644
--- a/README.md
+++ b/README.md
@@ -17,3 +17,4 @@ Table:
| 13.07.2023 | Setup frontend | 6 |
| 13.07.2023 | Theme and styling | 10 |
| 14.07.2023 | Navbar | 10 |
+| 16.07.2023 | Login and register page | 20 |
diff --git a/client/src/scenes/loginPage/Form.jsx b/client/src/scenes/loginPage/Form.jsx
new file mode 100644
index 0000000..90106cf
--- /dev/null
+++ b/client/src/scenes/loginPage/Form.jsx
@@ -0,0 +1,276 @@
+import { useState } from "react";
+import {
+ Box,
+ Typography,
+ Button,
+ TextField,
+ useTheme,
+ useMediaQuery,
+} from "@mui/material";
+import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
+import { Formik } from "formik";
+import * as yup from "yup";
+import { useNavigate } from "react-router-dom";
+import { useDispatch } from "react-redux";
+import { setLogin } from "state";
+import Dropzone from "react-dropzone";
+import FlexBetween from "components/FlexBetween";
+
+const registerSchema = yup.object().shape({
+ firstName: yup.string().required("First name is required"),
+ lastName: yup.string().required("Last name is required"),
+ email: yup.string().email("Invalid email").required("Email is required"),
+ password: yup.string().required("Password is required"),
+ location: yup.string(),
+ description: yup.string(),
+ profilePicture: yup.string(),
+});
+
+const loginSchema = yup.object().shape({
+ email: yup.string().email("Invalid email").required("Email is required"),
+ password: yup.string().required("Password is required"),
+});
+
+const initialRegisterValues = {
+ firstName: "",
+ lastName: "",
+ email: "",
+ password: "",
+ location: "",
+ description: "",
+ profilePicture: "",
+};
+
+const initialLoginValues = {
+ email: "",
+ password: "",
+};
+
+const Form = () => {
+ const [pageType, setPageType] = useState("login");
+ const { palette } = useTheme();
+ const dispatch = useDispatch();
+ const navigate = useNavigate();
+ const isNotMobile = useMediaQuery("(min-width: 600px)");
+ const isLogin = pageType === "login";
+ const isRegister = pageType === "register";
+
+ const register = async (values, onSubmitProps) => {
+ const formData = new FormData();
+ for (const key in values) {
+ formData.append(key, values[key]);
+ }
+ formData.append("profilePicturePath", values.profilePicture.name);
+
+ const savedUserResponse = await fetch(
+ "http://localhost:3001/auth/register",
+ {
+ method: "POST",
+ body: formData,
+ }
+ );
+
+ const savedUser = await savedUserResponse.json();
+ onSubmitProps.resetForm();
+
+ if (savedUser) {
+ setPageType("login");
+ }
+ };
+
+ const login = async (values, onSubmitProps) => {
+ const loggedInUserResponse = await fetch(
+ "http://localhost:3001/auth/login",
+ {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(values),
+ }
+ );
+
+ const loggedInUser = await loggedInUserResponse.json();
+ onSubmitProps.resetForm();
+
+ if (loggedInUser) {
+ dispatch(setLogin({ user: loggedInUser, token: loggedInUser.token }));
+ navigate("/home");
+ }
+ };
+
+ const handleFormSubmit = async (values, onSubmitProps) => {
+ if (isLogin) {
+ await login(values, onSubmitProps);
+ }
+ if (isRegister) {
+ await register(values, onSubmitProps);
+ }
+ };
+
+ return (
+