diff --git a/README.md b/README.md
index 3c944e9..4c64133 100644
--- a/README.md
+++ b/README.md
@@ -8,3 +8,30 @@ Repository for a course project of CS4675/CS6675 at Georgia Institute of Technol
Raise a PR once you are ready and have checked your code for errors.
Mention a bullet point summary for all the features you are pushing as part of the PR within the description to ease the review process
+
+## Getting Started
+
+### Frontend
+For our frontend we are using React + Vite + TypeScript!
+
+- **React** -> JavaScript Framework for creating reactive user interfaces.
+- **Vite** -> Development environment / build tool. Gives us access to features like hot reload, bundling, and plugins.
+- **TypeScript** -> A superset of JavaScript allowing for static types.
+
+Here's how to set up + run the frontend environment:
+1. Download and install [Node.js](https://nodejs.org/en/download) v18+
+Check your node version:
+```sh
+node -v
+```
+2. Clone the repo using Git
+3. Install dependencies
+```sh
+cd frontend
+npm install
+```
+4. Start the development server
+```sh
+npm run dev
+```
+5. Visit http://localhost:5173
\ No newline at end of file
diff --git a/backend/api/user_login.py b/backend/api/user_login.py
index 1a8becb..4cd8ff5 100644
--- a/backend/api/user_login.py
+++ b/backend/api/user_login.py
@@ -18,7 +18,9 @@ class LoginView(APIView):
user = authenticate(username=username, password=password)
if user:
token, _ = Token.objects.get_or_create(user=user)
- return Response({"token": token.key})
+ response = Response({"token": token.key}, status=status.HTTP_200_OK)
+ response.set_cookie("token", token.key)
+ return response
else:
return Response(
{"error": "Invalid credentials"},
diff --git a/backend/peer_notes/settings.py b/backend/peer_notes/settings.py
index 474b470..2418f69 100644
--- a/backend/peer_notes/settings.py
+++ b/backend/peer_notes/settings.py
@@ -134,3 +134,7 @@ STATIC_URL = "static/"
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
AUTH_USER_MODEL = "api.PeerUser"
CORS_ALLOW_ALL_ORIGINS = True
+# CORS_ALLOWED_ORIGINS = [
+# "http://localhost:5173"
+# ]
+CORS_ALLOW_CREDENTIALS = True
\ No newline at end of file
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 570d257..b4ef972 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -1,21 +1,49 @@
-import './App.css'
-import { BrowserRouter, Routes, Route } from 'react-router-dom';
-import MainSearch from './components/MainSearch';
-import Results from './components/Results';
+import "./styles/App.css";
+import { Link, useNavigate } from 'react-router-dom';
+import { Outlet } from "react-router-dom";
+import { SessionContext, destroySessionCookie, getSessionCookie } from "./contexts/session";
+import { useState, useEffect, useContext } from "react";
+
+export default function App() {
+ const [session, setSession] = useState(getSessionCookie());
+ const navigate = useNavigate();
+
+ // Redirect to login if session is undefined
+ useEffect(
+ () => {
+ setSession(getSessionCookie());
+ if (session === undefined) {
+ navigate("/login");
+ }
+ },
+ [session, navigate]
+ );
-function App() {
return (
-
-