Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

London 10 -- Kristina Dudnyk -- Fullstack Project Assignment -- DataBases -- 300 #380

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
0df26d3
level 100
KristinaDudnyk Aug 27, 2023
c8be230
+
KristinaDudnyk Aug 27, 2023
c9d32bf
+
KristinaDudnyk Aug 27, 2023
2c5d9af
+
KristinaDudnyk Aug 27, 2023
2cd8b6f
+
KristinaDudnyk Sep 6, 2023
fe43bfb
SetRating
KristinaDudnyk Sep 11, 2023
a021471
...
KristinaDudnyk Sep 20, 2023
1f8fbea
.
KristinaDudnyk Sep 20, 2023
95f19f6
...
KristinaDudnyk Sep 20, 2023
e286975
...
KristinaDudnyk Sep 20, 2023
78b44c3
...
KristinaDudnyk Sep 20, 2023
19b1c3a
...
KristinaDudnyk Sep 20, 2023
d92bd76
...
KristinaDudnyk Sep 20, 2023
4f54aa4
...
KristinaDudnyk Sep 20, 2023
d05ac84
Installing new caniuse-lite version
KristinaDudnyk Sep 21, 2023
07a07ef
Changed layout of NewVideo component. Corected composition of compone…
KristinaDudnyk Sep 26, 2023
434af6f
Changing borders and sizes of elements
KristinaDudnyk Sep 27, 2023
784182d
corecting the width of header
KristinaDudnyk Sep 27, 2023
731041a
corecting a width
KristinaDudnyk Sep 27, 2023
a5f075f
+
KristinaDudnyk Sep 27, 2023
d63d06e
+
KristinaDudnyk Sep 27, 2023
d50fc22
+
KristinaDudnyk Sep 27, 2023
4f83077
+
KristinaDudnyk Sep 27, 2023
86f1920
adding or statement so loading of the frontEnd will not fail
KristinaDudnyk Jan 23, 2024
dc7aaa2
update of database
KristinaDudnyk Feb 11, 2024
9e5432d
+
KristinaDudnyk Feb 26, 2024
4e40aa2
removing useEffect from App.js
KristinaDudnyk Feb 26, 2024
ded696a
+
KristinaDudnyk Feb 28, 2024
91a6847
+
KristinaDudnyk Feb 28, 2024
5326111
testing githubworkflows
KristinaDudnyk Mar 1, 2024
6db121e
+
KristinaDudnyk Mar 1, 2024
58ba5fa
+
KristinaDudnyk Mar 1, 2024
467ce6c
+
KristinaDudnyk Mar 1, 2024
2403b42
+
KristinaDudnyk Mar 1, 2024
0624970
+
KristinaDudnyk Mar 1, 2024
f93c641
+++
KristinaDudnyk Mar 1, 2024
ec3295d
updatingV
KristinaDudnyk Mar 1, 2024
6cfa867
-
KristinaDudnyk Mar 1, 2024
4dc499a
-
KristinaDudnyk Mar 1, 2024
e94cc32
Create npm-publish-github-packages.yml
KristinaDudnyk Mar 1, 2024
31b7091
configuring
KristinaDudnyk Mar 1, 2024
9949e1e
c
KristinaDudnyk Mar 1, 2024
48a9dc6
0
KristinaDudnyk Mar 1, 2024
7554a64
configuring workflow for front-end
KristinaDudnyk Mar 1, 2024
b6c6d3e
correcting region
KristinaDudnyk Mar 1, 2024
5641bd1
correcting region02
KristinaDudnyk Mar 1, 2024
3269616
add config file, swap backend links to config variable
KristinaDudnyk Mar 1, 2024
881860a
configured workflow for backEnd
KristinaDudnyk Mar 1, 2024
e670fb8
configured workflow for backEnd02
KristinaDudnyk Mar 1, 2024
88fb584
change region for ec2
KristinaDudnyk Mar 2, 2024
9389761
change region for ec2 02
KristinaDudnyk Mar 2, 2024
9c9dd4d
change region for ec2 03
KristinaDudnyk Mar 2, 2024
130e200
change region for ec2 04
KristinaDudnyk Mar 2, 2024
cf2a597
change region for ec2 05
KristinaDudnyk Mar 2, 2024
0a414b6
change region for ec2 07
KristinaDudnyk Mar 2, 2024
34e4f6b
change region for ec2 08
KristinaDudnyk Mar 2, 2024
5576e31
change region for ec2 09
KristinaDudnyk Mar 2, 2024
ddb41ff
added &&
KristinaDudnyk Mar 2, 2024
706218d
just login
KristinaDudnyk Mar 2, 2024
60c9d6b
10
KristinaDudnyk Mar 2, 2024
da9fa70
11
KristinaDudnyk Mar 2, 2024
2af2956
12
KristinaDudnyk Mar 2, 2024
f5e80b4
swap to variables
KristinaDudnyk Mar 2, 2024
ac1eaf9
swap to variables to vars
KristinaDudnyk Mar 2, 2024
9ebb0df
888
KristinaDudnyk Mar 2, 2024
e7aadb4
887
KristinaDudnyk Mar 2, 2024
c9a4314
.
KristinaDudnyk Mar 2, 2024
5b68cd2
cleaning code
KristinaDudnyk Mar 2, 2024
1dad0c9
cleaning code02
KristinaDudnyk Mar 2, 2024
f90d90a
ADDING cho /home/kristina/.nvm/versions/node/v20.9.0/bin:/home/kristi…
KristinaDudnyk Mar 2, 2024
fe76394
finding npm
KristinaDudnyk Mar 2, 2024
deee6c8
finding npm02
KristinaDudnyk Mar 2, 2024
00538ce
changing pool env vars
KristinaDudnyk Mar 5, 2024
07b6a90
Merge branch 'main' of https://github.com/KristinaDudnyk/Full-Stack-P…
KristinaDudnyk Mar 5, 2024
35a5d56
+
KristinaDudnyk Mar 5, 2024
7810074
swap a backend link to brand new ec2 link
KristinaDudnyk Mar 6, 2024
aad524d
update a script for backend workflow
KristinaDudnyk Mar 6, 2024
8db8b69
export path
KristinaDudnyk Mar 6, 2024
944a0b9
change export to set
KristinaDudnyk Mar 6, 2024
85de17f
+
KristinaDudnyk Mar 6, 2024
bba590e
+
KristinaDudnyk Mar 6, 2024
aa77743
+
KristinaDudnyk Mar 6, 2024
cfd8a5b
+
KristinaDudnyk Mar 6, 2024
af42922
+
KristinaDudnyk Mar 6, 2024
2e38c95
+
KristinaDudnyk Mar 6, 2024
c298681
+
KristinaDudnyk Mar 6, 2024
d54db76
+
KristinaDudnyk Mar 6, 2024
2a17d59
+
KristinaDudnyk Mar 6, 2024
aefb9f1
+
KristinaDudnyk Mar 6, 2024
7db0f04
+
KristinaDudnyk Mar 6, 2024
382e83a
+
KristinaDudnyk Mar 6, 2024
042af95
+
KristinaDudnyk Mar 6, 2024
1f4fcbb
+
KristinaDudnyk Mar 6, 2024
ebee575
+
KristinaDudnyk Mar 6, 2024
52f7155
+
KristinaDudnyk Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/client/node_modules
/server/node_modules
.DS_Store
thumbs.db
*.swp
*.swo
*.sublime*
.vscode/
.env
8 changes: 8 additions & 0 deletions client/build/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"short_name": "To Do App",
"name": "To Do App",
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions client/build/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
46 changes: 28 additions & 18 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
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>
<title>Fullstack Project Assessment</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
63 changes: 63 additions & 0 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
.App {
text-align: center;
}

body {
background-color: rgb(199, 199, 199);
}

.toggle_container {
max-width: 1200px;
padding: 0 15px;
margin: 0 auto;
}

.checkbox {
display: inline-block;
}

.checkbox_inp {
position: absolute;
opacity: 0;
width: 0;
height: 0;
appearance: none;
}

.checkbox_span {
display: inline-block;
position: relative;
font-size: 18px;
padding: 8px 8px 8px 74px;
}

.checkbox_span::before {
content: "";
width: 60px;
height: 36px;
position: absolute;
left: 0;
top: 0;
border-radius: 18px;
background-color: rgb(255, 255, 255);
transition: background-color 0.3s;
}

.checkbox_span::after {
display: block;
content: "";
position: absolute;
width: 30px;
height: 30px;
border-radius: 15px;
background-color: rgb(86, 206, 30);
left: 3px;
top: 3px;
transition: background-color 0.3s, left 0.3s;
}

.checkbox_inp:checked + .checkbox_span::before {
background-color: rgb(86, 206, 30);
}

.checkbox_inp:checked + .checkbox_span::after {
background-color: rgb(255, 255, 255);
left: 27px;
}
14 changes: 11 additions & 3 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { useState } from "react";
import "./App.css";
import Header from "./Header";
import DisplayVideos from "./DisplayVideos";
import NewVivdeo from "./NewVideo";

function App() {
const [refreshVideos, setRefreshVideos] = useState(false);
return (
<div className="App">
<header className="App-header">
<h1>Video Recommendation</h1>
</header>
<Header />
<NewVivdeo setRefreshVideos={setRefreshVideos} />
<DisplayVideos
setRefreshVideos={setRefreshVideos}
refreshVideos={refreshVideos}
/>
</div>
);
}
Expand Down
16 changes: 16 additions & 0 deletions client/src/CardVideo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// import { useState } from "react";
import UpdateRating from "./UpdateRating";
import DeleteVideo from "./DeleteVideo";

export default function CardVideo({ video, setRefreshVideos }) {
return (
<>
<div key={video.id}>
<h2>{video.title}</h2>
<iframe title={video.title} src={video.url} width="500" height="281" />
<UpdateRating video={video} />
<DeleteVideo setRefreshVideos={setRefreshVideos} video={video} />
</div>
</>
);
}
43 changes: 43 additions & 0 deletions client/src/DeleteVideo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { useState } from "react";

export default function DeleteVideo({ video, setRefreshVideos }) {
const [videoId] = useState(video.id);

// console.log(videoId);

async function handleDelete(event) {
// event.preventDefault();

try {
// console.log(videoId);

const response = await fetch(
`https://kristinadudnyk-fullstack-project.onrender.com/video/${videoId}`,
// `http://localhost:4500/video/${videoId}`
{
method: "DELETE",
}
);
// console.log(`http://localhost:4500/video/${videoId}`);

console.log("handleDelete response:", response);

const json = await response.json();
console.log("handleDelete json:", json);

// event.target.reset();

setRefreshVideos((prevRefreshVideos) => !prevRefreshVideos);
} catch (error) {
console.log("handleDelete error:", error);
}
}

return (
<div>
<button className="submit-button" onClick={handleDelete}>
DELETE
</button>
</div>
);
}
41 changes: 41 additions & 0 deletions client/src/DisplayVideos.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { useEffect, useState } from "react";
import CardVideo from "./CardVideo";
import ToggleOrderOfVideos from "./ToggleOrderOfVideos";

export default function DisplayVideos({ refreshVideos, setRefreshVideos }) {
const [videos, setVideos] = useState([]);

const fetchData = async () => {
try {
const response = await fetch(
`https://kristinadudnyk-fullstack-project.onrender.com/video`
// "http://localhost:4500/video"
);
const data = await response.json();
console.log("fetchData in Videos", data);
setVideos(data);
} catch (error) {
console.log("The ERROR occured in fetchData in DisplayVideos:", error);
}
};

useEffect(() => {
fetchData();
}, [refreshVideos]);

return (
<div className="videos-container">
<ToggleOrderOfVideos
refreshVideos={refreshVideos}
setVideos={setVideos}
/>
{videos.map((video) => (
<CardVideo
key={video.id}
video={video}
setRefreshVideos={setRefreshVideos}
/>
))}
</div>
);
}
7 changes: 7 additions & 0 deletions client/src/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Header() {
return (
<header className="App-header">
<h1>Video Recommendation</h1>
</header>
);
}
Loading