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

Social media login #19

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
700b727
Fix useEffect dependency warnings
oguzhanturgut Nov 25, 2019
f1cebba
Add nodemailer and mail sending after registration
oguzhanturgut Nov 25, 2019
6326a6b
some test
gulyener Nov 25, 2019
18a4941
Add email confirmation endpoint
oguzhanturgut Nov 25, 2019
136ef52
Change auth api and User model
oguzhanturgut Nov 25, 2019
df5633f
Change auth reducer and action creator
oguzhanturgut Nov 25, 2019
ab06972
Add CONFIRM_EMAIL type
oguzhanturgut Nov 25, 2019
164179f
Add Confirm and confirmEmail action creator
oguzhanturgut Nov 25, 2019
be1fa81
Change Register component
oguzhanturgut Nov 25, 2019
038a1ae
Add loginWithSocial action
gulyener Nov 26, 2019
4489edf
Refactor firebase calls
gulyener Nov 26, 2019
f8a5c16
Remove config
gulyener Nov 26, 2019
25c19ad
Add resending expired link
oguzhanturgut Nov 27, 2019
adae698
Changes after Q&A
gulyener Nov 28, 2019
cf36e5b
Register user in db with facebook
gulyener Nov 28, 2019
3dcdf83
finish ading adham code to oguzhan
Nov 28, 2019
6c34e93
fix auth send mail
Nov 28, 2019
24c4223
add config default
musafir928 Nov 28, 2019
daed73c
add adil work after adjustment , frontend
Nov 28, 2019
e230cda
Merge branch 'email-confirmation' of https://github.com/HackYourFutur…
musafir928 Nov 28, 2019
9e355c6
password reset issue (with invalid link) solved
musafir928 Nov 28, 2019
df59df8
adil : redirect authenticated user from password forms to dashborad
musafir928 Nov 28, 2019
fb3eead
solved namming issue
musafir928 Nov 28, 2019
72d78bf
adil: delete un neccessary consoles and comments
musafir928 Nov 28, 2019
fbf458d
add spinner to reset and send reset eamil components
musafir928 Nov 28, 2019
40fc66f
Change mail transport, bug fixes,refactor
oguzhanturgut Nov 29, 2019
5b07ce0
Merge branch 'email-confirmation' of https://github.com/HackYourFutur…
oguzhanturgut Nov 29, 2019
3daf0c0
add refactoring & save user in db
mejustdev Nov 29, 2019
230bebf
add social user model
mejustdev Nov 29, 2019
ae6a5c9
Fix PasswordReset component logic
oguzhanturgut Nov 29, 2019
22408a8
solve db bug
mejustdev Nov 29, 2019
aa8997a
add return
Nov 29, 2019
3500833
add loadSocialUser actionCreator
mejustdev Nov 30, 2019
1316db1
add jwt
mejustdev Nov 30, 2019
54c1e68
Add login & fix register issues
mejustdev Nov 30, 2019
a1e7348
Allow login with social after registering
gulyener Nov 30, 2019
e69c0eb
add GoogleAuth
mejustdev Nov 30, 2019
f0663fe
Combine facebook and google login in Login.js
gulyener Nov 30, 2019
7314bfc
did some garbage collection
Laurelinduilwen Nov 30, 2019
4402f73
create endpoints for sending, accepting, cancelling friend request. M…
salih18 Dec 2, 2019
dfce938
add default.josn to git ignore
Dec 3, 2019
6cdba8c
add input, searchFiels state and filter.
Dec 3, 2019
4e31ca5
render filteredProfiles
Dec 3, 2019
492eff2
add simple style to : input[type='search']
Dec 3, 2019
daeef7e
add Pagination component
mejustdev Dec 4, 2019
e802ca4
refactor for pagination
mejustdev Dec 4, 2019
bb2da92
fix searching issue
mejustdev Dec 4, 2019
dafca0d
added scoket io etc to friend request
salih18 Dec 4, 2019
92705f5
add active class for pagination
ShyarK Dec 4, 2019
ec1652d
set to the previous state
ShyarK Dec 4, 2019
e8dece4
Fix conflict
ShyarK Dec 4, 2019
513028d
delete console.log
Dec 4, 2019
7a24fe0
delete style link bootstrap
Dec 4, 2019
b3b12a0
add the style form bootstab in our css page
Dec 4, 2019
659947d
fix search and add css
ShyarK Dec 5, 2019
24d0ea9
fix search and add css
ShyarK Dec 5, 2019
6e29667
fixing bug and adding css style
ShyarK Dec 6, 2019
46c4d55
delete linl
ShyarK Dec 6, 2019
7972d0d
chat app and friend request combined
salih18 Dec 7, 2019
5823b04
add private route for FriendPosts
Dec 7, 2019
88aa3c6
Merge pull request #32 from HackYourFuture/combine-live-chat-friend-req
NoerGitKat Dec 7, 2019
ffb52ae
Merge branch 'email-confirmation' into development
Dec 7, 2019
948e9f1
Merge pull request #20 from HackYourFuture/email-confirmation
NoerGitKat Dec 7, 2019
850305b
Merge branch 'live-search' into development
Dec 8, 2019
3d67dd0
Merge pull request #33 from HackYourFuture/live-search
NoerGitKat Dec 8, 2019
6d16b3c
Register sw and add icon files
oguzhanturgut Dec 1, 2019
b0e1c00
Add serviceWorker boilerplate
oguzhanturgut Dec 1, 2019
49837a6
Change gravatar protocol to https
oguzhanturgut Dec 1, 2019
1f5e5d5
Add more fields to manifest.json
oguzhanturgut Dec 1, 2019
a5c2680
Add browser compatibility
oguzhanturgut Dec 2, 2019
6be1827
Hook sw to public folder & start prefetching
oguzhanturgut Dec 2, 2019
dbefdff
Add Dynamic Prefetching
oguzhanturgut Dec 2, 2019
bb75e46
Add cache versioning and cleanup old caches
oguzhanturgut Dec 2, 2019
3fea0aa
Add offline fallback page
oguzhanturgut Dec 2, 2019
1c03a60
Add cache trimming
oguzhanturgut Dec 2, 2019
374eead
Fix react-hooks/exhaustive-deps warnings
oguzhanturgut Dec 3, 2019
743d547
Deployment
oguzhanturgut Dec 3, 2019
0531958
refactor service worker
oguzhanturgut Dec 4, 2019
a1aaf89
Implement cache then network strategy
oguzhanturgut Dec 6, 2019
f669194
Fix syntax error
oguzhanturgut Dec 6, 2019
731e30f
response with static assets first
oguzhanturgut Dec 6, 2019
4421fac
fix mobile app start page issue
oguzhanturgut Dec 6, 2019
40868bc
fix start_url issue
oguzhanturgut Dec 6, 2019
227550f
Merge pull request #35 from HackYourFuture/pwa
NoerGitKat Dec 8, 2019
59b6b1b
Merge from development
musafir928 Dec 11, 2019
8035764
Fix package-lock.json
gulyener Dec 11, 2019
96ec0b0
change config
musafir928 Dec 11, 2019
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
client/node_modules/
config/production.json
client/debug.log
client/src/social-config/
client/package-lock.json
client/src/social-config/firebaseConfig.js
config/default.json
package-lock.json

Binary file added client/.DS_Store
Binary file not shown.
1,570 changes: 1,400 additions & 170 deletions client/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
"private": true,
"dependencies": {
"axios": "^0.18.1",
"firebase": "^7.5.0",
"moment": "^2.24.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-moment": "^0.9.2",
"react-redux": "^7.0.2",
"react-router-dom": "^5.0.0",
"react-scripts": "3.0.0",
"react-social-login-buttons": "^3.0.0",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"socket.io-client": "^2.3.0",
"uuid": "^3.3.2"
},
"scripts": {
Expand Down
Binary file added client/public/developer-icon-144.png
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/public/developer-icon-192.png
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/public/developer-icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/public/favicon.ico
Binary file not shown.
33 changes: 32 additions & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,48 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!-- Safari compatilibility -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Developer Hub" />
<link rel="apple-touch-icon" href="developer-icon-144.png" />
<!-- IE compatilibility -->
<meta name="msapplication-TileImage" content="developer-icon-144.png" />
<meta name="msapplication-TileColor" content="#fff" />
<meta name="theme-color" content="#3f51b5" />
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap-grid.min.css"
/>

<link
href="https://fonts.googleapis.com/css?family=Roboto:300,400,700&display=swap"
rel="stylesheet"
/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Welcome To DevConnector</title>
<title>Hack Your Social</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="text/javascript">
window.addEventListener('load', async event => {
if ('serviceWorker' in navigator) {
try {
await navigator.serviceWorker.register('./sw.js');
console.log('Service worker registered!');
} catch (error) {
console.error('Service worker failed!');
}
}
});
</script>
</body>
</html>
27 changes: 22 additions & 5 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Hack Your Social",
"name": "Hack Your Social",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "developer-icon-144.png",
"type": "image/png",
"sizes": "144x144"
},
{
"src": "developer-icon-192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "developer-icon-512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"start_url": "./index.html",
"scope": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"theme_color": "#3f51b5",
"background_color": "#ffffff",
"orientation": "portrait-primary"
}
32 changes: 32 additions & 0 deletions client/public/offline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!-- Safari compatilibility -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Developer Hub" />
<link rel="apple-touch-icon" href="developer-icon-144.png" />
<!-- IE compatilibility -->
<meta name="msapplication-TileImage" content="developer-icon-144.png" />
<meta name="msapplication-TileColor" content="#fff" />
<meta name="theme-color" content="#3f51b5" />
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
crossorigin="anonymous"
/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Hack Your Social</title>
</head>
<body>
<p className="lead"><i className="fas fa-error" /> We are not able to cache this page yet!</p>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="swReg.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions client/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
128 changes: 128 additions & 0 deletions client/public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/* eslint-disable no-restricted-globals */
const CACHE_VERSION = 1;
const CURRENT_CACHES = {
static: `static-v${CACHE_VERSION}`,
dynamic: `dynamic-v${CACHE_VERSION}`,
};
const STATIC_FILES = [
'/',
'/index.html',
'/offline.html',
'/static/media/showcase.4b31330b.jpg',
'/static/js/bundle.js',
'/static/js/0.chunk.js',
'/static/js/main.chunk.js',
'/static/js/main.chunk.js.map',
'/manifest.json',
'/developer-icon-144.png',
'/sw.js',
'/favicon.ico',
'https://use.fontawesome.com/releases/v5.8.1/css/all.css',
'https://use.fontawesome.com/releases/v5.8.1/webfonts/fa-solid-900.ttf',
'https://use.fontawesome.com/releases/v5.8.1/webfonts/fa-solid-900.woff',
'https://use.fontawesome.com/releases/v5.8.1/webfonts/fa-solid-900.woff2',
'https://use.fontawesome.com/releases/v5.8.1/webfonts/fa-brands-400.ttf',
'https://use.fontawesome.com/releases/v5.8.1/webfonts/fa-brands-400.woff',
'https://use.fontawesome.com/releases/v5.8.1/webfonts/fa-brands-400.woff2',
];

const trimCache = (cacheName, maxItems) => {
caches.open(cacheName).then(cache => {
return cache.keys().then(keys => {
if (keys.length > maxItems) {
cache.delete(keys[0]).then(trimCache(cacheName, maxItems));
}
});
});
};

self.addEventListener('install', event => {
console.log('[SW] Installing sw', event);

event.waitUntil(
caches.open(CURRENT_CACHES.static).then(cache => {
console.log('Pre-caching...');
// Static Precaching
cache.addAll(STATIC_FILES);
}),
);
});

self.addEventListener('activate', event => {
console.log('[SW] Activating sw', event);
event.waitUntil(
caches.keys().then(keys => {
// Deleting obsolete caches
return Promise.all(
keys
.filter(key => key !== CURRENT_CACHES.static && key !== CURRENT_CACHES.dynamic)
.map(key => {
return caches.delete(key);
}),
);
}),
);
return self.clients.claim();
});

const isStaticAsset = (requestUrl, array) => {
const cachePath =
requestUrl.indexOf(self.origin) === 0 ? requestUrl.substring(self.origin.length) : requestUrl;
return array.indexOf(cachePath) > -1;
};

const apis = [`${self.location.origin}/api/profile`];

// Cache then network with fallback & dynamic caching
self.addEventListener('fetch', event => {
if (apis.includes(event.request.url)) {
event.respondWith(
caches.open(CURRENT_CACHES.dynamic).then(cache => {
return fetch(event.request).then(response => {
const cloneResponse = response.clone();
trimCache(CURRENT_CACHES.dynamic, 30);
cache.put(event.request.url, cloneResponse);
return response;
});
}),
);
} else if (isStaticAsset(event.request.url, STATIC_FILES)) {
event.respondWith(caches.match(event.request));
} else {
event.respondWith(
caches.match(event.request).then(response => {
return (
response ||
// Dynamic Caching
fetch(event.request)
.then(response => {
return caches.open(CURRENT_CACHES.dynamic).then(cache => {
const cloneResponse = response.clone();
trimCache(CURRENT_CACHES.dynamic, 30);
cache.put(event.request.url, cloneResponse);
return response;
});
})
.catch(error => {
return caches.open(CURRENT_CACHES.static).then(cache => {
if (event.request.headers.get('accept').includes('text/html')) {
return cache.match('/offline.html');
}
});
})
);
}),
);
}
});

// Network with cache fallback
// self.addEventListener('fetch', event => {
// event.respondWith(fetch(event.request).catch(error => caches.match(event.request)));
// });

// Cache-only
// self.addEventListener('fetch', event => event.respondWith(caches.match(event.request)));

// Network-only
// self.addEventListener('fetch', event => event.respondWith(fetch(event.request)));
Loading