Merge pull request #1 from Chris-1010/main
Reorganisation of project structure into backend/frontend sections; Introduced frontend integration; Connected backend to frontend.
61
.gitignore
vendored
@@ -1,3 +1,60 @@
|
||||
hls
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
.env
|
||||
venv/
|
||||
sockets
|
||||
ENV/
|
||||
.venv
|
||||
pip-log.txt
|
||||
|
||||
# Node
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
dist/
|
||||
dist-ssr/
|
||||
coverage/
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea/
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
Thumbs.db
|
||||
|
||||
# Project specific
|
||||
hls/
|
||||
sockets/
|
||||
dev-env/
|
||||
*.db
|
||||
flask_session/
|
||||
@@ -1,2 +1,2 @@
|
||||
FLASK_APP=blueprints.__init__
|
||||
FLASK_APP=backend.blueprints.__init__
|
||||
FLASK_DEBUG=True
|
||||
@@ -1,20 +1,23 @@
|
||||
from flask import Flask
|
||||
from flask_session import Session
|
||||
from blueprints.utils import logged_in_user
|
||||
from backend.blueprints.utils import logged_in_user
|
||||
from flask_cors import CORS
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__, template_folder="../ui/templates/", static_folder="../ui/static/")
|
||||
app.config["SECRET_KEY"] = ""
|
||||
app.config["SESSION_PERMANENT"] = False
|
||||
app.config["SESSION_TYPE"] = "filesystem"
|
||||
#! ↓↓↓ For development purposes only
|
||||
CORS(app) # Allow cross-origin requests for the frontend
|
||||
|
||||
Session(app)
|
||||
app.before_request(logged_in_user)
|
||||
|
||||
with app.app_context():
|
||||
from blueprints.authentication import auth_bp
|
||||
from blueprints.main import main_bp
|
||||
from blueprints.stripe import stripe_bp
|
||||
from backend.blueprints.authentication import auth_bp
|
||||
from backend.blueprints.main import main_bp
|
||||
from backend.blueprints.stripe import stripe_bp
|
||||
|
||||
app.register_blueprint(auth_bp)
|
||||
app.register_blueprint(main_bp)
|
||||
@@ -1,8 +1,8 @@
|
||||
from flask import Blueprint, render_template, session, request, url_for, redirect, g
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
from forms import SignupForm, LoginForm
|
||||
from database.database import Database
|
||||
from blueprints.utils import login_required
|
||||
from backend.forms import SignupForm, LoginForm
|
||||
from backend.database.database import Database
|
||||
from backend.blueprints.utils import login_required
|
||||
|
||||
auth_bp = Blueprint("auth", __name__)
|
||||
|
||||
42
web_server/backend/blueprints/main.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from flask import render_template, Blueprint
|
||||
|
||||
main_bp = Blueprint("app", __name__)
|
||||
|
||||
|
||||
@main_bp.route('/get_streams')
|
||||
def get_sample_streams():
|
||||
"""
|
||||
Returns a list of (sample) streamers live right now
|
||||
"""
|
||||
streamers = [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "Gaming Stream",
|
||||
"streamer": "Gamer123",
|
||||
"viewers": 1500,
|
||||
"thumbnail": "assets/images/monkey.png",
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "Art Stream",
|
||||
"streamer": "Artist456",
|
||||
"viewers": 800,
|
||||
"thumbnail": "assets/images/surface.jpeg",
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "Music Stream",
|
||||
"streamer": "Musician789",
|
||||
"viewers": 2000,
|
||||
"thumbnail": "assets/images/dance_game.png",
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"title": "Just Chatting",
|
||||
"streamer": "Chatty101",
|
||||
"viewers": 1200,
|
||||
"thumbnail": "assets/images/elf.webp",
|
||||
},
|
||||
]
|
||||
return streamers
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
from flask import render_template, Blueprint
|
||||
|
||||
main_bp = Blueprint("app", __name__)
|
||||
|
||||
|
||||
@main_bp.route('/')
|
||||
def index():
|
||||
"""
|
||||
Home page of the platform
|
||||
|
||||
Contains a list of some of the streams that are currently live and the most popular categories.
|
||||
"""
|
||||
return render_template('index.html')
|
||||
|
||||
28
web_server/frontend/eslint.config.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default tseslint.config(
|
||||
{ ignores: ['dist'] },
|
||||
{
|
||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
'react-refresh': reactRefresh,
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
},
|
||||
},
|
||||
)
|
||||
13
web_server/frontend/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Team Software Project</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
4342
web_server/frontend/package-lock.json
generated
Normal file
34
web_server/frontend/package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"proxy": "http://localhost:5000",
|
||||
"dependencies": {
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router-dom": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.16",
|
||||
"globals": "^15.14.0",
|
||||
"postcss": "^8.5.1",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2",
|
||||
"typescript-eslint": "^8.18.2",
|
||||
"vite": "^6.0.5"
|
||||
}
|
||||
}
|
||||
6
web_server/frontend/postcss.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
24
web_server/frontend/src/App.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||
import HomePage from './pages/HomePage';
|
||||
import VideoPage from './pages/VideoPage';
|
||||
import LoginPage from './pages/LoginPage';
|
||||
import SignupPage from './pages/SignupPage';
|
||||
import CheckoutPage from './pages/CheckoutPage';
|
||||
import NotFoundPage from './pages/NotFoundPage';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<HomePage />} />
|
||||
<Route path="/video" element={<VideoPage />} />
|
||||
<Route path="/login" element={<LoginPage />} />
|
||||
<Route path="/signup" element={<SignupPage />} />
|
||||
<Route path="/checkout" element={<CheckoutPage />} />
|
||||
<Route path="*" element={<NotFoundPage />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
BIN
web_server/frontend/src/assets/images/dance_game.png
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
web_server/frontend/src/assets/images/elf.webp
Normal file
|
After Width: | Height: | Size: 372 KiB |
BIN
web_server/frontend/src/assets/images/monkey.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
web_server/frontend/src/assets/images/surface.jpeg
Normal file
|
After Width: | Height: | Size: 6.5 MiB |
73
web_server/frontend/src/assets/styles/index.css
Normal file
@@ -0,0 +1,73 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/*
|
||||
: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;
|
||||
}
|
||||
} */
|
||||
1
web_server/frontend/src/components/Auth/LoginForm.tsx
Normal file
@@ -0,0 +1 @@
|
||||
// login.html
|
||||
1
web_server/frontend/src/components/Auth/SignupForm.tsx
Normal file
@@ -0,0 +1 @@
|
||||
// signup.html
|
||||
@@ -0,0 +1 @@
|
||||
// checkout.html
|
||||
24
web_server/frontend/src/components/Layout/BaseLayout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
// base.html
|
||||
// src/components/Layout/BaseLayout.tsx
|
||||
import React from 'react';
|
||||
|
||||
interface BaseLayoutProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const BaseLayout: React.FC<BaseLayoutProps> = ({ children }) => {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charSet="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Live Stream</title>
|
||||
</head>
|
||||
<body>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
};
|
||||
|
||||
export default BaseLayout;
|
||||
36
web_server/frontend/src/components/Video/VideoPlayer.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
// video.html
|
||||
|
||||
// src/components/Video/VideoPlayer.tsx
|
||||
import React, { useEffect } from 'react';
|
||||
import videojs from 'video.js';
|
||||
import 'video.js/dist/video-js.css';
|
||||
|
||||
const VideoPlayer: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const player = videojs('player', {
|
||||
width: 1280,
|
||||
height: 720,
|
||||
controls: true,
|
||||
preload: 'auto',
|
||||
sources: [{
|
||||
src: '/hls/stream.m3u8',
|
||||
type: 'application/x-mpegURL'
|
||||
}]
|
||||
});
|
||||
|
||||
return () => {
|
||||
if (player) {
|
||||
player.dispose();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<video
|
||||
id="player"
|
||||
className="video-js vjs-default-skin"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoPlayer;
|
||||
10
web_server/frontend/src/main.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './assets/styles/index.css'
|
||||
import App from './App.tsx'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
10
web_server/frontend/src/pages/CheckoutPage.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
const CheckoutPage: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CheckoutPage;
|
||||
73
web_server/frontend/src/pages/HomePage.tsx
Normal file
@@ -0,0 +1,73 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
// import { data, Link } from "react-router-dom";
|
||||
// import { Search, User, LogIn } from "lucide-react";
|
||||
|
||||
const HomePage: React.FC = () => {
|
||||
const [featuredStreams, setFeaturedStreams] = useState([{}]);
|
||||
|
||||
//! ↓↓ runs twice when in development mode
|
||||
useEffect(() => {
|
||||
fetch("http://127.0.0.1:5000/get_streams")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
setFeaturedStreams(data);
|
||||
console.log(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<nav className="navbar">
|
||||
<div className="logo">
|
||||
<span>G</span>
|
||||
<span>A</span>
|
||||
<span>N</span>
|
||||
<span>D</span>
|
||||
<span>E</span>
|
||||
<span>R</span>
|
||||
</div>
|
||||
<div className="nav-buttons">
|
||||
<button className="nav-button">☰</button>
|
||||
<button className="nav-button">⚙️</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div className="tagline">Behold, your next great watch!</div>
|
||||
|
||||
<div className="search-container">
|
||||
{/* <input type="text" className="search-bar" placeholder="🔍 Search..."> */}
|
||||
</div>
|
||||
|
||||
<h2 className="section-title">Live Now</h2>
|
||||
<div className="streams-grid">
|
||||
{featuredStreams.map((stream: any) => (
|
||||
<div className="stream-card">
|
||||
<img
|
||||
src="/assets/images/dance_game.png"
|
||||
alt="Stream thumbnail"
|
||||
className="stream-thumbnail"
|
||||
/>
|
||||
<div className="stream-info">
|
||||
<div className="streamer">
|
||||
<span className="streamer-name">{stream.streamer}</span>
|
||||
</div>
|
||||
<div className="stream-title">{stream.title}</div>
|
||||
<div className="viewer-count">{stream.viewers} viewers</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<h2 className="section-title">Trending Categories</h2>
|
||||
<div className="categories-grid">
|
||||
<div className="category-card"></div>
|
||||
<div className="category-card"></div>
|
||||
<div className="category-card"></div>
|
||||
<div className="category-card"></div>
|
||||
<div className="category-card"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HomePage;
|
||||
10
web_server/frontend/src/pages/LoginPage.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
const LoginPage: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoginPage;
|
||||
10
web_server/frontend/src/pages/NotFoundPage.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
const NotFoundPage: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default NotFoundPage;
|
||||
10
web_server/frontend/src/pages/SignupPage.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
const SignupPage: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SignupPage;
|
||||
11
web_server/frontend/src/pages/VideoPage.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
const VideoPage: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1>Hello!</h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoPage;
|
||||
1
web_server/frontend/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
11
web_server/frontend/tailwind.config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
26
web_server/frontend/tsconfig.app.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
7
web_server/frontend/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
24
web_server/frontend/tsconfig.node.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
7
web_server/frontend/vite.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
})
|
||||
31
web_server/package-lock.json
generated
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "web_server",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"lucide-react": "^0.473.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lucide-react": {
|
||||
"version": "0.473.0",
|
||||
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.473.0.tgz",
|
||||
"integrity": "sha512-KW6u5AKeIjkvrxXZ6WuCu9zHE/gEYSXCay+Gre2ZoInD0Je/e3RBtP4OHpJVJ40nDklSvjVKjgH7VU8/e2dzRw==",
|
||||
"license": "ISC",
|
||||
"peerDependencies": {
|
||||
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react": {
|
||||
"version": "19.0.0",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz",
|
||||
"integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
5
web_server/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"lucide-react": "^0.473.0"
|
||||
}
|
||||
}
|
||||
178
web_server/project_structure.txt
Normal file
@@ -0,0 +1,178 @@
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 21/01/2025 17:22 __pycache__
|
||||
lar-- 21/01/2025 17:31 backend
|
||||
lar-- 21/01/2025 18:14 flask_session
|
||||
l---- 21/01/2025 17:09 frontend
|
||||
la--- 21/01/2025 17:30 55 .flaskenv
|
||||
la--- 21/01/2025 17:21 435 Dockerfile
|
||||
-a--- 21/01/2025 18:37 0 project_structure.txt
|
||||
la--- 20/01/2025 16:53 383 requirements.txt
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\backend
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 21/01/2025 17:32 __pycache__
|
||||
lar-- 21/01/2025 17:22 blueprints
|
||||
lar-- 21/01/2025 17:22 database
|
||||
la--- 21/01/2025 17:21 749 forms.py
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\backend\blueprints
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 21/01/2025 18:14 __pycache__
|
||||
la--- 21/01/2025 18:14 907 __init__.py
|
||||
la--- 21/01/2025 17:31 3626 authentication.py
|
||||
la--- 21/01/2025 17:21 325 main.py
|
||||
la--- 21/01/2025 17:21 1294 stripe.py
|
||||
la--- 21/01/2025 17:21 844 utils.py
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\backend\blueprints\__pycache__
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 21/01/2025 18:08 1155 __init__.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 1673 __init__.cpython-311.pyc
|
||||
la--- 21/01/2025 18:14 1572 __init__.cpython-312.pyc
|
||||
la--- 21/01/2025 17:21 562 app.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 2594 authentication.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 5120 authentication.cpython-311.pyc
|
||||
la--- 21/01/2025 17:31 4750 authentication.cpython-312.pyc
|
||||
la--- 21/01/2025 17:21 564 main.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 800 main.cpython-311.pyc
|
||||
la--- 21/01/2025 17:31 767 main.cpython-312.pyc
|
||||
la--- 21/01/2025 17:21 2457 stripe.cpython-311.pyc
|
||||
la--- 21/01/2025 17:31 2347 stripe.cpython-312.pyc
|
||||
la--- 21/01/2025 18:08 1393 utils.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 2018 utils.cpython-311.pyc
|
||||
la--- 21/01/2025 17:30 1892 utils.cpython-312.pyc
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\backend\database
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 21/01/2025 17:31 __pycache__
|
||||
la--- 21/01/2025 17:21 28672 app.db
|
||||
la--- 21/01/2025 17:21 588 database.py
|
||||
la--- 21/01/2025 17:21 5 requirements.txt
|
||||
la--- 21/01/2025 17:21 990 schema.sql
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\backend\database\__pycache__
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 21/01/2025 17:21 2082 database.cpython-311.pyc
|
||||
la--- 21/01/2025 17:31 1936 database.cpython-312.pyc
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\backend\__pycache__
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 21/01/2025 17:31 1418 forms.cpython-312.pyc
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\flask_session
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 21/01/2025 18:14 9 2029240f6d1128be89ddc327294631
|
||||
29
|
||||
la--- 21/01/2025 17:21 37 bd9d4040a2dcd9c9d4ed85d3dc2d6b
|
||||
a7
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 20/01/2025 17:44 src
|
||||
la--- 20/01/2025 17:15 734 eslint.config.js
|
||||
la--- 21/01/2025 16:58 370 index.html
|
||||
la--- 20/01/2025 17:21 149648 package-lock.json
|
||||
la--- 21/01/2025 18:07 837 package.json
|
||||
la--- 20/01/2025 17:16 80 postcss.config.js
|
||||
la--- 20/01/2025 17:16 126 tailwind.config.js
|
||||
la--- 20/01/2025 17:15 665 tsconfig.app.json
|
||||
la--- 20/01/2025 17:15 119 tsconfig.json
|
||||
la--- 20/01/2025 17:15 593 tsconfig.node.json
|
||||
la--- 20/01/2025 17:15 161 vite.config.ts
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 20/01/2025 17:15 assets
|
||||
lar-- 20/01/2025 17:46 components
|
||||
lar-- 21/01/2025 16:29 pages
|
||||
la--- 20/01/2025 17:15 606 App.css
|
||||
la--- 21/01/2025 16:30 799 App.tsx
|
||||
la--- 20/01/2025 17:15 1161 index.css
|
||||
la--- 20/01/2025 17:15 230 main.tsx
|
||||
la--- 20/01/2025 17:15 38 vite-env.d.ts
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\assets
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 20/01/2025 17:15 4126 react.svg
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\components
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
lar-- 20/01/2025 17:47 Auth
|
||||
lar-- 20/01/2025 17:47 Checkout
|
||||
lar-- 20/01/2025 17:47 Layout
|
||||
lar-- 20/01/2025 17:48 Video
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\components\Auth
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 20/01/2025 17:47 13 LoginForm.tsx
|
||||
la--- 20/01/2025 17:47 14 SignupForm.tsx
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\components\Checkout
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 20/01/2025 17:48 16 CheckoutForm.tsx
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\components\Layout
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 20/01/2025 17:49 533 BaseLayout.tsx
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\components\Video
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 20/01/2025 17:48 709 VideoPlayer.tsx
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\frontend\src\pages
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 21/01/2025 16:28 139 CheckoutPage.tsx
|
||||
la--- 21/01/2025 16:27 309 HomePage.tsx
|
||||
la--- 21/01/2025 16:28 133 LoginPage.tsx
|
||||
la--- 21/01/2025 16:29 139 NotFoundPage.tsx
|
||||
la--- 21/01/2025 16:29 135 SignupPage.tsx
|
||||
la--- 21/01/2025 16:49 153 VideoPage.tsx
|
||||
|
||||
Directory: C:\Users\chris\OneDrive - University College Cork\Documents\School\Year 3\Semester 2\CS3305 - Team Software Project\cs3305-team11\Team-Software-Project\web_server\__pycache__
|
||||
|
||||
Mode LastWriteTime Length Name
|
||||
---- ------------- ------ ----
|
||||
la--- 21/01/2025 17:21 551 app.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 6641 app.cpython-313.pyc
|
||||
la--- 21/01/2025 17:21 976 database.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 1036 forms.cpython-310.pyc
|
||||
la--- 21/01/2025 17:21 1727 forms.cpython-311.pyc
|
||||
la--- 21/01/2025 17:21 1291 forms.cpython-312.pyc
|
||||
la--- 21/01/2025 17:21 1342 forms.cpython-313.pyc
|
||||
|
||||
23
web_server/react-flask/.gitignore
vendored
@@ -1,23 +0,0 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -1,70 +0,0 @@
|
||||
# Getting Started with Create React App
|
||||
|
||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
||||
|
||||
## Available Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm start`
|
||||
|
||||
Runs the app in the development mode.\
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
|
||||
|
||||
The page will reload when you make changes.\
|
||||
You may also see any lint errors in the console.
|
||||
|
||||
### `npm test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.\
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
||||
|
||||
### `npm run build`
|
||||
|
||||
Builds the app for production to the `build` folder.\
|
||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
||||
|
||||
The build is minified and the filenames include the hashes.\
|
||||
Your app is ready to be deployed!
|
||||
|
||||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
||||
|
||||
### `npm run eject`
|
||||
|
||||
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
|
||||
|
||||
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||||
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
|
||||
|
||||
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
|
||||
|
||||
## Learn More
|
||||
|
||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
|
||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
||||
|
||||
### Code Splitting
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
||||
|
||||
### Analyzing the Bundle Size
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
||||
|
||||
### Making a Progressive Web App
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
||||
|
||||
### Deployment
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
||||
|
||||
### `npm run build` fails to minify
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
||||
17805
web_server/react-flask/package-lock.json
generated
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"name": "react-flask",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "^5.17.0",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"ajv": "^6.12.6",
|
||||
"ajv-keywords": "^3.5.2",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"schema-utils": "^4.3.0",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
@@ -1,43 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
},
|
||||
{
|
||||
"src": "logo192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
},
|
||||
{
|
||||
"src": "logo512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
@@ -1,38 +0,0 @@
|
||||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
25
web_server/react-flask/src/App.js
vendored
@@ -1,25 +0,0 @@
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<p>
|
||||
Edit <code>src/App.js</code> and save to reload.
|
||||
</p>
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Learn React
|
||||
</a>
|
||||
</header>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -1,8 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
render(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
17
web_server/react-flask/src/index.js
vendored
@@ -1,17 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
reportWebVitals();
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
13
web_server/react-flask/src/reportWebVitals.js
vendored
@@ -1,13 +0,0 @@
|
||||
const reportWebVitals = onPerfEntry => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
5
web_server/react-flask/src/setupTests.js
vendored
@@ -1,5 +0,0 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
@@ -7,6 +7,7 @@ colorama==0.4.6
|
||||
Flask==3.1.0
|
||||
Flask-Session==0.8.0
|
||||
Flask-WTF==1.2.2
|
||||
python-dotenv==1.0.1
|
||||
idna==3.10
|
||||
itsdangerous==2.2.0
|
||||
Jinja2==3.1.5
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
const stripe = Stripe("pk_test_51QikGlGk6yuk3uA8MT3uQrPMpUqJlKzkxfbrfrd34yXolWSbJYEFWm674s2aUydZyjjS0W2oByEJTV0LXMs1pWTk002ioHxQl6");
|
||||
|
||||
initialize();
|
||||
|
||||
// Create a Checkout Session
|
||||
async function initialize() {
|
||||
const fetchClientSecret = async () => {
|
||||
const response = await fetch("/create-checkout-session", {
|
||||
method: "POST",
|
||||
});
|
||||
const { clientSecret } = await response.json();
|
||||
return clientSecret;
|
||||
};
|
||||
|
||||
const checkout = await stripe.initEmbeddedCheckout({
|
||||
fetchClientSecret,
|
||||
});
|
||||
|
||||
// Mount Checkout
|
||||
checkout.mount('#checkout');
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Live Stream</title>
|
||||
{% block header_config %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block main_content %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block header_config %}
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
<script src="{{ url_for('static', filename='checkout.js') }}" defer></script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block main_content %}
|
||||
<!-- Display a payment form -->
|
||||
<div id="checkout">
|
||||
<!-- Checkout will insert the payment form here -->
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,5 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h1>Welcome</h1>
|
||||
{% endblock %}
|
||||
@@ -1,19 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<form action="" method="post" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.username.label }}
|
||||
{{ form.username() }}
|
||||
{% for error in form.username.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{{ form.password.label }}
|
||||
{{ form.password() }}
|
||||
<br />
|
||||
{{ form.submit() }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
|
||||
<form action="" method="post" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.email.label }}
|
||||
{{ form.email() }}
|
||||
{% for error in form.email.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{{ form.username.label }}
|
||||
{{ form.username() }}
|
||||
{% for error in form.username.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{{ form.password.label }}
|
||||
{{ form.password() }}
|
||||
{% for error in form.password.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{{ form.password2.label }}
|
||||
{{ form.password2() }}
|
||||
<br />
|
||||
{{ form.submit() }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,19 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<link href="http://vjs.zencdn.net/6.2.8/video-js.css" rel="stylesheet">
|
||||
<body>
|
||||
<video id="player" class="video-js vjs-default-skin" controls preload>
|
||||
<source src="/hls/stream.m3u8" type="application/x-mpegURL">
|
||||
</video>
|
||||
<script src="http://vjs.zencdn.net/6.2.8/video.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.4.0/videojs-contrib-hls.min.js"></script>
|
||||
<script>
|
||||
var player = videojs('player', {width: 1280, height: 720});
|
||||
player.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||