From 8ec60b1c41605f6de27b92ab1539e7a76b9235ec Mon Sep 17 00:00:00 2001 From: Chris-1010 <122332721@umail.ucc.ie> Date: Fri, 24 Jan 2025 15:17:53 +0000 Subject: [PATCH] Major: Added Authentication Functionality, interfaces with backend; Added new styles to HomePage & VideoPage; Added AuthContext to persist logged_in status; --- .gitignore | 7 +- frontend/index.html | 4 +- frontend/src/App.tsx | 49 +++-- frontend/src/assets/styles/index.css | 19 ++ frontend/src/components/Auth/AuthModal.tsx | 49 +++++ frontend/src/components/Auth/LoginForm.tsx | 128 +++++++++++- frontend/src/components/Auth/RegisterForm.tsx | 155 ++++++++++++++ .../src/components/Checkout/CheckoutForm.tsx | 17 +- frontend/src/components/Layout/Button.tsx | 40 +++- frontend/src/components/Layout/Input.tsx | 29 +++ frontend/src/components/Layout/ListRow.tsx | 10 +- frontend/src/components/Layout/Logo.tsx | 27 ++- frontend/src/components/Layout/Navbar.tsx | 112 ++++++---- frontend/src/components/Layout/Sidebar.tsx | 7 + frontend/src/context/AuthContext.tsx | 18 ++ frontend/src/context/StreamsContext.tsx | 42 ++++ frontend/src/pages/CheckoutPage.tsx | 0 frontend/src/pages/HomePage.tsx | 73 ++++--- frontend/src/pages/VideoPage.tsx | 18 +- web_server/blueprints/__init__.py | 18 +- web_server/blueprints/authentication.py | 195 ++++++++++++------ web_server/blueprints/main.py | 10 +- web_server/blueprints/user.py | 5 +- web_server/database/schema.sql | 3 + 24 files changed, 831 insertions(+), 204 deletions(-) create mode 100644 frontend/src/components/Auth/AuthModal.tsx create mode 100644 frontend/src/components/Auth/RegisterForm.tsx create mode 100644 frontend/src/components/Layout/Input.tsx create mode 100644 frontend/src/components/Layout/Sidebar.tsx create mode 100644 frontend/src/context/AuthContext.tsx create mode 100644 frontend/src/context/StreamsContext.tsx delete mode 100644 frontend/src/pages/CheckoutPage.tsx diff --git a/.gitignore b/.gitignore index 5e396ef..e2f15b0 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ coverage/ *.local # Editor directories and files +.vscode .vscode/* !.vscode/extensions.json .idea/ @@ -57,7 +58,5 @@ hls/ sockets/ dev-env/ project_structure.txt - -#Env -.env -web_server/frontend/.env +*.db +flask_session/ diff --git a/frontend/index.html b/frontend/index.html index e6ceec8..113daa2 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -6,8 +6,8 @@
{description}
@@ -65,7 +65,7 @@ const ListRow: React.FC