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

BackEnd-contact page-ahmed #36

Merged
merged 92 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
1a1015c
complete navbar and hero section
AhmedMohamed809 Mar 7, 2023
a0a9425
add invite friends button
AhmedMohamed809 Mar 8, 2023
e86326d
Create your profile page
levilu800b Mar 9, 2023
91a9869
first commit
rebwar1 Mar 9, 2023
790a4bb
createTable
rebwar1 Mar 10, 2023
8efba66
add client-side sidebar add user show user
rebwar1 Mar 10, 2023
42cc92a
remove ../../assets/scss/header.scss
rebwar1 Mar 10, 2023
48b22a9
Merge branch 'Create-my-Profile-page-Levi' into Demo-Branch
levilu800b Mar 10, 2023
769e25f
add DATABASE_URL=
rebwar1 Mar 10, 2023
9439298
link create profile page to home page
AhmedMohamed809 Mar 10, 2023
f565a04
Ready for Rebwar
levilu800b Mar 11, 2023
053abf6
fix to deploy
rebwar1 Mar 11, 2023
643b759
fix lint error
rebwar1 Mar 11, 2023
1fd0b34
Merge remote-tracking branch 'origin/main-rebwar' into Demo-Branch
levilu800b Mar 11, 2023
23d8f80
add navbar as global
AhmedMohamed809 Mar 11, 2023
0d11ead
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
AhmedMohamed809 Mar 11, 2023
c186fbe
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
AhmedMohamed809 Mar 11, 2023
5ad4054
bug fix on the demo branch
levilu800b Mar 11, 2023
0bcba91
Sign and dashboard
levilu800b Mar 13, 2023
ae749f9
add header to profile page
AhmedMohamed809 Mar 13, 2023
1829d88
fixed navbar to show on all routes
levilu800b Mar 13, 2023
1413d47
fixing bugs
levilu800b Mar 13, 2023
a7641ba
Dashboard not fully fixed
levilu800b Mar 13, 2023
cbd8b00
add ListUsers and server/public
rebwar1 Mar 14, 2023
bb6fda3
fix issues
levilu800b Mar 14, 2023
f0c3d16
Sidebar issue fix
levilu800b Mar 14, 2023
3216867
updates for sidebar
levilu800b Mar 14, 2023
deec9be
Merge branch 'Sidebar-fix-Levi' into Demo-Branch
levilu800b Mar 14, 2023
4861e3f
updated components
levilu800b Mar 14, 2023
a2429bc
add header section
AhmedMohamed809 Mar 14, 2023
4dddbb5
add user info
AhmedMohamed809 Mar 14, 2023
a80f16d
add style to user info
AhmedMohamed809 Mar 14, 2023
3d5b9ff
i jsonwebtoken bcrypt
rebwar1 Mar 15, 2023
501c92d
Frontend signup
levilu800b Mar 15, 2023
99f9d11
fix-line-error
AhmedMohamed809 Mar 15, 2023
66f50e2
JWT Registration/Login system server
rebwar1 Mar 15, 2023
07a416a
Adding css
levilu800b Mar 15, 2023
822e7b9
sign up css styling
levilu800b Mar 15, 2023
14c3411
sign in css
levilu800b Mar 15, 2023
9cc8679
fix verify
rebwar1 Mar 16, 2023
b1f117c
jwt auth frontEnd
rebwar1 Mar 16, 2023
9c0b1aa
sidebar logout done
rebwar1 Mar 16, 2023
565f47f
some bootsrap style
rebwar1 Mar 16, 2023
99a42b4
resolve a fetch("/api/verify
rebwar1 Mar 16, 2023
8b34492
style profile
rebwar1 Mar 16, 2023
dea6f83
get all users
rebwar1 Mar 16, 2023
2b577eb
add notification
rebwar1 Mar 16, 2023
2da8399
log in front done
rebwar1 Mar 16, 2023
aded4b4
added list of user page
clav00cl Mar 16, 2023
a0b8447
new changes
levilu800b Mar 16, 2023
5851b1b
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
levilu800b Mar 16, 2023
2cbe115
Updated from demo branch
levilu800b Mar 16, 2023
85885e3
Backend interaction
levilu800b Mar 16, 2023
9ce73ca
fix it to wotking
rebwar1 Mar 17, 2023
d834f74
update backEnd and FrontEnd in order to chane Table database for inse…
rebwar1 Mar 17, 2023
0599f7b
add pur rquest to backEnd
rebwar1 Mar 17, 2023
c107c73
l
rebwar1 Mar 17, 2023
af16569
updated signup
levilu800b Mar 17, 2023
0f14760
update login backend
rebwar1 Mar 17, 2023
1294a8d
updates signup
levilu800b Mar 17, 2023
0d50b89
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
levilu800b Mar 17, 2023
b3f1de1
update-list-users
clav00cl Mar 17, 2023
df51dd4
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
clav00cl Mar 17, 2023
df47836
fixed list of users
clav00cl Mar 17, 2023
bd4e7df
Signup working with signin
levilu800b Mar 17, 2023
4291fe5
css styling
levilu800b Mar 17, 2023
67dabcd
css
levilu800b Mar 17, 2023
44cc63d
navigate to signin page after signup
levilu800b Mar 17, 2023
8e20c8d
signin css
levilu800b Mar 17, 2023
f94802e
Signin and signup now responsive
levilu800b Mar 17, 2023
9c1876b
bug fix
levilu800b Mar 17, 2023
6dccbcf
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
AhmedMohamed809 Mar 17, 2023
91bc046
css style
levilu800b Mar 17, 2023
1bcb33a
Fixed file error
levilu800b Mar 17, 2023
e98596d
Merge branch 'Sign-Up-Page-Levi' into Demo-Branch
levilu800b Mar 17, 2023
841df28
fix error
AhmedMohamed809 Mar 17, 2023
fd1b865
Merge branch 'Demo-Branch' of https://github.com/levilu800b/DALR-Lang…
AhmedMohamed809 Mar 17, 2023
203a66d
fix error in profile page
AhmedMohamed809 Mar 17, 2023
ffc18db
Added card css
levilu800b Mar 18, 2023
f18c41f
File changes start
levilu800b Mar 19, 2023
79daa4a
Add all components for the weeks tickets
levilu800b Mar 19, 2023
3b5b641
All set up
levilu800b Mar 19, 2023
3a947db
update list users
clav00cl Mar 21, 2023
d22f243
add the form
AhmedMohamed809 Mar 21, 2023
f920740
add the name failed
AhmedMohamed809 Mar 21, 2023
5bdac99
add email failed
AhmedMohamed809 Mar 21, 2023
e85c0d8
add age failed
AhmedMohamed809 Mar 21, 2023
f1402f5
add massage failed
AhmedMohamed809 Mar 21, 2023
3c93ef1
add send button
AhmedMohamed809 Mar 21, 2023
dd61bd6
add style to h1
AhmedMohamed809 Mar 21, 2023
d0d893d
done the back end for contact page
AhmedMohamed809 Mar 21, 2023
9afea1b
delete and fix all
AhmedMohamed809 Mar 21, 2023
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
94 changes: 85 additions & 9 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,89 @@
import { Route, Routes } from "react-router-dom";

import About from "./pages/About";
import { useState, useEffect } from "react";
import "react-toastify/dist/ReactToastify.css";
import {
BrowserRouter as Router,
Routes,
Route,
Navigate,
} from "react-router-dom";
import { toast } from "react-toastify";
import About from "./components/About/About";
import Contact from "./components/Contact/Contact";
import Home from "./pages/Home";
import Login from "./components/Sign-In/SignIn";
import Register from "./components/Sign-Up/SignUp";
import Dashboard from "./components/Dashboard/Dashboard";
import NavBar from "./components/HomePage/NavBar/NavBar";

toast.configure();

function App() {
const [isAuthenticated, setIsAuthenticated] = useState(false);

const checkAuthenticated = async () => {
try {
const res = await fetch("/api/verify", {
method: "GET",
headers: { token: localStorage.token },
});

const parseRes = await res.json();

parseRes === true ? setIsAuthenticated(true) : setIsAuthenticated(false);
} catch (err) {
console.error(err.message);
}
};

useEffect(() => {
checkAuthenticated();
}, []);

const setAuth = (boolean) => {
setIsAuthenticated(boolean);
};

return (
<div>
<NavBar isAuthenticated={isAuthenticated} setAuth={setAuth} />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/contact" element={<Contact />} />

const App = () => (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about/this/site" element={<About />} />
</Routes>
);
<Route
path="/signin"
element={
!isAuthenticated ? (
<Login setAuth={setAuth} />
) : (
<Navigate to="/dashboard" replace />
)
}
/>
<Route
path="/signup"
element={
!isAuthenticated ? (
<Register setAuth={setAuth} />
) : (
<Navigate to="/signin" replace />
)
}
/>
<Route
path="/dashboard"
element={
isAuthenticated ? (
<Dashboard setAuth={setAuth} />
) : (
<Navigate to="/signin" replace />
)
}
/>
</Routes>
</div>
);
}

export default App;
Binary file added client/src/assets/bg1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/bg2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions client/src/assets/css/general.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@font-face {
font-family: PlayfairDisplay;
src: url(../fonts/PlayfairDisplay.ttf);
}

body {
font-family: PlayfairDisplay !important;
}
.content {
margin: 2em 5em;
background-color: #d4e3e4;
padding: 2em;
}
.header h2 {
color: white;
font-size: 25px;
text-align: center;
}
Binary file added client/src/assets/fonts/PlayfairDisplay.ttf
Binary file not shown.
Binary file added client/src/assets/profile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions client/src/assets/scss/dashboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.dashboard {
line-height: 30px;
}
.Required {
font-size: 1rem;
font-weight: 600;
color: red;
}
7 changes: 7 additions & 0 deletions client/src/assets/scss/footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
footer {
text-align: center;
}
.pfooter {
font-size: 1.5rem;
font-weight: 600;
}
5 changes: 5 additions & 0 deletions client/src/assets/scss/header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.header h2 {
color: white;
font-size: 25px;
text-align: center;
}
Empty file.
9 changes: 9 additions & 0 deletions client/src/components/About/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

const About = () => {
return (
<div>About</div>
);
};

export default About;
43 changes: 43 additions & 0 deletions client/src/components/Contact/Contact.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.cont{
margin-left: 10rem;
margin-top: 10rem;
}
form {
display: flex;
align-items: flex-start;
flex-direction: column;
width: 50%;
font-size: 16px;
}
input {
width: 50%;
height: 35px;
padding: 7px;
outline: none;
border-radius: 5px;
border: 1px solid rgb(220, 220, 220);
}

textarea {
max-width: 50%;
min-width: 100%;
width: 100%;
max-height: 100px;
min-height: 100px;
padding: 7px;
outline: none;
border-radius: 5px;
border: 1px solid rgb(220, 220, 220);

}
label {
margin-top: 1rem;
}
input[type="submit"] {
margin-top: 2rem;
cursor: pointer;
background: rgb(89, 203, 248);
color: white;
border: none;
}

35 changes: 35 additions & 0 deletions client/src/components/Contact/Contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React , { useRef } from "react";
import emailjs from "@emailjs/browser";
import "./Contact.css";


const Contact = () => {
const form = useRef();
const sendEmail = (e) => {
e.preventDefault();
emailjs.sendForm("service_v6xbs76", "template_tcusoju", form.current, "XTtiq2GJ_9G06NXit")
.then((result) => {
console.log(result.text);
console.log("Your Message has been sented");
}, (error) => {
console.log(error.text);
});
};

return (
<div className="cont">
<h1 style={{ color :"black", marginLeft:250 }} >contact</h1>
<form ref={form} onSubmit={sendEmail}>
<label>Name</label>
<input type="text" name="user_name" />
<label>Email</label>
<input type="email" name="user_email" />
<label>Message</label>
<textarea name="message" />
<input type="submit" value="Send" />
</form>
</div>
);
};

export default Contact;
Empty file.
10 changes: 10 additions & 0 deletions client/src/components/CreateEvents/CreateEvents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import "./CreateEvents.css";

const CreateEvents = () => {
return (
<div>CreateEvents</div>
);
};

export default CreateEvents;
Empty file.
58 changes: 58 additions & 0 deletions client/src/components/Dashboard/Dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React, { useState } from "react";
import { Layout } from "antd";
import Sidebar from "../../components/SideBar/SideBar";
import Profile from "../../components/Profile/Profile";
import EditProfile from "../../components/EditProfile/EditProfile";
import UserLists from "../../components/ListUsers/ListUsers";
import SearchCity from "../../components/SearchCity/SearchCity";
import SearchLanguage from "../../components/SearchLanguage/SearchLanguage";
import SearchCountry from "../../components/SearchCountry/SearchCountry";
import CreateEvents from "../../components/CreateEvents/CreateEvents";
import EventLists from "../../components/EventLists/EventLists";
import Logout from "../../components/Logout/Logout";

const { Content } = Layout;

function Dashboard({ setAuth }) {
const [selectedMenu, setSelectedMenu] = useState("profile");

const handleMenuClick = (key) => {
setSelectedMenu(key);
};

const renderContent = () => {
switch (selectedMenu) {
case "profile":
return <Profile setAuth={setAuth} />;
case "edit-profile":
return <EditProfile />;
case "user-lists":
return <UserLists />;
case "create-events":
return <CreateEvents />;
case "event-lists":
return <EventLists />;
case "search-city":
return <SearchCity />;
case "search-language":
return <SearchLanguage />;
case "search-country":
return <SearchCountry />;
case "logout":
return <Logout setAuth={setAuth} />;
default:
return <Profile />;
}
};

return (
<Layout style={{ minHeight: "100vh" }}>
<Sidebar onMenuClick={handleMenuClick} />
<Layout className="site-layout">
<Content style={{ margin: "0 16px" }}>{renderContent()}</Content>
</Layout>
</Layout>
);
}

export default Dashboard;
87 changes: 87 additions & 0 deletions client/src/components/EditProfile/EditProfile.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.signup-page {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}

.signup-page h1 {
font-size: 2rem;
margin-bottom: 2rem;
color: #000;
}

.form-group {
margin-bottom: 1rem;
width: 100%;
}

.form-group label {
display: block;
margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
width: 100%;
padding: 0.5rem;
border: 1px solid #ccc;
border-radius: 0.25rem;
font-size: 1rem;
line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus {
outline: none;
border-color: #0077ff;
box-shadow: 0 0 0 0.125em rgba(0, 119, 255, 0.25);
}

.language {
margin-bottom: 0.5rem;
}

.signup,
.cancel {
padding: 0.5rem 1rem;
border: none;
border-radius: 0.25rem;
font-size: 1rem;
line-height: 1.5;
cursor: pointer;
}

.signup {
background-color: #0077ff;
color: #fff;
margin-right: 0.5rem;
}

.cancel {
background-color: #fff;
color: #000;
}

.login_button {
margin-top: 1rem;
font-size: 1rem;
line-height: 1.5;
color: #0077ff;
cursor: pointer;
}

.signup-page {
display: flex;
flex-direction: column;
align-items: center;
margin: 0 auto;
max-width: 600px;
padding: 20px;

/* Media query for screens with max width of 768px */
@media only screen and (max-width: 768px) {
max-width: 90%;
}
}
Loading