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

Google Oauth completed(BE) #5

Open
wants to merge 71 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d710e99
created Subscription model
IuliiaSam Jan 21, 2023
9ee4494
[feat]: Add support for typescript in the backend (#2)
Chris-isCoding Jan 21, 2023
0dca8f6
Merge branch 'dev' of https://github.com/subslify/Subslify into dev
zhiyi15 Jan 21, 2023
7448db2
feature[client]: Add mobile menu (#4)
Chris-isCoding Jan 21, 2023
4a3013f
Feature/token expiration logout (#3)
Chris-isCoding Jan 21, 2023
93b45c8
adding passport.js and express-session packdges
zhiyi15 Jan 21, 2023
56b4bc8
Merge branch 'dev' into subscriptions-db-setup
IuliiaSam Jan 21, 2023
9f6a390
fix[server]: Add nodemon config to work with typescript
Chris-isCoding Jan 21, 2023
e24b896
fix[server]: Add nodemon config to work with typescript (#5)
Chris-isCoding Jan 21, 2023
2234057
added google config
zhiyi15 Jan 21, 2023
f169069
Merge branch 'dev' of https://github.com/subslify/Subslify into dev
zhiyi15 Jan 21, 2023
517e50f
Merge branch 'dev' into feature/oauth
zhiyi15 Jan 21, 2023
0f3d933
feat: Add http cookies
Chris-isCoding Jan 21, 2023
90210fb
refactor[server]: Refactor Auth Middleware and responses
Chris-isCoding Jan 21, 2023
942b312
Merge branch 'dev' into subscriptions-db-setup
IuliiaSam Jan 21, 2023
0b7e7cc
refactor[client]: Remove token and local storage
Chris-isCoding Jan 21, 2023
d18a63e
added TypeScript to Subscriptions model
IuliiaSam Jan 21, 2023
8539a30
Add Search and Sort styles and components to dashboard pages.
timchang87 Jan 21, 2023
6e2dd85
feat[server]: Get current user using cookies
Chris-isCoding Jan 22, 2023
ef8b274
feat[client]: Use cookies to authenicate user
Chris-isCoding Jan 22, 2023
ce58847
refactor[client]: Redirect from landing page
Chris-isCoding Jan 22, 2023
a30acd5
feat: Add logout route and remove cookie on logout
Chris-isCoding Jan 22, 2023
f3d5043
Format code
timchang87 Jan 22, 2023
d95709f
Merge branch 'dev' into feature/search_filter_sort
timchang87 Jan 22, 2023
54b962b
fix[server]: Remove authenicate middleware from logout route
Chris-isCoding Jan 22, 2023
3824803
refactor[client]: Add conditional checks
Chris-isCoding Jan 22, 2023
092e030
refactor[server]: More descriptive error message
Chris-isCoding Jan 22, 2023
291c827
refactor[client]: Change image type value from Buffer to a string
Chris-isCoding Jan 22, 2023
e09ec2f
Add functionality to show selected sort option and start appContext l…
timchang87 Jan 22, 2023
d91914e
added google oauth
zhiyi15 Jan 23, 2023
c22431b
Google oath completed
zhiyi15 Jan 24, 2023
7d37e00
sm
zhiyi15 Jan 24, 2023
de265e6
feat: Authenticate user with cookies (#6)
timchang87 Jan 24, 2023
b6006b2
Merge branch 'dev' of https://github.com/subslify/Subslify into dev
zhiyi15 Jan 24, 2023
ade596c
Merge branch 'dev' into feature/Oauth
zhiyi15 Jan 24, 2023
f31fa75
deleted old Subscription model
IuliiaSam Jan 24, 2023
60e8e2d
Subscriptions db setup (#7)
timchang87 Jan 24, 2023
b4d5ff5
sm
zhiyi15 Jan 24, 2023
6094d63
Merge branch 'dev' of https://github.com/subslify/Subslify into dev
zhiyi15 Jan 24, 2023
b0750ad
Merge branch 'dev' into feature/Oauth
zhiyi15 Jan 24, 2023
7435436
Add function to contextAPI to handle GET requests for subscriptions
timchang87 Jan 24, 2023
b24da58
subscriptionsController: implemented createSubscription, getSubscript…
IuliiaSam Jan 24, 2023
3dec63b
google oauth completed
zhiyi15 Jan 24, 2023
d16bd45
Create button inside search input field
timchang87 Jan 24, 2023
6dd8a0a
Merge with dev and modify trial and past subscriptoins page to accoun…
timchang87 Jan 24, 2023
80b5f0c
feat: Use swc for faster compilation
Chris-isCoding Jan 24, 2023
abfb351
fix[client]: Refactor reducer to set a correct state
Chris-isCoding Jan 24, 2023
7f8a9dc
removed packges in main dir, added the packages in /server
zhiyi15 Jan 25, 2023
809587c
minor fixes in subscriptionsController
IuliiaSam Jan 25, 2023
4b6e52f
Google oauth completed (BE) (#9)
timchang87 Jan 25, 2023
9ea9c5f
subscriptionsController: createSubscription, getSubscriptions (#8)
timchang87 Jan 25, 2023
c3b32c7
Merge branch 'dev' into feature/swc-tsconfig-update
timchang87 Jan 25, 2023
e86fabf
feat: Use swc for faster compilation (#10)
timchang87 Jan 25, 2023
ded1862
fix[client]: Refactor reducer to set a correct state (#11)
timchang87 Jan 25, 2023
5d7752f
Update search to disable the search button when being clicked during …
timchang87 Jan 25, 2023
3d7e05b
fixed import BadRequestError in google.ts
zhiyi15 Jan 25, 2023
9af0896
Add frontend logic to call subs api
timchang87 Jan 25, 2023
db1bd56
Merge with dev
timchang87 Jan 25, 2023
054837d
getOneSubscription, updateSubscription, deleteSubscription
IuliiaSam Jan 25, 2023
7f40e9d
Connect frontend to backend with subscriptions
timchang87 Jan 25, 2023
a038087
feat: Add subscriptions controller functionality
Chris-isCoding Jan 25, 2023
941734d
merge: Feature/search filter sort (#13)
Chris-isCoding Jan 25, 2023
8094fd1
chore: Use node module resolution
Chris-isCoding Jan 25, 2023
d4b1f13
chore: Remove redundant dependencies
Chris-isCoding Jan 25, 2023
6b76d81
Merge branch 'dev' of https://github.com/subslify/Subslify into dev
zhiyi15 Jan 26, 2023
ac19330
deleted addOauth in google.ts
zhiyi15 Jan 26, 2023
8c1336d
fixed google.ts, added svgs in Register.jsx
zhiyi15 Jan 26, 2023
18ab49c
fixed google.ts, added svgs in Register.jsx
zhiyi15 Jan 26, 2023
5b7eb02
redirect from server to client draft, partially working
zhiyi15 Jan 26, 2023
8b2150f
added styling for oauth-icons svg
zhiyi15 Jan 26, 2023
9ef6cda
added redirect route to frontend from server with authenticate JWT token
zhiyi15 Jan 26, 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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/dist
/package-lock.json
/db-data
6 changes: 6 additions & 0 deletions client/src/assets/images/oauth-logos/fb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/src/assets/images/oauth-logos/gh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/src/assets/images/oauth-logos/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion client/src/assets/styles/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@
}
}
}

.Icons {
display: flex;
justify-content: center;
align-items: center;
.icon {
margin: 1em;
:hover {
box-shadow: 0px 4px 0px 0px hsla(27, 46%, 70%, 0.256);
}
}
}
.form:hover {
box-shadow: var(--shadow-4);
}
Expand Down
68 changes: 1 addition & 67 deletions client/src/assets/styles/large-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
.nav-link:hover {
background: var(--grey-50);
padding-left: 3rem;
color: var(--grey-900);
color: #ffa630;
}
.nav-link:hover .icon {
Expand All @@ -70,75 +69,10 @@
transition: var(--transition);
}
.active {
color: var(--grey-900);
color: #ffa630;
}
.active .icon {
color: var(--primary-500);
}
}
}

// .navbar {
// height: 100%;
// width: 0;
// position: fixed;
// top: 0;
// left: 1rem;
// padding-top: 1rem;
// }

// .navbar a {
// padding: 8px 8px 8px 32px;
// text-decoration: none;
// font-size: 18px;
// color: #0b4f6c;
// background-color: transparent;
// display: float;
// padding: 20px;
// }

// .navbar .title {
// font-size: 50px;
// color: #0b4f6c;
// font-family: 'Fredoka One', cursive;
// // font-family: 'Bebas Neue', cursive;
// }

// .navbar .links {
// margin: 1rem;
// padding: 0;
// list-style: none;
// position: fixed;
// }

// .navbar li {
// margin: 10px 0;
// border: 1px none #999;
// font-size: 40px;
// text-align: left;
// font-family: 'Fredoka One', cursive;
// // font-family: 'Bebas Neue', cursive;

// // border: solid #FFA630;
// // border-radius: 25px;
// }

// .navbar .active {
// background-color: #e1efe6;
// color: #ffa630;
// margin: 0;
// padding: 20px;
// border-radius: 15px;
// }

// .navbar a:hover {
// color: #ffa630;
// border-radius: 15px;
// padding: 20px;
// }

// .navbar .signout {
// bottom: 2rem;
// left: 2rem;
// position: fixed;
// }
13 changes: 8 additions & 5 deletions client/src/assets/styles/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
align-items: center;
justify-content: center;
box-shadow: 0 1px 0px 0px rgba(0, 0, 0, 0.1);
.logo {
display: flex;
align-items: center;
width: 100px;
}
// .logo {
// display: flex;
// align-items: center;
// width: 100px;
// }
.nav-center {
display: flex;
width: 90vw;
align-items: center;
justify-content: space-between;
.heading {
font-size: 1.5rem;
}
}
.toggle-btn {
background: transparent;
Expand Down
75 changes: 75 additions & 0 deletions client/src/assets/styles/search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.search-sort-container {
width: 100%;
display: grid;
grid-auto-flow: column;
justify-content: start;
}

.search-container {

}

.search-input {
display: block;
width: 400px;
margin-top: 10px;
margin-left: 10px;
padding: 10px 50px 10px 20px;
font-size: 14px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: gray;
border-radius: 50px;
border: 1px solid gray;
}

.sort-button {
display: grid;
padding: 12px 15px;
margin: 10px;
border-radius: 50px;
border: 1px solid gray;
color: var(--primary-600);
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 12px;
font-weight: bolder;
}

.sort-list {
padding: 5px;
padding-right: 30px;
background-color: white;
border: 1px solid gray;
border-radius: 5px;
font-size: 12px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
:hover {
color: #ffa630;
cursor: pointer;
}
}

.active {
color: #ffa630;
}

.search {
position: relative;

button {
position: absolute;
top:0px;
right:5px;
width: 40px;
height: 100%;
cursor: pointer;
background-color: transparent;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
border-radius: 20px;
border: 0;
}
}
79 changes: 79 additions & 0 deletions client/src/assets/styles/small-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,83 @@
@media (min-width: 992px) {
display: none;
}

.sidebar-container {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: -1;
opacity: 0;
transition: var(--transition);
}

.show-sidebar {
z-index: 99;
opacity: 1;
}

.content {
background: var(--white);
width: var(--fluid-width);
height: 95vh;
border-radius: var(--borderRadius);
padding: 3rem 2rem;
position: relative;
display: flex;
align-items: center;
flex-direction: column;
}

.close-btn {
position: absolute;
top: 10px;
left: 10px;
background: transparent;
border-color: transparent;
font-size: 2rem;
color: var(--red-dark);
cursor: pointer;
}

.nav-links {
padding-top: 2rem;
display: flex;
flex-direction: column;
}

.nav-link {
display: flex;
align-items: center;
color: var(--grey-500);
padding: 1rem 0;
text-transform: capitalize;
transition: var(--transition);
}

.nav-link:hover {
color: var(--grey-900);
}

.nav-link:hover .icon {
color: var(--primary-500);
}

.icon {
font-size: 1.5rem;
margin-right: 1rem;
display: grid;
place-items: center;
transition: var(--transition);
}

.active {
color: var(--grey-900);
}

.active .icon {
color: var(--primary-500);
}
}
4 changes: 2 additions & 2 deletions client/src/components/Logo.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import favicon from '../assets/images/logo.svg';
import logo from '../assets/images/logo.svg';

const Logo = () => {
return (
<div className='logo'>
<img src={favicon} alt='logo' />
<img src={logo} alt='logo' />
</div>
);
};
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const Navbar = () => {
<FaAlignLeft />
</button>
<div>
<Logo />
<h3>Subslify</h3>
<h3 className='heading'>Subslify</h3>
</div>

<div className='btn-container'>
Expand Down
38 changes: 38 additions & 0 deletions client/src/components/Search.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { useState } from 'react';
import '../assets/styles/search.scss';
import { useAppContext } from '../context/appContext';

const Search = (props) => {
const [search, setSearch] = useState({
value: ''
});

const { getSubscriptions } = useAppContext();

const handleSubmit = () => {
event.preventDefault();
getSubscriptions({type: props.type, sort: null, search: search.value})
};
const handleChange = event => {
setSearch({value: event.target.value});
};

return (
<div className='search-container'>
<form className='search' onSubmit={handleSubmit}>
<input
className='search-input'
type='text'
value={search.value}
placeholder='Search...'
onChange={handleChange}
/>
<button type='submit'>
<i className='fa-search'></i>
</button>
</form>
</div>
);
};

export default Search;
Loading