├── client ├── src │ ├── components │ │ ├── ajay │ │ │ └── .dummy │ │ ├── anjali │ │ │ ├── .dummy │ │ │ ├── socialconnect.module.css │ │ │ ├── Blog │ │ │ │ ├── part3.module.css │ │ │ │ ├── Part6.jsx │ │ │ │ ├── Part3.jsx │ │ │ │ ├── Part4.jsx │ │ │ │ ├── part4.module.css │ │ │ │ ├── Part1.jsx │ │ │ │ ├── part6.module.css │ │ │ │ ├── part1.module.css │ │ │ │ ├── part2.module.css │ │ │ │ ├── part5.module.css │ │ │ │ ├── Part2.jsx │ │ │ │ └── Part5.jsx │ │ │ ├── home.module.css │ │ │ ├── SocialConnect.jsx │ │ │ ├── HomeAna.jsx │ │ │ ├── analytics.module.css │ │ │ └── channel.module.css │ │ ├── prakash │ │ │ ├── .dummy │ │ │ ├── images │ │ │ │ ├── log1.jpg │ │ │ │ └── logo.jpg │ │ │ ├── Components │ │ │ │ ├── Navbar │ │ │ │ │ ├── navbar.css │ │ │ │ │ ├── Navbarcomponents │ │ │ │ │ │ ├── tools.css │ │ │ │ │ │ ├── Tools.jsx │ │ │ │ │ │ └── Chanels.jsx │ │ │ │ │ ├── NavbarLgModel.jsx │ │ │ │ │ ├── Navbar.jsx │ │ │ │ │ └── navbarbasemodel.jsx │ │ │ │ └── Footer │ │ │ │ │ └── Footer.jsx │ │ │ └── Pages │ │ │ │ └── Allroute.jsx │ │ ├── shubham │ │ │ ├── components │ │ │ │ ├── CustomerReview │ │ │ │ │ ├── CustomerReview.css │ │ │ │ │ └── CustomerReview.jsx │ │ │ │ ├── MainDash │ │ │ │ │ ├── MainDash.jsx │ │ │ │ │ └── MainDash.css │ │ │ │ ├── Cards │ │ │ │ │ ├── Cards.css │ │ │ │ │ └── Cards.jsx │ │ │ │ ├── Updates │ │ │ │ │ ├── Updates.css │ │ │ │ │ └── Updates.jsx │ │ │ │ ├── RigtSide │ │ │ │ │ ├── RightSide.jsx │ │ │ │ │ └── RightSide.css │ │ │ │ ├── Table │ │ │ │ │ ├── Table.css │ │ │ │ │ └── Table.jsx │ │ │ │ ├── Card │ │ │ │ │ ├── Card.css │ │ │ │ │ └── Card.jsx │ │ │ │ ├── Sidebar.css │ │ │ │ ├── Sidebar.jsx │ │ │ │ └── UserTable.jsx │ │ │ ├── imgs │ │ │ │ ├── img1.png │ │ │ │ ├── img2.png │ │ │ │ ├── img3.png │ │ │ │ ├── logo.png │ │ │ │ └── profile.png │ │ │ ├── Sliding_S.css │ │ │ ├── DatePicker.jsx │ │ │ ├── CardHover.jsx │ │ │ ├── fbhooks.js │ │ │ ├── Sliding_S.jsx │ │ │ ├── Data │ │ │ │ └── Data.js │ │ │ ├── fbPosts.js │ │ │ ├── InnerModal.jsx │ │ │ ├── SideBar.jsx │ │ │ └── AltNavbar.jsx │ │ └── sandeep │ │ │ ├── Recaptcha.jsx │ │ │ ├── firbase.js │ │ │ └── Recaptcha.css │ ├── redux │ │ ├── register │ │ │ ├── register.types.js │ │ │ ├── register.actions.js │ │ │ └── register.reducer.js │ │ ├── auth │ │ │ ├── auth.types.js │ │ │ ├── auth.actions.js │ │ │ └── auth.reducer.js │ │ ├── admin │ │ │ ├── admin.types.js │ │ │ ├── admin.actions.js │ │ │ └── admin.reducer.js │ │ ├── posts │ │ │ ├── post.types.js │ │ │ ├── post.action.js │ │ │ └── post.reducer.js │ │ └── store.js │ ├── pages │ │ ├── Register.css │ │ ├── SingleChannelPage.jsx │ │ ├── UserList.jsx │ │ ├── Home.css │ │ ├── Blog.jsx │ │ ├── Publishing.jsx │ │ ├── Admin.jsx │ │ ├── Admin.module.css │ │ ├── LinkedinPage.jsx │ │ ├── FacebookPage.jsx │ │ ├── InstagramPage.jsx │ │ ├── Register.jsx │ │ └── Login.jsx │ ├── setupTests.js │ ├── App.test.js │ ├── routes │ │ ├── PrivateRoute.jsx │ │ ├── AdminPrivateAuth.jsx │ │ ├── AdminDashRoutes.jsx │ │ ├── PublishingRoutes.jsx │ │ └── AllRoutes.jsx │ ├── index.css │ ├── reportWebVitals.js │ ├── App.css │ ├── App.js │ ├── index.js │ └── logo.svg ├── public │ ├── mail.gif │ ├── robots.txt │ ├── favicon.ico │ ├── publish.gif │ ├── Project_Name.png │ ├── scheduling.gif │ ├── Ecotone_small.png │ ├── manifest.json │ └── index.html ├── .env ├── .gitignore ├── package.json └── README.md ├── server ├── .gitignore ├── src │ ├── config │ │ ├── db.js │ │ ├── twitter.oauth.js │ │ ├── facebook-oauth.js │ │ └── google-oauth.js │ ├── middlewares │ │ └── imageUploader.js │ ├── routes │ │ ├── auth.js │ │ └── user.js │ ├── server.js │ ├── models │ │ ├── user.model.js │ │ └── post.model.js │ └── controllers │ │ └── auth.controller.js ├── package.json └── .env ├── .gitignore ├── Team.txt └── README.md /client/src/components/ajay/.dummy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/src/components/anjali/.dummy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/src/components/prakash/.dummy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.env -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local Netlify folder 2 | .netlify 3 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/CustomerReview/CustomerReview.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/public/mail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/public/mail.gif -------------------------------------------------------------------------------- /client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /client/.env: -------------------------------------------------------------------------------- 1 | REACT_APP_FB_APP_ID=673935781104319 2 | REACT_APP_FB_APP_SECRET=749bcfead39391d818172ae9a8cf398f -------------------------------------------------------------------------------- /client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/public/favicon.ico -------------------------------------------------------------------------------- /client/public/publish.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/public/publish.gif -------------------------------------------------------------------------------- /client/public/Project_Name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/public/Project_Name.png -------------------------------------------------------------------------------- /client/public/scheduling.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/public/scheduling.gif -------------------------------------------------------------------------------- /client/public/Ecotone_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/public/Ecotone_small.png -------------------------------------------------------------------------------- /client/src/components/prakash/images/log1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/prakash/images/log1.jpg -------------------------------------------------------------------------------- /client/src/components/prakash/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/prakash/images/logo.jpg -------------------------------------------------------------------------------- /client/src/components/shubham/imgs/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/shubham/imgs/img1.png -------------------------------------------------------------------------------- /client/src/components/shubham/imgs/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/shubham/imgs/img2.png -------------------------------------------------------------------------------- /client/src/components/shubham/imgs/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/shubham/imgs/img3.png -------------------------------------------------------------------------------- /client/src/components/shubham/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/shubham/imgs/logo.png -------------------------------------------------------------------------------- /client/src/components/shubham/imgs/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gShubham7/Buffer-clone/HEAD/client/src/components/shubham/imgs/profile.png -------------------------------------------------------------------------------- /server/src/config/db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const connect = async () => { 4 | return mongoose.connect(process.env.DB_URL); 5 | }; 6 | 7 | module.exports = connect; 8 | -------------------------------------------------------------------------------- /client/src/redux/register/register.types.js: -------------------------------------------------------------------------------- 1 | export const REGISTER_REQUEST = "register/request"; 2 | export const REGISTER_SUCCESS = "register/success"; 3 | export const REGISTER_ERROR = "register/error"; -------------------------------------------------------------------------------- /client/src/components/prakash/Components/Navbar/navbar.css: -------------------------------------------------------------------------------- 1 | .loginbtn:hover { 2 | text-decoration: underline; 3 | } 4 | 5 | .nav { 6 | width: 100%; 7 | position: fixed; 8 | top: 0; 9 | z-index: 20; 10 | } 11 | -------------------------------------------------------------------------------- /client/src/pages/Register.css: -------------------------------------------------------------------------------- 1 | .display{ 2 | color: rgb(82, 81, 81); 3 | gap: 40px; 4 | font-weight: 500; 5 | font-size: 14.5px; 6 | } 7 | .display span{ 8 | color: blue; 9 | cursor: pointer; 10 | } -------------------------------------------------------------------------------- /client/src/redux/auth/auth.types.js: -------------------------------------------------------------------------------- 1 | export const LOGIN_REQUEST = "auth/login/request"; 2 | export const LOGIN_SUCCESS = "auth/login/success"; 3 | export const LOGIN_ERROR = "auth/login/error"; 4 | export const LOGOUT = "auth/logout"; 5 | 6 | -------------------------------------------------------------------------------- /client/src/components/shubham/Sliding_S.css: -------------------------------------------------------------------------------- 1 | .inner-carousel { 2 | display: flex; 3 | border: 2px orange dotted; 4 | gap: 10px; 5 | overflow: hidden; 6 | padding: 10rem 0; 7 | } 8 | .carousel { 9 | overflow: hidden; 10 | } 11 | -------------------------------------------------------------------------------- /client/src/components/anjali/socialconnect.module.css: -------------------------------------------------------------------------------- 1 | .connect { 2 | margin: auto; 3 | text-align: center; 4 | justify-content: center; 5 | margin-top: 40px; 6 | } 7 | .social { 8 | margin: auto; 9 | width: 600px; 10 | } -------------------------------------------------------------------------------- /Team.txt: -------------------------------------------------------------------------------- 1 | Project Code - gas-shock-1560 2 | Website - https://buffer.com 3 | 4 | fw20_0193 - Shubham Gaikwad 5 | fp02_050 - Sandeep Gond 6 | fp05_227 - Prakash Rajesh Singh 7 | fw16_022 - Anjali Nilkanth Dhanjode 8 | fw18_0661 - Ajay Jha 9 | 10 | IA - Aakash -------------------------------------------------------------------------------- /client/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /client/src/pages/SingleChannelPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useParams } from "react-router-dom"; 3 | 4 | const SingleChannelPage = () => { 5 | const { ChName } = useParams(); 6 | return
{ChName}
; 7 | }; 8 | 9 | export default SingleChannelPage; 10 | -------------------------------------------------------------------------------- /client/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /client/src/components/prakash/Pages/Allroute.jsx: -------------------------------------------------------------------------------- 1 | import {Routes, Route} from "react-router-dom" 2 | import Home from "./Home/home" 3 | 4 | function Allroutes(){ 5 | return ( 6 | 7 | }> 8 | 9 | ) 10 | } 11 | 12 | export default Allroutes; -------------------------------------------------------------------------------- /client/src/components/shubham/components/MainDash/MainDash.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Cards from "../Cards/Cards"; 3 | import Table from "../Table/Table"; 4 | import "./MainDash.css"; 5 | const MainDash = () => { 6 | return ( 7 |
8 |

Dashboard

9 | 10 | 11 | 12 | ); 13 | }; 14 | 15 | export default MainDash; 16 | -------------------------------------------------------------------------------- /client/src/routes/PrivateRoute.jsx: -------------------------------------------------------------------------------- 1 | import { useSelector } from "react-redux"; 2 | import { Navigate } from "react-router-dom"; 3 | 4 | function PrivateRoute({ children }) { 5 | const { isAuth } = useSelector((store) => store.auth); 6 | if (!isAuth) { 7 | return alert("You Need To Login First"), (); 8 | } 9 | 10 | return children; 11 | } 12 | 13 | export default PrivateRoute; 14 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Cards/Cards.css: -------------------------------------------------------------------------------- 1 | .Cards { 2 | display: flex; 3 | gap: 10px; 4 | } 5 | .parentContainer { 6 | width: 100%; 7 | } 8 | 9 | @media screen and (max-width: 1200px) { 10 | .Cards { 11 | flex-direction: column; 12 | } 13 | .parentContainer { 14 | height: 9rem; 15 | } 16 | } 17 | 18 | @media screen and (max-width: 768px) { 19 | .Cards { 20 | width: 90%; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | -------------------------------------------------------------------------------- /client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /client/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/part3.module.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .flex { 4 | display: flex; 5 | gap: 15px; 6 | justify-content: center; 7 | margin-top: 20px; 8 | } 9 | 10 | /* @media all and (min-width: 851px) and (max-width: 1024px){ 11 | 12 | } */ 13 | 14 | @media all and (min-width: 250px) and (max-width: 851px){ 15 | .flex { 16 | margin: auto; 17 | flex-direction: column; 18 | } 19 | } -------------------------------------------------------------------------------- /client/src/pages/UserList.jsx: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import React, { useEffect } from "react"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import StickyHeadTable from "../components/shubham/components/UserTable"; 5 | 6 | const UserList = () => { 7 | return ( 8 |
9 | 10 |
11 | ); 12 | }; 13 | 14 | export default UserList; 15 | -------------------------------------------------------------------------------- /client/src/routes/AdminPrivateAuth.jsx: -------------------------------------------------------------------------------- 1 | import { useSelector } from "react-redux"; 2 | import { Navigate } from "react-router-dom"; 3 | 4 | function AdminPrivateAuth({ children }) { 5 | const { AdminIsAuth } = useSelector((store) => store.auth); 6 | console.log(AdminIsAuth); 7 | if (!AdminIsAuth) { 8 | return ( 9 | alert("You are redirected for security reason"), () 10 | ); 11 | } 12 | 13 | return children; 14 | } 15 | 16 | export default AdminPrivateAuth; 17 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Updates/Updates.css: -------------------------------------------------------------------------------- 1 | .Updates { 2 | width: 85%; 3 | background: white; 4 | border-radius: 0.7rem; 5 | padding: 1rem; 6 | gap: 1rem; 7 | display: flex; 8 | flex-direction: column; 9 | font-size: 13px; 10 | text-align: left; 11 | } 12 | 13 | .update { 14 | display: flex; 15 | gap: 0.5rem; 16 | } 17 | 18 | .update > img { 19 | width: 3.2rem; 20 | height: 3.2rem; 21 | } 22 | 23 | .noti > div > span:nth-of-type(1) { 24 | font-weight: bold; 25 | } 26 | -------------------------------------------------------------------------------- /client/src/pages/Home.css: -------------------------------------------------------------------------------- 1 | .movingDivBox{ 2 | width: 99vw; 3 | overflow: hidden; 4 | } 5 | 6 | .movingDiv{ 7 | /* pointer-events: none; */ 8 | position: absolute; 9 | width: calc(300px*10); 10 | animation: scroll 70s linear infinite; 11 | margin-top: 70px; 12 | } 13 | 14 | .movingDiv:hover{ 15 | animation: scroll 0s linear infinite; 16 | } 17 | @keyframes scroll{ 18 | 0%{ 19 | transform: translateX(0); 20 | } 21 | 100%{ 22 | transform: translateX(calc(-300px*5)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /client/src/components/prakash/Components/Navbar/Navbarcomponents/tools.css: -------------------------------------------------------------------------------- 1 | .btn{ 2 | position: relative; 3 | font-family: 'Roboto', sans-serif; 4 | font-weight: 500; 5 | } 6 | .btn::after{ 7 | position: absolute; 8 | bottom:0; 9 | left:50%; 10 | content: ""; 11 | width: 0px; 12 | transition: all 0.2s ease; 13 | height: 2px; 14 | background-color: blue; 15 | } 16 | .btn:hover:after{ 17 | width: 10px; 18 | left: 45%; 19 | } 20 | .btn:hover{ 21 | color:rgb(61, 89, 255); 22 | cursor: pointer; 23 | } -------------------------------------------------------------------------------- /server/src/middlewares/imageUploader.js: -------------------------------------------------------------------------------- 1 | const multer = require("multer"); 2 | const cloudinary = require("cloudinary").v2; 3 | 4 | const { CLOUD_NAME, API_KEY, API_SECRET } = process.env; 5 | 6 | cloudinary.config({ 7 | cloud_name: CLOUD_NAME, 8 | api_key: API_KEY, 9 | api_secret: API_SECRET, 10 | }); 11 | 12 | const storage = multer.diskStorage({ 13 | filename: function (req, file, cb) { 14 | cb(null, file.originalname); 15 | }, 16 | }); 17 | 18 | const upload = multer({ storage: storage }); 19 | 20 | module.exports = upload; 21 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/MainDash/MainDash.css: -------------------------------------------------------------------------------- 1 | .MainDash { 2 | /* padding-top: 1rem; */ 3 | display: flex; 4 | flex-direction: column; 5 | justify-content: space-evenly; 6 | } 7 | 8 | .MainDash > h1 { 9 | font-size: 30px; 10 | font-weight: bold; 11 | text-align: left; 12 | } 13 | 14 | @media screen and (max-width: 1200px) { 15 | .MainDash { 16 | justify-content: flex-start; 17 | margin-top: 2rem; 18 | } 19 | } 20 | 21 | @media screen and (max-width: 768px) { 22 | .MainDash { 23 | align-items: center; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/RigtSide/RightSide.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import CustomerReview from "../CustomerReview/CustomerReview"; 3 | import Updates from "../Updates/Updates"; 4 | import "./RightSide.css"; 5 | 6 | const RightSide = () => { 7 | return ( 8 |
9 |
10 |

Ecotone Team

11 | 12 |
13 |
14 |

Customer Review

15 | 16 |
17 |
18 | ); 19 | }; 20 | 21 | export default RightSide; 22 | -------------------------------------------------------------------------------- /client/src/redux/admin/admin.types.js: -------------------------------------------------------------------------------- 1 | export const GET_USER_REQUEST = "get/user/request"; 2 | export const GET_USER_SUCCESS = "get/user/success"; 3 | export const GET_USER_FAILURE = "get/user/failure"; 4 | 5 | export const CREATE_USER_REQUEST = "create/user/request"; 6 | export const CREATE_USER_SUCCESS = "create/user/success"; 7 | export const CREATE_USER_FAILURE = "create/user/failure"; 8 | 9 | export const DELETE_USER_REQUEST = "delete/user/request"; 10 | export const DELETE_USER_SUCCESS = "delete/user/success"; 11 | export const DELETE_USER_FAILURE = "delete/user/failure"; 12 | -------------------------------------------------------------------------------- /server/src/routes/auth.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const Router = express.Router(); 3 | const GoogleAuth = require("../config/google-oauth"); 4 | const FacebookAuth = require("../config/facebook-oauth"); 5 | const TwitterAuth = require("../config/twitter.oauth"); 6 | const { register, login } = require("../controllers/auth.controller"); 7 | 8 | Router.use("/google", GoogleAuth); 9 | Router.use("/facebook", FacebookAuth); 10 | Router.use("/twitter", TwitterAuth); 11 | Router.use("/register", register); 12 | Router.use("/login", login); 13 | 14 | module.exports = Router; 15 | -------------------------------------------------------------------------------- /client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /client/src/components/shubham/DatePicker.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import DatePicker from "react-datepicker"; 3 | import "react-datepicker/dist/react-datepicker.css"; 4 | 5 | export const Schedule_Date = () => { 6 | const [startDate, setStartDate] = useState(new Date()); 7 | 8 | let handleColor = (time) => { 9 | return time.getHours() > 12 ? "text-success" : "text-error"; 10 | }; 11 | 12 | return ( 13 | setStartDate(date)} 17 | timeClassName={handleColor} 18 | dateFormat="Pp" 19 | /> 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /client/src/pages/Blog.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Part1 } from '../components/anjali/Blog/Part1' 3 | import { Part2 } from '../components/anjali/Blog/Part2' 4 | import { Part3 } from '../components/anjali/Blog/Part3' 5 | import { Part4 } from '../components/anjali/Blog/Part4' 6 | import { Part5 } from '../components/anjali/Blog/Part5' 7 | import { Part6 } from '../components/anjali/Blog/Part6' 8 | 9 | export const Blog = () => { 10 | return ( 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /client/src/redux/register/register.actions.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { 3 | REGISTER_ERROR, 4 | REGISTER_REQUEST, 5 | REGISTER_SUCCESS, 6 | } from "./register.types"; 7 | 8 | export const registerUser = (creds) => async (dispatch) => { 9 | console.log(creds); 10 | dispatch({ type: REGISTER_REQUEST }); 11 | try { 12 | let res = await axios.post( 13 | "https://mauve-rabbit-gown.cyclic.app/auth/register", 14 | creds 15 | ); 16 | dispatch({ type: REGISTER_SUCCESS, payload: res.data }); 17 | return res.data; 18 | } catch (error) { 19 | dispatch({ type: REGISTER_ERROR, payload: error.message }); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/RigtSide/RightSide.css: -------------------------------------------------------------------------------- 1 | .RightSide { 2 | display: flex; 3 | flex-direction: column; 4 | /* padding-top: 1rem; */ 5 | width: 95%; 6 | justify-content: space-evenly; 7 | } 8 | 9 | .RightSide h3 { 10 | font-weight: bold; 11 | text-align: left; 12 | } 13 | @media screen and (max-width: 1200px) { 14 | .RightSide { 15 | justify-content: flex-start; 16 | margin-top: 3rem; 17 | } 18 | } 19 | 20 | @media screen and (max-width: 768px) { 21 | .RightSide { 22 | width: 100%; 23 | margin-top: 0; 24 | } 25 | .RightSide > div { 26 | display: flex; 27 | flex-direction: column; 28 | align-items: center; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /client/src/redux/auth/auth.actions.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { 3 | LOGIN_ERROR, 4 | LOGIN_REQUEST, 5 | LOGIN_SUCCESS, 6 | LOGOUT, 7 | } from "./auth.types"; 8 | 9 | export const login = (creds) => async (dispatch) => { 10 | dispatch({ type: LOGIN_REQUEST }); 11 | try { 12 | let res = await axios.post("https://mauve-rabbit-gown.cyclic.app/auth/login", creds); 13 | localStorage.setItem("email", creds.email); 14 | dispatch({ type: LOGIN_SUCCESS, payload: res.data }); 15 | return res.data; 16 | } catch (error) { 17 | dispatch({ type: LOGIN_ERROR, payload: error.message }); 18 | } 19 | }; 20 | 21 | export const ActionLogout = () => ({ type: LOGOUT }); 22 | -------------------------------------------------------------------------------- /server/src/server.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | 3 | const express = require("express"); 4 | const connect = require("./config/db"); 5 | const cors = require("cors"); 6 | const userRoute = require("./routes/user"); 7 | const authRoute = require("./routes/auth"); 8 | 9 | const PORT = process.env.PORT; 10 | 11 | const app = express(); 12 | 13 | app.use(express.urlencoded({ extended: true })); 14 | app.use(express.json()); 15 | app.use(cors()); 16 | 17 | app.use("/user", userRoute); 18 | app.use("/auth", authRoute); 19 | 20 | app.get("/", (req, res) => { 21 | res.send("Hello!"); 22 | }); 23 | 24 | app.listen(PORT, async () => { 25 | await connect(); 26 | console.log(`Server listening on http://localhost:${PORT}`); 27 | }); 28 | -------------------------------------------------------------------------------- /client/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /client/src/components/prakash/Components/Navbar/NavbarLgModel.jsx: -------------------------------------------------------------------------------- 1 | import { Flex, Text } from "@chakra-ui/react"; 2 | import Tools from "./Navbarcomponents/Tools" 3 | import Chanels from "./Navbarcomponents/Chanels"; 4 | import { NavLink } from "react-router-dom"; 5 | 6 | 7 | 8 | 9 | function NavbarLgModel(){ 10 | 11 | return ( 12 | 13 | 14 | 15 | Pricing 16 | Blog 17 | 18 | ) 19 | } 20 | 21 | export default NavbarLgModel; -------------------------------------------------------------------------------- /client/src/redux/posts/post.types.js: -------------------------------------------------------------------------------- 1 | export const GET_POST_REQUEST = "get/post/request"; 2 | export const GET_POST_SUCCESS = "get/post/success"; 3 | export const GET_POST_FAILURE = "get/post/failure"; 4 | 5 | export const CREATE_POST_REQUEST = "create/post/request"; 6 | export const CREATE_POST_SUCCESS = "create/post/success"; 7 | export const CREATE_POST_FAILURE = "create/post/failure"; 8 | 9 | export const UPDATE_POST_REQUEST = "update/post/request"; 10 | export const UPDATE_POST_SUCCESS = "update/post/success"; 11 | export const UPDATE_POST_FAILURE = "update/post/failure"; 12 | 13 | export const DELETE_POST_REQUEST = "delete/post/request"; 14 | export const DELETE_POST_SUCCESS = "delete/post/success"; 15 | export const DELETE_POST_FAILURE = "delete/post/failure"; 16 | -------------------------------------------------------------------------------- /client/src/App.js: -------------------------------------------------------------------------------- 1 | import "./App.css"; 2 | import Admin from "./pages/Admin"; 3 | import AllRoutes from "./routes/AllRoutes"; 4 | import { ChakraProvider } from "@chakra-ui/react"; 5 | import { Route, Routes } from "react-router-dom"; 6 | import AdminPrivateAuth from "./routes/AdminPrivateAuth"; 7 | 8 | function App() { 9 | return ( 10 |
11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | } 23 | > 24 | 25 |
26 | ); 27 | } 28 | 29 | export default App; 30 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Cards/Cards.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./Cards.css"; 3 | import { cardsData } from "../../Data/Data"; 4 | 5 | import Card from "../Card/Card"; 6 | 7 | const Cards = () => { 8 | return ( 9 |
10 | {cardsData.map((card, id) => { 11 | return ( 12 |
13 | 21 |
22 | ); 23 | })} 24 |
25 | ); 26 | }; 27 | 28 | export default Cards; 29 | -------------------------------------------------------------------------------- /client/src/redux/store.js: -------------------------------------------------------------------------------- 1 | import { 2 | legacy_createStore, 3 | combineReducers, 4 | applyMiddleware, 5 | compose, 6 | } from "redux"; 7 | import thunk from "redux-thunk"; 8 | import { authReducer } from "./auth/auth.reducer"; 9 | import { registerReducer } from "./register/register.reducer"; 10 | import { postReducer } from "./posts/post.reducer"; 11 | import { adminReducer } from "./admin/admin.reducer"; 12 | 13 | const rootReducer = combineReducers({ 14 | register: registerReducer, 15 | auth: authReducer, 16 | posts: postReducer, 17 | admin: adminReducer 18 | }); 19 | 20 | const createComposer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; 21 | export const store = legacy_createStore( 22 | rootReducer, 23 | createComposer(applyMiddleware(thunk)) 24 | ); 25 | -------------------------------------------------------------------------------- /client/src/components/anjali/home.module.css: -------------------------------------------------------------------------------- 1 | .totals { 2 | margin: auto; 3 | width: 90%; 4 | height: 60vh; 5 | border: 1px solid gray; 6 | border-radius: 10px; 7 | margin-top: 40px; 8 | padding: 20px; 9 | box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; 10 | position: relative; 11 | } 12 | .head { 13 | margin-left: 50px; 14 | 15 | } 16 | .plus { 17 | font-size: 20px; 18 | position: absolute; 19 | top: 20px ; 20 | right: 20px; 21 | /* top: 140px; 22 | left:1200px; */ 23 | /* border: 1px solid black ; */ 24 | /* padding: 0 10px; */ 25 | width: 35px; 26 | height: 35px; 27 | display: flex; 28 | align-items: center; 29 | justify-content: center; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "nodemon src/server.js" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "bcrypt": "^5.1.0", 14 | "cloudinary": "^1.32.0", 15 | "cors": "^2.8.5", 16 | "express": "^4.18.2", 17 | "express-session": "^1.17.3", 18 | "jsonwebtoken": "^8.5.1", 19 | "mongoose": "^6.8.0", 20 | "multer": "^1.4.5-lts.1", 21 | "passport": "^0.6.0", 22 | "passport-facebook": "^3.0.0", 23 | "passport-google-oauth2": "^0.2.0", 24 | "passport-twitter": "^1.0.4" 25 | }, 26 | "devDependencies": { 27 | "dotenv": "^16.0.3", 28 | "nodemon": "^2.0.20" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/Part6.jsx: -------------------------------------------------------------------------------- 1 | import { Flex,Button } from '@chakra-ui/react' 2 | import React from 'react' 3 | import style from "./part6.module.css" 4 | import {CheckIcon} from "@chakra-ui/icons"; 5 | 6 | export const Part6 = () => { 7 | return ( 8 |
9 |
10 |

Join 140,000+ small businesses like yours that use Buffer to build their brand on social media every month

11 | 12 |
13 |

No credit card required

14 |

Cancel anytime

15 |
16 |
17 |
18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Updates/Updates.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./Updates.css"; 3 | import { UpdatesData } from "../../Data/Data"; 4 | 5 | const Updates = () => { 6 | return ( 7 |
8 | {UpdatesData.map((update) => { 9 | return ( 10 |
11 | {/* profile */} 12 |
13 |
14 | {update.name} 15 | {update.noti} 16 |
17 | {update.time} 18 |
19 |
20 | ); 21 | })} 22 |
23 | ); 24 | }; 25 | 26 | export default Updates; 27 | -------------------------------------------------------------------------------- /client/src/pages/Publishing.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import AltNavbar from "../components/shubham/AltNavbar"; 3 | import SideBar from "../components/shubham/SideBar"; 4 | import { Box, Flex, Image } from "@chakra-ui/react"; 5 | import CalendarComponent from "../components/shubham/Calendar"; 6 | import { useDispatch, useSelector } from "react-redux"; 7 | import { getPosts } from "../redux/posts/post.action"; 8 | import { Navigate } from "react-router-dom"; 9 | import axios from "axios"; 10 | import PublishingRoutes from "../routes/PublishingRoutes"; 11 | import FacebookPage from "./FacebookPage"; 12 | 13 | export const Publishing = () => { 14 | const { isAuth } = useSelector((store) => store.auth); 15 | 16 | return ( 17 |
18 | 19 |
20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /client/src/components/anjali/SocialConnect.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Heading,Text,Button } from '@chakra-ui/react' 3 | import style from "./socialconnect.module.css"; 4 | 5 | export const SocialConnect = () => { 6 | return ( 7 |
8 |
9 | 10 |
11 |
12 | Connect your Social Page 13 | Connect your Facebook Page to get insights on your posts, audience growth, reach, engagement and more! 14 | 15 |
16 |
17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /client/src/components/sandeep/Recaptcha.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./Recaptcha.css"; 3 | 4 | const Recaptcha = () => { 5 | return ( 6 |
7 |
8 | 17 |
18 |
I'm not a robot
19 |
20 | 21 |

Privacy - Terms

22 |
23 |
24 | ); 25 | }; 26 | 27 | export default Recaptcha; 28 | -------------------------------------------------------------------------------- /client/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import "./index.css"; 4 | import App from "./App"; 5 | import reportWebVitals from "./reportWebVitals"; 6 | import { BrowserRouter } from "react-router-dom"; 7 | import { Provider } from "react-redux"; 8 | import { store } from "./redux/store"; 9 | 10 | const root = ReactDOM.createRoot(document.getElementById("root")); 11 | root.render( 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ); 20 | 21 | // If you want to start measuring performance in your app, pass a function 22 | // to log results (for example: reportWebVitals(console.log)) 23 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 24 | reportWebVitals(); 25 | -------------------------------------------------------------------------------- /client/src/pages/Admin.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styles from "./Admin.module.css"; 3 | import MainDash from "../components/shubham/components/MainDash/MainDash"; 4 | import RightSide from "../components/shubham/components/RigtSide/RightSide"; 5 | import Sidebar from "../components/shubham/components/Sidebar"; 6 | import { style } from "@mui/system"; 7 | import UserList from "./UserList"; 8 | import { Route, Routes } from "react-router-dom"; 9 | 10 | const Admin = () => { 11 | return ( 12 | <> 13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 |
22 | 23 | 24 | ); 25 | }; 26 | 27 | export default Admin; 28 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Table/Table.css: -------------------------------------------------------------------------------- 1 | .MuiTableRow-root > * { 2 | padding: 10px; 3 | } 4 | 5 | .MuiTableRow-root.MuiTableRow-head > * { 6 | font-weight: bold !important; 7 | } 8 | 9 | .Table > h3 { 10 | font-weight: bold; 11 | margin-bottom: 5px; 12 | } 13 | 14 | .Table td, 15 | th { 16 | border: none !important; 17 | } 18 | 19 | .Table:first-child { 20 | border-radius: 0.7rem !important; 21 | } 22 | .status { 23 | padding: 8px; 24 | border-radius: 9px; 25 | } 26 | 27 | .Details { 28 | color: #00b5ff !important; 29 | } 30 | 31 | @media screen and (max-width: 1200px) { 32 | .Table { 33 | width: 170%; 34 | margin-top: 2rem; 35 | } 36 | } 37 | 38 | @media screen and (max-width: 768px) { 39 | .Table { 40 | position: relative; 41 | display: flex; 42 | flex-direction: column; 43 | align-items: center; 44 | width: 23rem; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/Part3.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Flex, Heading, Button, Text, Input } from '@chakra-ui/react' 3 | import style from "./part3.module.css"; 4 | 5 | export const Part3 = () => { 6 | return ( 7 |
12 | Subscribe to our newsletter 13 | We’ll keep you in the loop on our best advice and strategies for social media marketing and growing a small business. 14 | 15 |
16 | 17 | 18 |
19 |
20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/Part4.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import style from "./part4.module.css"; 3 | import { Text,Button } from '@chakra-ui/react'; 4 | 5 | export const Part4 = () => { 6 | return ( 7 |
8 |
9 |
10 | 11 |
12 |
13 |

Small Business, Big Lessons is a podcast from Buffer that goes behind the scenes with inspirational small businesses who are truly driving innovation and redefining how work happens.

14 | 15 | 16 |
17 | 18 |
19 |
20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /client/src/routes/AdminDashRoutes.jsx: -------------------------------------------------------------------------------- 1 | // import React from "react"; 2 | // import { Route, Routes, useLocation } from "react-router-dom"; 3 | // import MainDash from "../components/shubham/components/MainDash/MainDash"; 4 | // import Sidebar from "../components/shubham/components/Sidebar"; 5 | 6 | // const AdminDashRoutes = () => { 7 | // const location = useLocation(); 8 | 9 | // if ( 10 | // location.pathname === "/admin" || 11 | // location.pathname === "/admin/customers" || 12 | // location.pathname === "/admin/orders" || 13 | // location.pathname === "/admin/products" 14 | // ) { 15 | // return ( 16 | // <> 17 | // <> 18 | // 19 | // 20 | // <> 21 | // 22 | // }> 23 | // 24 | // 25 | // 26 | // ); 27 | // } 28 | // }; 29 | 30 | // export default AdminDashRoutes; 31 | -------------------------------------------------------------------------------- /client/src/components/shubham/CardHover.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | Card, 4 | CardHeader, 5 | CardBody, 6 | CardFooter, 7 | Image, 8 | Stack, 9 | Heading, 10 | Text, 11 | } from "@chakra-ui/react"; 12 | 13 | const CardHover = ({ content }) => { 14 | console.log(content); 15 | return ( 16 | 21 | 27 | 28 | 29 | 30 | Post 31 | 32 | {content} 33 | 34 | 35 | 36 | 37 | ); 38 | }; 39 | 40 | export default CardHover; 41 | -------------------------------------------------------------------------------- /client/src/redux/register/register.reducer.js: -------------------------------------------------------------------------------- 1 | import { 2 | REGISTER_REQUEST, 3 | REGISTER_SUCCESS, 4 | REGISTER_ERROR, 5 | } from "./register.types"; 6 | 7 | const initialState = { 8 | isRegistered: false, 9 | loading: false, 10 | error: false, 11 | }; 12 | export const registerReducer = (state = initialState, { type, payload }) => { 13 | switch (type) { 14 | case REGISTER_REQUEST: { 15 | return { 16 | ...state, 17 | loading: true, 18 | error: false, 19 | }; 20 | } 21 | case REGISTER_SUCCESS: { 22 | return { 23 | ...state, 24 | isRegistered: true, 25 | successMessage: payload, 26 | loading: false, 27 | error: false, 28 | }; 29 | } 30 | case REGISTER_ERROR: { 31 | return { 32 | ...state, 33 | loading: false, 34 | error: true, 35 | errorMessage:payload 36 | }; 37 | } 38 | default: { 39 | return state; 40 | } 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/part4.module.css: -------------------------------------------------------------------------------- 1 | .Part4 { 2 | margin: auto; 3 | width: 100%; 4 | margin-top: 40px; 5 | text-align: left; 6 | background-color: #6b88ff; 7 | padding: 40px; 8 | 9 | } 10 | .flex { 11 | margin: auto; 12 | width: 80%; 13 | display: flex; 14 | gap: 40px; 15 | /* flex-wrap: wrap; */ 16 | 17 | } 18 | /* .left > img { 19 | height: 600px; 20 | width: 600px; 21 | } */ 22 | 23 | .right { 24 | margin: auto; 25 | } 26 | .text { 27 | font-size: 30px; 28 | font-weight: bold; 29 | color: white; 30 | } 31 | 32 | 33 | 34 | @media all and (min-width: 851px) and (max-width: 1024px){ 35 | 36 | 37 | .text { 38 | font-size: 20px; 39 | } 40 | 41 | } 42 | 43 | @media all and (min-width: 250px) and (max-width: 851px){ 44 | 45 | .flex { 46 | 47 | flex-direction: column; 48 | 49 | } 50 | 51 | .text { 52 | font-size: 20px; 53 | } 54 | /* 55 | .left > img { 56 | height: 100%; 57 | 58 | } */ 59 | } -------------------------------------------------------------------------------- /client/src/components/sandeep/firbase.js: -------------------------------------------------------------------------------- 1 | // import { initializeApp } from "firebase/app"; 2 | // import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth"; 3 | 4 | // const firebaseConfig = { 5 | // apiKey: "AIzaSyDy8SVYihK61wrz4wuUKItlxqf33DRmjEA", 6 | // authDomain: "auth-a00a9.firebaseapp.com", 7 | // projectId: "auth-a00a9", 8 | // storageBucket: "auth-a00a9.appspot.com", 9 | // messagingSenderId: "986357724766", 10 | // appId: "1:986357724766:web:1dd85e39262597fcaf26cf", 11 | // }; 12 | 13 | // const app = initializeApp(firebaseConfig); 14 | // export const auth = getAuth(app); 15 | // const provider = new GoogleAuthProvider(); 16 | 17 | // export const signInWithGoogle = () => { 18 | // signInWithPopup(auth, provider) 19 | // .then((res) => { 20 | // console.log(res); 21 | // const user = { 22 | // name: res.user.displayName, 23 | // profilePic: res.user.photoURL, 24 | // }; 25 | // localStorage.setItem("user", JSON.stringify(user)); 26 | // }) 27 | // .catch((error) => { 28 | // console.log(error); 29 | // }); 30 | // }; 31 | -------------------------------------------------------------------------------- /server/.env: -------------------------------------------------------------------------------- 1 | PORT = 8080 2 | DB_URL = mongodb://127.0.0.1:27017/blogapp 3 | JWT_SECRET = SECRET1234 4 | SALT_ROUNDS = 10 5 | 6 | GITHUB_CLIENT_ID = 1e60f7998804f5e00108 7 | GITHUB_CLIENT_SECRET = 2f0d22e8bdbe06ec4daec741ff3e0a93e4108c10 8 | 9 | GOOGLE_CLIENT_ID = 1066131321130-mm4t66i20sf6auu18eqessviu7q0i92a.apps.googleusercontent.com 10 | GOOGLE_CLIENT_SECRET = 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 11 | 12 | FACEBOOK_APP_ID = 1251450545401551 13 | FACEBOOK_APP_SECRET = ee7c247e3d3e1797ca5305c8060c0341 14 | 15 | # TWITTER_CONSUMER_KEY = uTkptLvVjQlSjZsReD9200V0Z 16 | # TWITTER_CONSUMER_SECRET = CagsG1XlJlDU8uqd0QMEyZtcEt3yFK7tfwQXHyqOvoV50dXPYK 17 | TWITTER_CONSUMER_KEY = MVFwQUd3ZXRyTW1EanU5aTA3S1Q6MTpjaQ 18 | TWITTER_CONSUMER_SECRET = eKkpRDt8dL5ua5ZXfM-Z8vKxQNRJcopMJHQBAEpFLGlgWrqjem 19 | BEARER_TOKEN = AAAAAAAAAAAAAAAAAAAAAOUwkQEAAAAAuOrljitcM8nGpYbFiqahsN%2Fmeb0%3DoMywQWAKNWROat8X54L20uvuixPZP2lKAzKNDtvfXnbN0JIAfn 20 | 21 | CLOUD_NAME = dyuvnzfpx 22 | API_KEY = 489335574218791 23 | API_SECRET = HM5qCA-teOvzyllFt9i5x1sH3Jg 24 | # href="https://github.com/login/oauth/authorize?client_id=1e60f7998804f5e00108" 25 | # https://graph.facebook.com/v15.0/{person-id}/ -------------------------------------------------------------------------------- /client/src/components/anjali/HomeAna.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import style from "./home.module.css"; 3 | import { Heading,Text } from '@chakra-ui/react'; 4 | import { IconButton } from '@chakra-ui/react' 5 | import {AddIcon} from "@chakra-ui/icons" 6 | 7 | export const HomeAna = () => { 8 | return ( 9 |
10 |
11 | Good afternoon! 12 | Charts are great, but sometimes you just want straight answers.Marks sure to check out our Answers tab. 13 | 14 |
15 |
16 | Totals 17 | Connect Facebook, Instagram, Twitter, LinkedIn Pages or (and!) Shopify to begin analyzing your marketing efforts. 18 | 19 |
20 | } 24 | />
25 |
26 | 27 |
28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /server/src/models/user.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const UserSchema = new mongoose.Schema( 4 | { 5 | name: { 6 | type: String, 7 | // required: true, 8 | }, 9 | email: { 10 | type: String, 11 | required: true, 12 | unique: true, 13 | }, 14 | password: { 15 | type: String, 16 | required: true, 17 | }, 18 | role: { 19 | type: String, 20 | enum: ["User", "Admin"], 21 | }, 22 | fb_id: { 23 | type: String, 24 | }, 25 | instagram_id: { 26 | type: String, 27 | }, 28 | linkedin_id: { 29 | type: String, 30 | }, 31 | facebook_posts: [ 32 | { 33 | type: mongoose.Schema.Types.ObjectId, 34 | ref: "post", 35 | }, 36 | ], 37 | instagram_posts: [ 38 | { 39 | type: mongoose.Schema.Types.ObjectId, 40 | ref: "post", 41 | }, 42 | ], 43 | linkedin_posts: [ 44 | { 45 | type: mongoose.Schema.Types.ObjectId, 46 | ref: "post", 47 | }, 48 | ], 49 | } 50 | // { collection: "user-data" } 51 | ); 52 | 53 | const UserModel = mongoose.model("user", UserSchema); 54 | 55 | module.exports = UserModel; 56 | -------------------------------------------------------------------------------- /client/src/components/anjali/analytics.module.css: -------------------------------------------------------------------------------- 1 | .Analytics { 2 | margin: auto; 3 | width: 100%; 4 | padding: 20px; 5 | justify-content: center; 6 | display: flex; 7 | gap: 40px; 8 | margin-top: 20px; 9 | } 10 | 11 | .sidebar { 12 | 13 | } 14 | .home { 15 | display: flex; 16 | gap:15px; 17 | margin-bottom: 60px; 18 | border-radius: 5px; 19 | padding: 5px; 20 | } 21 | .home:hover { 22 | background-color: gray; 23 | } 24 | .channel{ 25 | border-bottom: 1px solid gray; 26 | } 27 | .sidebar > div { 28 | margin-bottom: 10px; 29 | } 30 | .sidebar > div > div { 31 | display: flex; 32 | gap: 10px; 33 | margin-bottom: 15px; 34 | padding: 5px; 35 | border-radius: 5px; 36 | } 37 | .sidebar > div > div:hover { 38 | background-color: gray; 39 | } 40 | .sidebar img { 41 | width: 30px; 42 | } 43 | 44 | .leftbar { 45 | margin: auto; 46 | width: 70%; 47 | border: 1px solid gray; 48 | border-radius: 8px; 49 | box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; 50 | height: 100vh; 51 | overflow-y: scroll; 52 | text-align: left; 53 | padding: 20px; 54 | } 55 | .tools { 56 | 57 | border-bottom: 1px solid gray; 58 | } 59 | -------------------------------------------------------------------------------- /client/src/components/shubham/fbhooks.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | // Injects the Facebook SDK into the page 4 | const injectFbSDKScript = () => { 5 | (function (d, s, id) { 6 | var js, 7 | fjs = d.getElementsByTagName(s)[0]; 8 | if (d.getElementById(id)) { 9 | return; 10 | } 11 | js = d.createElement(s); 12 | js.id = id; 13 | js.src = "https://connect.facebook.net/en_US/sdk.js"; 14 | fjs.parentNode.insertBefore(js, fjs); 15 | })(document, "script", "facebook-jssdk"); 16 | }; 17 | 18 | export const useInitFbSDK = () => { 19 | const [isInitialized, setIsInitialized] = React.useState(false); 20 | 21 | // Initializes the SDK once the script has been loaded 22 | // https://developers.facebook.com/docs/javascript/quickstart/#loading 23 | window.fbAsyncInit = function () { 24 | console.log(process.env.REACT_APP_FB_APP_ID); 25 | window.FB.init({ 26 | // Find your App ID on https://developers.facebook.com/apps/ 27 | appId: `${process.env.REACT_APP_FB_APP_ID}`, 28 | cookie: true, 29 | xfbml: true, 30 | version: "v8.0", 31 | }); 32 | 33 | window.FB.AppEvents.logPageView(); 34 | setIsInitialized(true); 35 | }; 36 | 37 | injectFbSDKScript(); 38 | 39 | return isInitialized; 40 | }; 41 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/Part1.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import style from "./part1.module.css" 3 | import {ChevronRightIcon, WarningIcon} from "@chakra-ui/icons" 4 | 5 | export const Part1 = () => { 6 | return ( 7 |
8 |
9 | 10 |
11 |
12 |

Publications Flow

13 |

Holiday Gift Guide of Small Businesses

14 |

We've rounded up several products that would make the perfect gifts this holiday season. Even better, they're all from small businesses you can feel good about supporting.

15 |
Dec 15, 2022 8min read
16 |
17 |
18 | 19 |
20 |
21 |

Umber Bhatti

22 |

Content Writer @ Ecotone

23 |
24 |
25 |
26 |
27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /server/src/models/post.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const PostSchema = new mongoose.Schema( 4 | { 5 | title: { 6 | type: String, 7 | required: true, 8 | }, 9 | // image: { 10 | // type: String, 11 | // }, 12 | // cloudinaryId: { 13 | // type: String, 14 | // }, 15 | start: { 16 | type: String, 17 | }, 18 | end: { 19 | type: String, 20 | }, 21 | author: { 22 | type: String, 23 | // required: true, 24 | }, 25 | author_id: { 26 | type: mongoose.Schema.Types.ObjectId, 27 | ref: "user", 28 | // required: true, 29 | }, 30 | created_at: { 31 | type: Date, 32 | // required: true, 33 | }, 34 | // likes: [ 35 | // { 36 | // type: mongoose.Schema.Types.ObjectId, 37 | // ref: "User", 38 | // }, 39 | // ], 40 | // comments: [ 41 | // { 42 | // name: { 43 | // type: String, 44 | // }, 45 | // comment: { 46 | // type: String, 47 | // }, 48 | // date: { 49 | // type: Date, 50 | // }, 51 | // }, 52 | // ], 53 | } 54 | // { collection: "post-data" } 55 | ); 56 | 57 | const PostModel = mongoose.model("post", PostSchema); 58 | 59 | module.exports = PostModel; 60 | -------------------------------------------------------------------------------- /client/src/pages/Admin.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | --yellow: linear-gradient(180deg, #f8d49a -146.42%, #fad79d -46.42%); 3 | --orange: #fca61f; 4 | --black: #242d49; 5 | --gray: #788097; 6 | --purple: linear-gradient(180deg, #bb67ff 0%, #c484f3 100%); 7 | --pink: #ff919d; 8 | --glass: rgba(255, 255, 255, 0.54); 9 | --boxShadow: 0px 19px 60px rgb(0 0 0 / 8%); 10 | --smboxShadow: -79px 51px 60px rgba(0, 0, 0, 0.08); 11 | --activeItem: #f799a354; 12 | } 13 | .Admin { 14 | /* padding: 0.5rem 3.5rem; */ 15 | color: var(--black); 16 | background: linear-gradient( 17 | 106.37deg, 18 | #ffe1bc 29.63%, 19 | #ffcfd1 51.55%, 20 | #f3c6f1 90.85% 21 | ); 22 | height: 100vh; 23 | display: flex; 24 | align-items: center; 25 | justify-content: center; 26 | font-family: "Inter", sans-serif; 27 | } 28 | 29 | .AppGlass { 30 | display: grid; 31 | height: 97%; 32 | width: 97%; 33 | background: var(--glass); 34 | border-radius: 2rem; 35 | gap: 16px; 36 | grid-template-columns: 11rem auto 20rem; 37 | overflow: hidden; 38 | } 39 | 40 | @media screen and (max-width: 1200px) { 41 | .AppGlass { 42 | grid-template-columns: 10% 50% auto; 43 | overflow-y: scroll; 44 | } 45 | } 46 | 47 | @media screen and (max-width: 768px) { 48 | .AppGlass { 49 | grid-template-columns: 1fr; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/part6.module.css: -------------------------------------------------------------------------------- 1 | .Part6 { 2 | margin: auto; 3 | width: 100%; 4 | text-align: center; 5 | background-color: #2c4bff ; 6 | margin-top: 40px; 7 | padding: 40px; 8 | } 9 | .Part6 > div { 10 | margin: auto; 11 | width: 50%; 12 | color: white; 13 | } 14 | .Part6 > div > h1 { 15 | font-size: 40px; 16 | font-weight: bold; 17 | } 18 | .inner { 19 | margin: auto; 20 | width: 50%; 21 | display: flex; 22 | gap: 20px; 23 | margin-top: 30px; 24 | } 25 | 26 | @media all and (min-width: 851px) and (max-width: 1024px){ 27 | 28 | /* .Part6 > div { 29 | 30 | width: 50%; 31 | 32 | } */ 33 | .Part6 > div > h1 { 34 | font-size: 30px; 35 | } 36 | .inner { 37 | margin: auto; 38 | width: 80%; 39 | gap: 10px; 40 | margin-top: 20px; 41 | } 42 | 43 | } 44 | 45 | @media all and (min-width: 250px) and (max-width: 851px){ 46 | .Part6 { 47 | 48 | padding: 20px; 49 | } 50 | /* .Part6 > div { 51 | width: 60%; 52 | 53 | } */ 54 | .Part6 > div > h1 { 55 | font-size: 20px; 56 | 57 | } 58 | .inner { 59 | width: 100%; 60 | flex-direction: column; 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/part1.module.css: -------------------------------------------------------------------------------- 1 | .part1 { 2 | margin: auto; 3 | width: 80%; 4 | display: flex; 5 | gap: 40px; 6 | margin-top: 20px; 7 | text-align: left; 8 | } 9 | .left { 10 | width: 50%; 11 | 12 | } 13 | .right { 14 | width: 50%; 15 | padding: 20px 0; 16 | } 17 | .right > h1 { 18 | font-size: 45px; 19 | font-weight: bold; 20 | } 21 | .date { 22 | color: gray; 23 | } 24 | .flexbox { 25 | margin-top: 15px; 26 | display: flex; 27 | gap: 20px; 28 | } 29 | .flexbox > div > img { 30 | width: 70px; 31 | border-radius: 50%; 32 | border: 1px solid blue; 33 | } 34 | .flexbox > div > h3{ 35 | font-size: 20px; 36 | font-weight: bold; 37 | } 38 | 39 | 40 | @media all and (min-width: 851px) and (max-width: 1024px){ 41 | .right > h1 { 42 | font-size: 25px; 43 | 44 | } 45 | .right > p { 46 | font-size: 15px; 47 | 48 | } 49 | .right { 50 | padding: 10px 0; 51 | } 52 | .flexbox > div > img { 53 | width: 50px; 54 | } 55 | } 56 | 57 | @media all and (min-width: 250px) and (max-width: 851px){ 58 | .part1 { 59 | flex-direction: column; 60 | } 61 | .left { 62 | width: 100%; 63 | /* height: 500px; */ 64 | } 65 | .right { 66 | width: 100%; 67 | padding: 0; 68 | 69 | } 70 | .right > h1 { 71 | font-size: 30px; 72 | 73 | } 74 | .right > p { 75 | font-size: 15px; 76 | 77 | } 78 | } -------------------------------------------------------------------------------- /client/src/components/shubham/Sliding_S.jsx: -------------------------------------------------------------------------------- 1 | import { Box, Container, Heading, VStack, Image, Flex } from "@chakra-ui/react"; 2 | import { data } from "./slidingData.js"; 3 | import React from "react"; 4 | import Ticker from "react-ticker"; 5 | import "./Sliding_S.css"; 6 | 7 | const Card = (props) => { 8 | const { id, avatar } = props; 9 | return ( 10 | 11 | 21 | 29 | 30 | Buffer has made sharing our story and building our brand on social 31 | media so much easier. 32 | 33 | 41 | Luis Cancel, Managing Editor 42 | 43 | 44 | ); 45 | }; 46 | 47 | export default function Sliding() { 48 | return ( 49 | 50 | {() => } 51 | 52 | ); 53 | } 54 | -------------------------------------------------------------------------------- /client/src/components/anjali/channel.module.css: -------------------------------------------------------------------------------- 1 | .maindiv { 2 | margin: auto; 3 | width: 100%; 4 | display: flex; 5 | gap: 40px; 6 | margin-top: 5px; 7 | } 8 | .sidebar > div > img { 9 | width: 20px; 10 | } 11 | .first { 12 | color: black; 13 | font-weight: bold; 14 | } 15 | .sidebar { 16 | border-right: 1px solid grey; 17 | padding-right: 20px; 18 | height: 100vh; 19 | } 20 | 21 | .sidebar > div { 22 | margin-left: 20px; 23 | display: flex; 24 | gap: 15px; 25 | padding: 5px; 26 | margin-bottom: 10px; 27 | } 28 | .sidebar > div:hover { 29 | background-color: rgb(223, 220, 220); 30 | /* background-color: #2c4bff; */ 31 | } 32 | 33 | .second { 34 | margin: auto; 35 | width: 50%; 36 | text-align: left; 37 | } 38 | .gridbox { 39 | margin: auto; 40 | padding: auto; 41 | display: grid; 42 | grid-template-columns: repeat(3, 1fr); 43 | gap: 30px; 44 | text-align: center; 45 | margin-top: 40px; 46 | margin-bottom: 20px; 47 | } 48 | 49 | .gridbox > div { 50 | padding: 10px; 51 | height: 180px; 52 | display: flex; 53 | flex-direction: column; 54 | border-radius: 10px; 55 | justify-content: center; 56 | box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; 57 | } 58 | .gridbox > div:hover { 59 | border: 1px solid blue; 60 | } 61 | 62 | .gridbox > div > img { 63 | margin: auto; 64 | width: 40px; 65 | } 66 | .p1 { 67 | font-size: 20px; 68 | } 69 | .p2 { 70 | color: gray; 71 | } 72 | .p3 { 73 | color: blue; 74 | font-weight: bold; 75 | cursor: pointer; 76 | } 77 | -------------------------------------------------------------------------------- /server/src/routes/user.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const Router = express.Router(); 3 | const upload = require("../middlewares/imageUploader"); 4 | const { 5 | all, 6 | deleteUser, 7 | profile, 8 | posts, 9 | serachQuery, 10 | postID, 11 | post_likeID, 12 | post_UnlikeId, 13 | post_CommentId, 14 | createPost, 15 | editPost, 16 | deletePost, 17 | } = require("../controllers/user.controller"); 18 | 19 | Router.get("/all", all); 20 | 21 | Router.delete("/deleteuser/:_id", deleteUser); 22 | 23 | //profile of the particular user...................... 24 | Router.post("/profile", profile); 25 | 26 | //all posts displayed........ 27 | Router.get("/posts", posts); 28 | 29 | //search post............ 30 | Router.get("/search/:query", serachQuery); 31 | 32 | //particular bolg is displayed here when user clicks on that post........... 33 | Router.get("/post/:id", postID); 34 | 35 | //liked the particular post............... 36 | Router.post("/post/like/:id", post_likeID); 37 | 38 | //unliked the particular post............... 39 | Router.post("/post/unlike/:id", post_UnlikeId); 40 | 41 | //commented on the particular post............... 42 | Router.post("/post/comment/:id", post_CommentId); 43 | 44 | //create post........................... 45 | Router.post("/create", upload.single("image"), createPost); 46 | 47 | //edit the post.......................... 48 | Router.post("/edit", upload.single("image"), editPost); 49 | 50 | //delete the post................... 51 | Router.delete("/delete/:channel/:_id", upload.single("image"), deletePost); 52 | 53 | module.exports = Router; 54 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/CustomerReview/CustomerReview.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Chart from "react-apexcharts"; 3 | 4 | const CustomerReview = () => { 5 | const data = { 6 | series: [ 7 | { 8 | name: "Review", 9 | data: [10, 50, 30, 90, 40, 120, 100], 10 | }, 11 | ], 12 | options: { 13 | chart: { 14 | type: "area", 15 | height: "auto", 16 | }, 17 | 18 | fill: { 19 | colors: ["#fff"], 20 | type: "gradient", 21 | }, 22 | dataLabels: { 23 | enabled: false, 24 | }, 25 | stroke: { 26 | curve: "smooth", 27 | colors: ["#ff929f"], 28 | }, 29 | tooltip: { 30 | x: { 31 | format: "dd/MM/yy HH:mm", 32 | }, 33 | }, 34 | grid: { 35 | show: false, 36 | }, 37 | xaxis: { 38 | type: "datetime", 39 | categories: [ 40 | "2018-09-19T00:00:00.000Z", 41 | "2018-09-19T01:30:00.000Z", 42 | "2018-09-19T02:30:00.000Z", 43 | "2018-09-19T03:30:00.000Z", 44 | "2018-09-19T04:30:00.000Z", 45 | "2018-09-19T05:30:00.000Z", 46 | "2018-09-19T06:30:00.000Z", 47 | ], 48 | }, 49 | yaxis: { 50 | show: false, 51 | }, 52 | toolbar: { 53 | show: false, 54 | }, 55 | }, 56 | }; 57 | return ( 58 |
59 | 60 |
61 | ); 62 | }; 63 | 64 | export default CustomerReview; 65 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/part2.module.css: -------------------------------------------------------------------------------- 1 | .Part2 { 2 | margin: auto; 3 | width: 80%; 4 | display: grid; 5 | grid-template-columns: repeat(2,1fr); 6 | gap: 40px; 7 | margin-top: 40px; 8 | } 9 | .Part2 > div { 10 | text-align: left; 11 | } 12 | .first > img { 13 | width: 100%; 14 | height: 300px; 15 | } 16 | .first > img:hover { 17 | transition: all 0.4s ease-in-out; 18 | transform: scale(1.03); 19 | } 20 | .second { 21 | margin-top: 15px; 22 | } 23 | .third { 24 | margin-top: 15px; 25 | height: 100px; 26 | } 27 | .head { 28 | margin-top: 15px; 29 | font-size: 20px; 30 | font-weight: bold; 31 | } 32 | .flex1 { 33 | margin-top: 15px; 34 | display: flex; 35 | justify-content: space-between; 36 | color: gray; 37 | } 38 | .flex2 { 39 | margin-top: 20px; 40 | display: flex; 41 | /* gap: 15px; */ 42 | } 43 | .flex2 > div { 44 | margin: auto; 45 | display: flex; 46 | gap: 10px; 47 | margin-left: 20px; 48 | } 49 | .flex2 > div > p:first-child { 50 | font-weight: bold; 51 | } 52 | .flex2 > img { 53 | 54 | width: 40px; 55 | border-radius: 50%; 56 | } 57 | 58 | 59 | @media all and (min-width: 851px) and (max-width: 1024px){ 60 | .third { 61 | height: 150px; 62 | } 63 | 64 | 65 | } 66 | 67 | @media all and (min-width: 250px) and (max-width: 851px){ 68 | .head { 69 | font-size: 18px; 70 | 71 | } 72 | .Part2 { 73 | 74 | grid-template-columns: repeat(1,1fr); 75 | 76 | } 77 | .third { 78 | height: 150px; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /client/src/redux/auth/auth.reducer.js: -------------------------------------------------------------------------------- 1 | import { 2 | LOGIN_ERROR, 3 | LOGIN_REQUEST, 4 | LOGIN_SUCCESS, 5 | LOGOUT, 6 | } from "./auth.types"; 7 | 8 | let LocalToken = localStorage.getItem("token"); 9 | const check = 10 | LocalToken !== undefined && LocalToken !== null && LocalToken !== ""; 11 | const email = localStorage.getItem("email"); 12 | const checkAdminAuth = email == "admin@gmail.com"; 13 | console.log(checkAdminAuth) 14 | const initialState = { 15 | token: { token: LocalToken }, 16 | isAuth: check, 17 | loading: false, 18 | error: false, 19 | AdminIsAuth: checkAdminAuth, 20 | }; 21 | 22 | export const authReducer = (state = initialState, { type, payload }) => { 23 | switch (type) { 24 | case LOGIN_REQUEST: { 25 | return { 26 | ...state, 27 | loading: true, 28 | error: false, 29 | }; 30 | } 31 | case LOGIN_SUCCESS: { 32 | localStorage.setItem("token", payload.token); 33 | return { 34 | ...state, 35 | isAuth: true, 36 | token: payload, 37 | loading: false, 38 | error: false, 39 | AdminIsAuth: checkAdminAuth, 40 | }; 41 | } 42 | case LOGIN_ERROR: { 43 | // localStorage.setItem("token", payload); 44 | return { 45 | ...state, 46 | loading: false, 47 | error: true, 48 | errorMessage: payload, 49 | }; 50 | } 51 | case LOGOUT: { 52 | localStorage.removeItem("token"); 53 | localStorage.removeItem("email"); 54 | return { 55 | ...state, 56 | isAuth: false, 57 | token: "", 58 | AdminIsAuth: false, 59 | }; 60 | } 61 | default: { 62 | return state; 63 | } 64 | } 65 | }; 66 | -------------------------------------------------------------------------------- /client/src/components/anjali/Blog/part5.module.css: -------------------------------------------------------------------------------- 1 | .Part5 { 2 | margin: auto; 3 | width: 80%; 4 | display: grid; 5 | grid-template-columns: repeat(3,1fr); 6 | gap: 40px; 7 | margin-top: 40px; 8 | } 9 | .Part5 > div { 10 | text-align: left; 11 | } 12 | .first > img { 13 | width: 100%; 14 | height: 250px; 15 | } 16 | .first > img:hover { 17 | transition: all 0.4s ease-in-out; 18 | transform: scale(1.03); 19 | } 20 | .second { 21 | margin-top: 15px; 22 | } 23 | .third { 24 | margin-top: 15px; 25 | height: 100px; 26 | } 27 | .head { 28 | margin-top: 15px; 29 | font-size: 20px; 30 | font-weight: bold; 31 | } 32 | .flex1 { 33 | margin-top: 15px; 34 | display: flex; 35 | justify-content: space-between; 36 | color: gray; 37 | } 38 | .flex2 { 39 | margin-top: 20px; 40 | display: flex; 41 | /* gap: 15px; */ 42 | } 43 | .flex2 > div { 44 | margin: auto; 45 | display: flex; 46 | gap: 10px; 47 | margin-left: 20px; 48 | } 49 | .flex2 > div > p:first-child { 50 | font-weight: bold; 51 | } 52 | .flex2 > img { 53 | 54 | width: 40px; 55 | border-radius: 50%; 56 | } 57 | 58 | 59 | @media all and (min-width: 851px) and (max-width: 1024px){ 60 | /* .third { 61 | height: 150px; 62 | } */ 63 | .Part5 { 64 | 65 | grid-template-columns: repeat(2,1fr); 66 | 67 | } 68 | 69 | } 70 | 71 | @media all and (min-width: 250px) and (max-width: 851px){ 72 | .head { 73 | font-size: 18px; 74 | 75 | } 76 | .Part5 { 77 | 78 | grid-template-columns: repeat(1,1fr); 79 | 80 | } 81 | /* .third { 82 | height: 150px; 83 | } */ 84 | } 85 | -------------------------------------------------------------------------------- /client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@chakra-ui/icons": "^2.0.13", 7 | "@chakra-ui/react": "^2.4.3", 8 | "@emotion/react": "^11.10.5", 9 | "@emotion/styled": "^11.10.5", 10 | "@iconscout/react-unicons": "^1.1.6", 11 | "@mui/material": "^5.11.0", 12 | "@testing-library/jest-dom": "^5.16.5", 13 | "@testing-library/react": "^13.4.0", 14 | "@testing-library/user-event": "^13.5.0", 15 | "apexcharts": "^3.36.3", 16 | "axios": "^1.2.1", 17 | "chart.js": "^4.0.1", 18 | "date-fns": "^2.29.3", 19 | "firebase": "^9.15.0", 20 | "framer-motion": "^7.10.2", 21 | "react": "^18.2.0", 22 | "react-apexcharts": "^1.4.0", 23 | "react-big-calendar": "^1.5.2", 24 | "react-chartjs-2": "^5.0.1", 25 | "react-circular-progressbar": "^2.1.0", 26 | "react-datepicker": "^4.8.0", 27 | "react-dom": "^18.2.0", 28 | "react-icons": "^4.7.1", 29 | "react-redux": "^8.0.5", 30 | "react-router-dom": "^6.4.5", 31 | "react-scripts": "5.0.1", 32 | "react-ticker": "^1.3.2", 33 | "redux": "^4.2.0", 34 | "redux-thunk": "^2.4.2", 35 | "web-vitals": "^2.1.4" 36 | }, 37 | "scripts": { 38 | "start": "react-scripts start", 39 | "build": "react-scripts build", 40 | "test": "react-scripts test", 41 | "eject": "react-scripts eject" 42 | }, 43 | "eslintConfig": { 44 | "extends": [ 45 | "react-app", 46 | "react-app/jest" 47 | ] 48 | }, 49 | "browserslist": { 50 | "production": [ 51 | ">0.2%", 52 | "not dead", 53 | "not op_mini all" 54 | ], 55 | "development": [ 56 | "last 1 chrome version", 57 | "last 1 firefox version", 58 | "last 1 safari version" 59 | ] 60 | }, 61 | "homepage": "*" 62 | } 63 | -------------------------------------------------------------------------------- /client/src/routes/PublishingRoutes.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Route, Routes, useLocation } from "react-router-dom"; 3 | import CalendarComponent from "../components/shubham/Calendar"; 4 | import FacebookPage from "../pages/FacebookPage"; 5 | import InstagramPage from "../pages/InstagramPage"; 6 | import { Publishing } from "../pages/Publishing"; 7 | import linkedinPage from "../pages/LinkedinPage"; 8 | import PrivateRoute from "./PrivateRoute"; 9 | import LinkedinPage from "../pages/LinkedinPage"; 10 | 11 | const PublishingRoutes = () => { 12 | return ( 13 | <> 14 | 15 | 20 | 21 | 22 | } 23 | > 24 | 29 | 30 | 31 | } 32 | > 33 | 38 | 39 | 40 | } 41 | > 42 | 47 | 48 | 49 | } 50 | > 51 | 56 | 57 | 58 | } 59 | > 60 | 61 | 62 | ); 63 | }; 64 | 65 | export default PublishingRoutes; 66 | -------------------------------------------------------------------------------- /client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Ecotone | Always Easy to Share 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /client/src/components/prakash/Components/Navbar/Navbar.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Button, Image, Text, Flex, Box, HStack } from "@chakra-ui/react"; 3 | import NavbarLgModel from "./NavbarLgModel"; 4 | import "./navbar.css"; 5 | import Navbarbasemodel from "./navbarbasemodel"; 6 | 7 | import Ecotone from "../../images/log1.jpg"; 8 | 9 | import { Nav, NavLink, NavLinkLink } from "react-router-dom"; 10 | 11 | function Navbar() { 12 | return ( 13 |
14 | 15 | 16 | {" "} 19 | Create and schedule Twitter threads !Find out more{" "} 20 | 21 | 22 | 23 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 51 | Log in 52 | 53 | 54 | 63 | 64 | 65 | 66 | 67 |
68 | ); 69 | } 70 | 71 | export default Navbar; 72 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Card/Card.css: -------------------------------------------------------------------------------- 1 | .CompactCard { 2 | display: flex; 3 | flex: 1; 4 | height: 9rem !important; 5 | border-radius: 0.7rem; 6 | color: white; 7 | padding: 1rem; 8 | position: relative; 9 | cursor: pointer; 10 | } 11 | .CompactCard:hover { 12 | box-shadow: none !important; 13 | } 14 | 15 | /* radial bar */ 16 | .radialBar { 17 | flex: 1 1; 18 | display: flex; 19 | flex-direction: column; 20 | justify-content: flex-end; 21 | gap: 1rem; 22 | } 23 | .CircularProgressbar { 24 | width: 4rem !important; 25 | overflow: visible; 26 | } 27 | .CircularProgressbar-path { 28 | stroke: white !important; 29 | stroke-width: 12px !important; 30 | filter: drop-shadow(2px 4px 6px white); 31 | } 32 | .CircularProgressbar-trail { 33 | display: none; 34 | } 35 | .CircularProgressbar-text { 36 | fill: white !important; 37 | } 38 | 39 | .radialBar > span { 40 | font-size: 17px; 41 | font-weight: bold; 42 | } 43 | 44 | /* sideDetail*/ 45 | .detail { 46 | flex: 1; 47 | display: flex; 48 | flex-direction: column; 49 | align-items: flex-end; 50 | justify-content: space-between; 51 | } 52 | 53 | .detail > span:nth-child(2) { 54 | font-size: 22px; 55 | font-weight: bold; 56 | } 57 | .detail > span:nth-child(3) { 58 | font-size: 12px; 59 | } 60 | 61 | /* ExpandedCard */ 62 | .ExpandedCard { 63 | position: absolute; 64 | width: 60%; 65 | height: 70vh; 66 | z-index: 9; 67 | left: 13rem; 68 | border-radius: 1rem; 69 | display: flex; 70 | flex-direction: column; 71 | align-items: center; 72 | justify-content: space-around; 73 | padding: 1rem; 74 | } 75 | .ExpandedCard > span:nth-of-type(1) { 76 | color: white; 77 | font-size: 26px; 78 | font-weight: bold; 79 | text-shadow: 0px 0px 15px white; 80 | } 81 | .ExpandedCard > span:nth-of-type(2) { 82 | color: rgb(236, 236, 236); 83 | font-size: 15px; 84 | } 85 | 86 | .chartContainer { 87 | width: 70%; 88 | } 89 | 90 | @media screen and (max-width: 1200px) { 91 | .ExpandedCard { 92 | top: 2rem; 93 | height: 45vh; 94 | left: 6rem; 95 | } 96 | } 97 | 98 | @media screen and (max-width: 768px) { 99 | .ExpandedCard { 100 | top: 8rem; 101 | height: 50%; 102 | left: 25px; 103 | width: 80%; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /server/src/controllers/auth.controller.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | const bcrypt = require("bcrypt"); 3 | const UserModel = require("../models/user.model"); 4 | const saltRounds = parseInt(process.env.SALT_ROUNDS); 5 | 6 | const register = async (req, res) => { 7 | const { name, email, password } = req.body; 8 | // const token = req.headers["authorization"]; 9 | 10 | const user = await UserModel.findOne({ email }); 11 | if (user) { 12 | return res.status(400).send({ error: "User already exists" }); 13 | } 14 | bcrypt.hash(password, saltRounds, async (err, hash) => { 15 | if (err) { 16 | return res.status(500).send({ error: "Internal server error" }); 17 | } 18 | try { 19 | // if (token) { 20 | // const decoded = jwt.verify(token, JWT_SECRET); 21 | 22 | // if (decoded && decoded.role === "Admin") { 23 | // const user = new UserModel({ 24 | // name, 25 | // email, 26 | // password: hash, 27 | // role: "User", 28 | // }); 29 | // await user.save(); 30 | // return res.status(201).send("User created succesfully"); 31 | // } 32 | // return res.status(403).send("You are not allowed to create user"); 33 | // } 34 | const newUser = await UserModel.create({ 35 | name, 36 | email, 37 | password: hash, 38 | role: "User", 39 | }); 40 | return res.status(201).send({ user: newUser }); 41 | } catch (err) { 42 | return res.status(500).send({ error: "Internal server error" }); 43 | } 44 | }); 45 | }; 46 | 47 | const login = async (req, res) => { 48 | const { email, password } = req.body; 49 | 50 | const user = await UserModel.findOne({ email }); 51 | 52 | if (!user) { 53 | return res.status(404).send({ error: "User not found" }); 54 | } 55 | 56 | bcrypt.compare(password, user.password, async (err, result) => { 57 | if (err) { 58 | return res.status(500).send({ error: "Internal server error" }); 59 | } 60 | if (!result) { 61 | return res.status(401).send({ error: "Invalid credentials" }); 62 | } 63 | const token = jwt.sign({ _id: user._id }, process.env.JWT_SECRET, { 64 | expiresIn: "6h", 65 | }); 66 | return res.status(200).send({ token }); 67 | }); 68 | }; 69 | 70 | module.exports = { register, login }; 71 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Sidebar.css: -------------------------------------------------------------------------------- 1 | .sidebar { 2 | display: flex; 3 | flex-direction: column; 4 | position: relative; 5 | padding-top: 4rem; 6 | transition: all 300ms ease; 7 | } 8 | /* logo */ 9 | .bars{ 10 | display: none; 11 | } 12 | 13 | .logo { 14 | display: flex; 15 | height: 5rem; 16 | font-weight: bold; 17 | font-size: 22px; 18 | gap: 1rem; 19 | align-items: center; 20 | justify-content: center; 21 | height: 4%; 22 | } 23 | .logo > span > span { 24 | color: var(--pink); 25 | } 26 | 27 | .logo > img { 28 | width: 3rem; 29 | height: 3rem; 30 | } 31 | 32 | 33 | /* menu */ 34 | .menu { 35 | margin-top: 4rem; 36 | display: flex; 37 | flex-direction: column; 38 | gap: 2rem; 39 | } 40 | .menuItem { 41 | display: flex; 42 | align-items: center; 43 | gap: 1rem; 44 | height: 2.5rem; 45 | margin-left: 2rem; 46 | position: relative; 47 | transition: all 300ms ease; 48 | border-radius: 0.7rem; 49 | font-size: 14px; 50 | } 51 | 52 | .menuItem:hover { 53 | cursor: pointer; 54 | } 55 | 56 | .menu .menuItem:last-child { 57 | position: absolute; 58 | bottom: 2.3rem; 59 | width: 100%; 60 | } 61 | 62 | .active { 63 | background: var(--activeItem); 64 | margin-left: 0; 65 | } 66 | .active::before { 67 | content: ""; 68 | width: 8px; 69 | height: 100%; 70 | background: var(--pink); 71 | margin-right: calc(1rem - 8px); 72 | } 73 | 74 | 75 | /* Tablets */ 76 | @media screen and (max-width: 1200px) { 77 | .menuItem>span{ 78 | display: none; 79 | } 80 | .logo{ 81 | display: none; 82 | } 83 | } 84 | 85 | @media screen and (max-width: 768px) { 86 | .sidebar{ 87 | position: fixed; 88 | z-index: 9; 89 | background: #ffe0e0; 90 | width: 55%; 91 | padding-right: 1rem; 92 | height: 100%; 93 | } 94 | .menuItem>span{ 95 | display: block; 96 | } 97 | .logo{ 98 | display: flex; 99 | } 100 | .menu .menuItem:last-child { 101 | position: relative; 102 | margin-top: 6rem; 103 | } 104 | .bars{ 105 | display: flex; 106 | position: fixed; 107 | top: 2rem; 108 | left:60%; 109 | background:#ffe0e0; 110 | padding:10px; 111 | border-radius: 10px; 112 | z-index: 9; 113 | } 114 | .close{ 115 | left: -60%; 116 | } 117 | } 118 | 119 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Sidebar.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import "./Sidebar.css"; 3 | import Logo from "../imgs/logo.png"; 4 | import { UilSignOutAlt } from "@iconscout/react-unicons"; 5 | import { SidebarData } from "../Data/Data"; 6 | import { UilBars } from "@iconscout/react-unicons"; 7 | import { motion } from "framer-motion"; 8 | import { NavLink } from "react-router-dom"; 9 | import { ActionLogout } from "../../../redux/auth/auth.actions"; 10 | import { useDispatch } from "react-redux"; 11 | 12 | const Sidebar = () => { 13 | const [selected, setSelected] = useState(0); 14 | 15 | const [expanded, setExpaned] = useState(true); 16 | 17 | const dispatch = useDispatch(); 18 | 19 | const sidebarVariants = { 20 | true: { 21 | left: "0", 22 | }, 23 | false: { 24 | left: "-60%", 25 | }, 26 | }; 27 | console.log(window.innerWidth); 28 | return ( 29 | <> 30 |
setExpaned(!expanded)} 34 | > 35 | 36 |
37 | 42 | {/* logo */} 43 |
44 | logo 45 | 46 | Ecotone 47 | 48 |
49 | 50 |
51 | {SidebarData.map((item, index) => { 52 | return ( 53 |
setSelected(index)} 57 | > 58 | 59 | 60 | {item.heading} 61 | 62 |
63 | ); 64 | })} 65 | {/* signoutIcon */} 66 |
67 | dispatch(ActionLogout())} /> 68 |
69 |
70 |
71 | 72 | ); 73 | }; 74 | 75 | export default Sidebar; 76 | -------------------------------------------------------------------------------- /client/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/src/redux/admin/admin.actions.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { 3 | CREATE_USER_FAILURE, 4 | CREATE_USER_REQUEST, 5 | CREATE_USER_SUCCESS, 6 | DELETE_USER_FAILURE, 7 | DELETE_USER_REQUEST, 8 | DELETE_USER_SUCCESS, 9 | GET_USER_FAILURE, 10 | GET_USER_REQUEST, 11 | GET_USER_SUCCESS, 12 | } from "./admin.types"; 13 | 14 | const token = localStorage.getItem("token"); 15 | axios.defaults.headers.common["Authorization"] = token; 16 | 17 | export const getUsers = () => async (dispatch) => { 18 | dispatch({ type: GET_USER_REQUEST }); 19 | try { 20 | const res = await axios.get( 21 | `https://mauve-rabbit-gown.cyclic.app/user/all` 22 | ); 23 | const data = await res.data; 24 | console.log(data); 25 | dispatch({ type: GET_USER_SUCCESS, payload: data }); 26 | } catch (e) { 27 | dispatch({ type: GET_USER_FAILURE }); 28 | } 29 | }; 30 | 31 | export const getChannelsPosts = (id) => async (dispatch) => { 32 | dispatch({ type: GET_USER_REQUEST }); 33 | try { 34 | const res = await axios.get( 35 | `https://mauve-rabbit-gown.cyclic.app/user/post/${id}` 36 | ); 37 | const data = await res.data; 38 | console.log(data); 39 | dispatch({ type: GET_USER_SUCCESS, payload: data.post }); 40 | } catch (e) { 41 | dispatch({ type: GET_USER_FAILURE }); 42 | } 43 | }; 44 | 45 | export const createPost = (formData) => async (dispatch) => { 46 | console.log(formData); 47 | dispatch({ type: CREATE_USER_REQUEST }); 48 | try { 49 | const res = await axios.post( 50 | `https://mauve-rabbit-gown.cyclic.app/user/create`, 51 | formData 52 | ); 53 | const data = await res.data; 54 | dispatch({ type: CREATE_USER_SUCCESS, payload: data }); 55 | } catch (e) { 56 | dispatch({ type: CREATE_USER_FAILURE }); 57 | } 58 | }; 59 | 60 | // export const updatePost = (formData, token) => async (dispatch) => { 61 | // dispatch({ type: UPDATE_USER_REQUEST }); 62 | // try { 63 | // const headers = { 64 | // "Content-type": "application/json", 65 | // Authorization: `${token}`, 66 | // }; 67 | // const res = await axios.post(`https://mauve-rabbit-gown.cyclic.app/user/edit`, formData, { 68 | // headers, 69 | // }); 70 | // const data = await res.data; 71 | // dispatch({ type: UPDATE_USER_SUCCESS, payload: data }); 72 | // } catch (e) { 73 | // dispatch({ type: UPDATE_USER_FAILURE }); 74 | // } 75 | // }; 76 | 77 | export const deleteUser = (_id) => async (dispatch) => { 78 | console.log(_id); 79 | dispatch({ type: DELETE_USER_REQUEST }); 80 | try { 81 | const res = await axios.delete( 82 | `https://mauve-rabbit-gown.cyclic.app/user/deleteuser/${_id}` 83 | ); 84 | const data = await res.data; 85 | dispatch({ type: DELETE_USER_SUCCESS, payload: data }); 86 | return getUsers(); 87 | } catch (e) { 88 | dispatch({ type: DELETE_USER_FAILURE }); 89 | } 90 | }; 91 | -------------------------------------------------------------------------------- /client/src/components/shubham/components/Table/Table.jsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import Table from "@mui/material/Table"; 3 | import TableBody from "@mui/material/TableBody"; 4 | import TableCell from "@mui/material/TableCell"; 5 | import TableContainer from "@mui/material/TableContainer"; 6 | import TableHead from "@mui/material/TableHead"; 7 | import TableRow from "@mui/material/TableRow"; 8 | import Paper from "@mui/material/Paper"; 9 | import "./Table.css"; 10 | import { useSelector } from "react-redux"; 11 | 12 | function createData(name, trackingId, date, status) { 13 | return { name, trackingId, date, status }; 14 | } 15 | 16 | const makeStyle = (status) => { 17 | if (status === "Approved") { 18 | return { 19 | background: "rgb(145 254 159 / 47%)", 20 | color: "green", 21 | }; 22 | } else if (status === "Pending") { 23 | return { 24 | background: "#ffadad8f", 25 | color: "red", 26 | }; 27 | } else { 28 | return { 29 | background: "#59bfff", 30 | color: "white", 31 | }; 32 | } 33 | }; 34 | 35 | export default function BasicTable() { 36 | const { data } = useSelector((store) => store.posts); 37 | 38 | let recent = data.splice(0, 5); 39 | const rows = recent; 40 | console.log(data); 41 | return ( 42 |
43 |

Recent Posts

44 | 48 |
49 | 50 | 51 | Post 52 | Post ID 53 | Date 54 | Status 55 | 56 | 57 | 58 | 59 | {rows.map((row) => ( 60 | 64 | 65 | {row.title} 66 | 67 | {row._id} 68 | {row.end.split("T")[0]} 69 | 70 | 71 | {"Active"} 72 | 73 | 74 | 75 | Details 76 | 77 | 78 | ))} 79 | 80 |
81 | 82 |
83 | ); 84 | } 85 | -------------------------------------------------------------------------------- /client/src/pages/LinkedinPage.jsx: -------------------------------------------------------------------------------- 1 | import { 2 | Box, 3 | Card, 4 | CardHeader, 5 | CardBody, 6 | CardFooter, 7 | Heading, 8 | Text, 9 | Stack, 10 | Button, 11 | HStack, 12 | SimpleGrid, 13 | Editable, 14 | EditablePreview, 15 | EditableTextarea, 16 | } from "@chakra-ui/react"; 17 | import React, { useEffect, useState } from "react"; 18 | import { useDispatch, useSelector } from "react-redux"; 19 | import { deletePost, getChannelsPosts } from "../redux/posts/post.action"; 20 | import DatePicker from "react-datepicker"; 21 | import "react-datepicker/dist/react-datepicker.css"; 22 | 23 | const LinkedinPage = () => { 24 | const { data } = useSelector((store) => store.posts); 25 | const dispatch = useDispatch(); 26 | const [editDate, setEditDate] = useState({}); 27 | const [posts, setPosts] = useState([]); 28 | 29 | useEffect(() => { 30 | dispatch(getChannelsPosts("linkedin_posts")); 31 | }, []); 32 | 33 | const handleDelete = (_id) => { 34 | dispatch(deletePost(_id, "linkedin_posts")); 35 | // dispatch(getChannelsPosts("facebook_posts")); 36 | }; 37 | 38 | return ( 39 | 40 | 46 | {data?.map((el) => ( 47 | 48 | 49 | 50 | {/* {el.end.split("T")[0]} */} 51 | {/* 52 | 53 | setEditDate(e.target.value)} 55 | /> 56 | */} 57 | setEditDate({ start, end: start })} 62 | /> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | {/* 72 | {el.title}. 73 | */} 74 | 75 | 78 | 85 | 86 | 87 | ))} 88 | 89 | 90 | ); 91 | }; 92 | 93 | export default LinkedinPage; 94 | -------------------------------------------------------------------------------- /client/src/pages/FacebookPage.jsx: -------------------------------------------------------------------------------- 1 | import { 2 | Box, 3 | Card, 4 | CardHeader, 5 | CardBody, 6 | CardFooter, 7 | Heading, 8 | Text, 9 | Stack, 10 | Button, 11 | HStack, 12 | SimpleGrid, 13 | Editable, 14 | EditablePreview, 15 | EditableTextarea, 16 | } from "@chakra-ui/react"; 17 | import React, { useEffect, useState } from "react"; 18 | import { useDispatch, useSelector } from "react-redux"; 19 | import { deletePost, getChannelsPosts } from "../redux/posts/post.action"; 20 | import DatePicker from "react-datepicker"; 21 | import "react-datepicker/dist/react-datepicker.css"; 22 | 23 | const FacebookPage = () => { 24 | const { data } = useSelector((store) => store.posts); 25 | const dispatch = useDispatch(); 26 | const [editDate, setEditDate] = useState({}); 27 | const [posts, setPosts] = useState([]); 28 | 29 | useEffect(() => { 30 | dispatch(getChannelsPosts("facebook_posts")); 31 | }, []); 32 | 33 | const handleDelete = (_id) => { 34 | dispatch(deletePost(_id, "facebook_posts")); 35 | // dispatch(getChannelsPosts("facebook_posts")); 36 | }; 37 | 38 | return ( 39 | 40 | 46 | {data?.map((el) => ( 47 | 48 | 49 | 50 | {/* {el.end.split("T")[0]} */} 51 | {/* 52 | 53 | setEditDate(e.target.value)} 55 | /> 56 | */} 57 | setEditDate({ start, end: start })} 62 | /> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | {/* 72 | {el.title}. 73 | */} 74 | 75 | 78 | 85 | 86 | 87 | ))} 88 | 89 | 90 | ); 91 | }; 92 | 93 | export default FacebookPage; 94 | -------------------------------------------------------------------------------- /client/src/redux/posts/post.action.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { 3 | CREATE_POST_FAILURE, 4 | CREATE_POST_REQUEST, 5 | CREATE_POST_SUCCESS, 6 | DELETE_POST_FAILURE, 7 | DELETE_POST_REQUEST, 8 | DELETE_POST_SUCCESS, 9 | GET_POST_FAILURE, 10 | GET_POST_REQUEST, 11 | GET_POST_SUCCESS, 12 | UPDATE_POST_FAILURE, 13 | UPDATE_POST_REQUEST, 14 | UPDATE_POST_SUCCESS, 15 | } from "./post.types"; 16 | 17 | const token = localStorage.getItem("token"); 18 | axios.defaults.headers.common["Authorization"] = token; 19 | 20 | export const getPosts = () => async (dispatch) => { 21 | dispatch({ type: GET_POST_REQUEST }); 22 | try { 23 | const res = await axios.post( 24 | `https://mauve-rabbit-gown.cyclic.app/user/profile` 25 | ); 26 | const data = await res.data; 27 | dispatch({ type: GET_POST_SUCCESS, payload: data.posts }); 28 | } catch (e) { 29 | dispatch({ type: GET_POST_FAILURE }); 30 | } 31 | }; 32 | 33 | export const getChannelsPosts = (id) => async (dispatch) => { 34 | dispatch({ type: GET_POST_REQUEST }); 35 | try { 36 | const res = await axios.get( 37 | `https://mauve-rabbit-gown.cyclic.app/user/post/${id}` 38 | ); 39 | const data = await res.data; 40 | console.log(data); 41 | dispatch({ type: GET_POST_SUCCESS, payload: data.post }); 42 | } catch (e) { 43 | dispatch({ type: GET_POST_FAILURE }); 44 | } 45 | }; 46 | 47 | export const createPost = (formData) => async (dispatch) => { 48 | console.log(formData); 49 | dispatch({ type: CREATE_POST_REQUEST }); 50 | try { 51 | const res = await axios.post( 52 | `https://mauve-rabbit-gown.cyclic.app/user/create`, 53 | formData 54 | ); 55 | const data = await res.data; 56 | dispatch({ type: CREATE_POST_SUCCESS, payload: data }); 57 | } catch (e) { 58 | dispatch({ type: CREATE_POST_FAILURE }); 59 | } 60 | }; 61 | 62 | export const updatePost = (formData, token) => async (dispatch) => { 63 | dispatch({ type: UPDATE_POST_REQUEST }); 64 | try { 65 | const headers = { 66 | "Content-type": "application/json", 67 | Authorization: `${token}`, 68 | }; 69 | const res = await axios.post( 70 | `https://mauve-rabbit-gown.cyclic.app/user/edit`, 71 | formData, 72 | { 73 | headers, 74 | } 75 | ); 76 | const data = await res.data; 77 | dispatch({ type: UPDATE_POST_SUCCESS, payload: data }); 78 | } catch (e) { 79 | dispatch({ type: UPDATE_POST_FAILURE }); 80 | } 81 | }; 82 | 83 | export const deletePost = (_id, channel) => async (dispatch) => { 84 | console.log(channel) 85 | dispatch({ type: DELETE_POST_REQUEST }); 86 | try { 87 | const res = await axios.delete( 88 | `https://mauve-rabbit-gown.cyclic.app/user/delete/${channel}/${_id}` 89 | ); 90 | const data = await res.data; 91 | dispatch({ type: DELETE_POST_SUCCESS, payload: data }); 92 | return getChannelsPosts(channel); 93 | } catch (e) { 94 | dispatch({ type: DELETE_POST_FAILURE }); 95 | } 96 | }; 97 | -------------------------------------------------------------------------------- /client/src/redux/posts/post.reducer.js: -------------------------------------------------------------------------------- 1 | import { 2 | CREATE_POST_FAILURE, 3 | CREATE_POST_REQUEST, 4 | CREATE_POST_SUCCESS, 5 | DELETE_POST_FAILURE, 6 | DELETE_POST_REQUEST, 7 | DELETE_POST_SUCCESS, 8 | GET_POST_FAILURE, 9 | GET_POST_REQUEST, 10 | GET_POST_SUCCESS, 11 | UPDATE_POST_FAILURE, 12 | UPDATE_POST_REQUEST, 13 | UPDATE_POST_SUCCESS, 14 | } from "./post.types"; 15 | 16 | const initialState = { 17 | loading: false, 18 | error: false, 19 | data: [], 20 | }; 21 | 22 | export const postReducer = (state = initialState, { type, payload }) => { 23 | switch (type) { 24 | case GET_POST_REQUEST: { 25 | return { 26 | ...state, 27 | loading: true, 28 | error: false, 29 | }; 30 | } 31 | case GET_POST_SUCCESS: { 32 | return { 33 | ...state, 34 | loading: false, 35 | error: false, 36 | data: payload, 37 | }; 38 | } 39 | case GET_POST_FAILURE: { 40 | return { 41 | ...state, 42 | loading: false, 43 | error: true, 44 | }; 45 | } 46 | case CREATE_POST_REQUEST: { 47 | return { 48 | ...state, 49 | loading: true, 50 | error: false, 51 | }; 52 | } 53 | case CREATE_POST_SUCCESS: { 54 | return { 55 | ...state, 56 | loading: false, 57 | error: false, 58 | data: [...state.data, payload], 59 | }; 60 | } 61 | case CREATE_POST_FAILURE: { 62 | return { 63 | ...state, 64 | loading: false, 65 | error: true, 66 | }; 67 | } 68 | case UPDATE_POST_REQUEST: { 69 | return { 70 | ...state, 71 | loading: true, 72 | error: false, 73 | }; 74 | } 75 | case UPDATE_POST_SUCCESS: { 76 | const id = payload._id; 77 | const updatedPost = state.data.map((post) => { 78 | if (post._id === id) { 79 | return payload; 80 | } 81 | return post; 82 | }); 83 | return { 84 | ...state, 85 | loading: false, 86 | error: false, 87 | data: updatedPost, 88 | }; 89 | } 90 | case UPDATE_POST_FAILURE: { 91 | return { 92 | ...state, 93 | loading: false, 94 | error: true, 95 | }; 96 | } 97 | case DELETE_POST_REQUEST: { 98 | return { 99 | ...state, 100 | loading: true, 101 | error: false, 102 | }; 103 | } 104 | case DELETE_POST_SUCCESS: { 105 | const id = payload._id; 106 | const filteredPost = state.data.map((post) => post._id !== id); 107 | return { 108 | ...state, 109 | loading: false, 110 | error: false, 111 | data: filteredPost, 112 | }; 113 | } 114 | case DELETE_POST_FAILURE: { 115 | return { 116 | ...state, 117 | loading: false, 118 | error: true, 119 | }; 120 | } 121 | default: { 122 | return state; 123 | } 124 | } 125 | }; 126 | -------------------------------------------------------------------------------- /client/src/redux/admin/admin.reducer.js: -------------------------------------------------------------------------------- 1 | import { 2 | CREATE_USER_FAILURE, 3 | CREATE_USER_REQUEST, 4 | CREATE_USER_SUCCESS, 5 | DELETE_USER_FAILURE, 6 | DELETE_USER_REQUEST, 7 | DELETE_USER_SUCCESS, 8 | GET_USER_FAILURE, 9 | GET_USER_REQUEST, 10 | GET_USER_SUCCESS, 11 | } from "./admin.types"; 12 | 13 | const initialState = { 14 | loading: false, 15 | error: false, 16 | data: [], 17 | }; 18 | 19 | export const adminReducer = (state = initialState, { type, payload }) => { 20 | switch (type) { 21 | case GET_USER_REQUEST: { 22 | return { 23 | ...state, 24 | loading: true, 25 | error: false, 26 | }; 27 | } 28 | case GET_USER_SUCCESS: { 29 | return { 30 | ...state, 31 | loading: false, 32 | error: false, 33 | data: payload, 34 | }; 35 | } 36 | case GET_USER_FAILURE: { 37 | return { 38 | ...state, 39 | loading: false, 40 | error: true, 41 | }; 42 | } 43 | case CREATE_USER_REQUEST: { 44 | return { 45 | ...state, 46 | loading: true, 47 | error: false, 48 | }; 49 | } 50 | case CREATE_USER_SUCCESS: { 51 | return { 52 | ...state, 53 | loading: false, 54 | error: false, 55 | data: [...state.data, payload], 56 | }; 57 | } 58 | case CREATE_USER_FAILURE: { 59 | return { 60 | ...state, 61 | loading: false, 62 | error: true, 63 | }; 64 | } 65 | // case UPDATE_USER_REQUEST: { 66 | // return { 67 | // ...state, 68 | // loading: true, 69 | // error: false, 70 | // }; 71 | // } 72 | // case UPDATE_USER_SUCCESS: { 73 | // const id = payload._id; 74 | // const updatedPost = state.data.map((post) => { 75 | // if (post._id === id) { 76 | // return payload; 77 | // } 78 | // return post; 79 | // }); 80 | // return { 81 | // ...state, 82 | // loading: false, 83 | // error: false, 84 | // data: updatedPost, 85 | // }; 86 | // } 87 | // case UPDATE_USER_FAILURE: { 88 | // return { 89 | // ...state, 90 | // loading: false, 91 | // error: true, 92 | // }; 93 | // } 94 | case DELETE_USER_REQUEST: { 95 | return { 96 | ...state, 97 | loading: true, 98 | error: false, 99 | }; 100 | } 101 | case DELETE_USER_SUCCESS: { 102 | const id = payload._id; 103 | const filteredPost = state.data.map((post) => post._id !== id); 104 | return { 105 | ...state, 106 | loading: false, 107 | error: false, 108 | data: filteredPost, 109 | }; 110 | } 111 | case DELETE_USER_FAILURE: { 112 | return { 113 | ...state, 114 | loading: false, 115 | error: true, 116 | }; 117 | } 118 | default: { 119 | return state; 120 | } 121 | } 122 | }; 123 | -------------------------------------------------------------------------------- /server/src/config/twitter.oauth.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const express = require("express"); 3 | const cors = require("cors"); 4 | const Router = express.Router(); 5 | const jwt = require("jsonwebtoken"); 6 | const TwitterStrategy = require("passport-twitter").Strategy; 7 | const passport = require("passport"); 8 | const session = require("express-session"); 9 | const UserModel = require("../models/user.model"); 10 | const TWITTER_CONSUMER_KEY = process.env.TWITTER_CONSUMER_KEY; 11 | const TWITTER_CONSUMER_SECRET = process.env.TWITTER_CONSUMER_SECRET; 12 | const JWT_SECRET = process.env.JWT_SECRET; 13 | 14 | Router.use(cors({ origin: `http://localhost:3000`, credentials: true })); 15 | 16 | Router.use( 17 | session({ 18 | secret: "secretcode", 19 | resave: true, 20 | saveUninitialized: true, 21 | // cookie: { 22 | // sameSite: "none", 23 | // secure: true, 24 | // maxAge: 1000 * 60 * 60 * 60 * 24 * 7, 25 | // }, 26 | }) 27 | ); 28 | 29 | Router.use(passport.initialize()); 30 | Router.use(passport.session()); 31 | 32 | passport.serializeUser(function (user, done) { 33 | done(null, user); 34 | }); 35 | 36 | passport.deserializeUser(function (user, done) { 37 | done(null, user); 38 | }); 39 | 40 | passport.use( 41 | new TwitterStrategy( 42 | { 43 | consumerKey: TWITTER_CONSUMER_KEY, 44 | consumerSecret: TWITTER_CONSUMER_SECRET, 45 | callbackURL: `/auth/twitter/callback`, 46 | }, 47 | async function (token, tokenSecret, profile, cb) { 48 | let { email } = profile._json; 49 | const user = await UserModel.findOne({ email }); 50 | if (!user) { 51 | const newUser = new UserModel({ 52 | name, 53 | email, 54 | password: "1234", 55 | }); 56 | newUser.save(); 57 | let { _id } = await UserModel.findOne({ email }); 58 | token = jwt.sign({ _id }, JWT_SECRET, { 59 | expiresIn: "6h", 60 | }); 61 | profile.token = token; 62 | return cb(null, profile); 63 | } 64 | token = jwt.sign({ _id: user._id }, JWT_SECRET, { 65 | expiresIn: "6h", 66 | }); 67 | profile.token = token; 68 | return cb(null, profile); 69 | } 70 | ) 71 | ); 72 | 73 | Router.get("/", passport.authenticate("twitter")); 74 | 75 | Router.get( 76 | "/callback", 77 | passport.authenticate("twitter", { 78 | failureRedirect: "http://localhost:3000", 79 | }), 80 | function (req, res) { 81 | // Successful authentication, redirect home. 82 | res.redirect("http://localhost:3000"); 83 | } 84 | ); 85 | 86 | Router.get("/getuser", (req, res) => { 87 | if (req.user) { 88 | return res.status(200).send(req.user); 89 | } 90 | return res.status(401).send("Please Login first"); 91 | }); 92 | 93 | Router.get("/logout", (req, res) => { 94 | req.logout((err, done) => { 95 | if (err) { 96 | return res.send("Something went wrong"); 97 | } 98 | return res.send("Logout Successfully"); 99 | }); 100 | }); 101 | 102 | module.exports = Router; 103 | -------------------------------------------------------------------------------- /client/src/pages/InstagramPage.jsx: -------------------------------------------------------------------------------- 1 | import { 2 | Box, 3 | Card, 4 | CardHeader, 5 | CardBody, 6 | CardFooter, 7 | Heading, 8 | Text, 9 | Stack, 10 | Button, 11 | HStack, 12 | SimpleGrid, 13 | Editable, 14 | EditablePreview, 15 | EditableTextarea, 16 | } from "@chakra-ui/react"; 17 | import React, { useEffect, useState } from "react"; 18 | import { useDispatch, useSelector } from "react-redux"; 19 | import { deletePost, getChannelsPosts } from "../redux/posts/post.action"; 20 | import DatePicker from "react-datepicker"; 21 | import "react-datepicker/dist/react-datepicker.css"; 22 | 23 | const InstagramPage = () => { 24 | const { data } = useSelector((store) => store.posts); 25 | const dispatch = useDispatch(); 26 | const [editDate, setEditDate] = useState({}); 27 | const [posts, setPosts] = useState([]); 28 | 29 | useEffect(() => { 30 | dispatch(getChannelsPosts("instagram_posts")); 31 | }, []); 32 | 33 | const handleDelete = (_id) => { 34 | dispatch(deletePost(_id, "instagram_posts")); 35 | // dispatch(getChannelsPosts("facebook_posts")); 36 | }; 37 | 38 | return ( 39 | 40 | 46 | {data?.map((el) => ( 47 | 48 | 49 | 50 | {/* {el.end.split("T")[0]} */} 51 | {/* 52 | 53 | setEditDate(e.target.value)} 55 | /> 56 | */} 57 | setEditDate({ start, end: start })} 62 | /> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | {/* 72 | {el.title}. 73 | */} 74 | 75 | 78 | 85 | 86 | 87 | ))} 88 | 89 | 90 | ); 91 | }; 92 | 93 | export default InstagramPage; 94 | -------------------------------------------------------------------------------- /client/src/components/shubham/Data/Data.js: -------------------------------------------------------------------------------- 1 | // Sidebar imports 2 | import { 3 | UilEstate, 4 | UilClipboardAlt, 5 | UilUsersAlt, 6 | UilPackage, 7 | UilChart, 8 | UilSignOutAlt, 9 | UilFastMail, 10 | } from "@iconscout/react-unicons"; 11 | 12 | // Analytics Cards imports 13 | import { UilUsdSquare, UilMoneyWithdrawal } from "@iconscout/react-unicons"; 14 | import { keyboard } from "@testing-library/user-event/dist/keyboard"; 15 | 16 | // Recent Card Imports 17 | import img1 from "../imgs/img1.png"; 18 | import img2 from "../imgs/img2.png"; 19 | import img3 from "../imgs/img3.png"; 20 | 21 | // Sidebar Data 22 | export const SidebarData = [ 23 | { 24 | icon: UilEstate, 25 | heading: "Dashboard", 26 | }, 27 | { 28 | icon: UilClipboardAlt, 29 | heading: "Orders", 30 | }, 31 | { 32 | icon: UilUsersAlt, 33 | heading: "Customers", 34 | }, 35 | { 36 | icon: UilPackage, 37 | heading: "Products", 38 | }, 39 | { 40 | icon: UilChart, 41 | heading: "Analytics", 42 | }, 43 | ]; 44 | 45 | // Analytics Cards Data 46 | export const cardsData = [ 47 | { 48 | title: "Users", 49 | color: { 50 | backGround: "linear-gradient(180deg, #bb67ff 0%, #c484f3 100%)", 51 | boxShadow: "0px 10px 20px 0px #e0c6f5", 52 | }, 53 | barValue: 70, 54 | value: "25,970", 55 | png: UilUsersAlt, 56 | series: [ 57 | { 58 | name: "Sales", 59 | data: [31, 40, 28, 51, 42, 109, 100], 60 | }, 61 | ], 62 | }, 63 | { 64 | title: "Posts", 65 | color: { 66 | backGround: "linear-gradient(180deg, #FF919D 0%, #FC929D 100%)", 67 | boxShadow: "0px 10px 20px 0px #FDC0C7", 68 | }, 69 | barValue: 80, 70 | value: "14,270", 71 | png: UilFastMail, 72 | series: [ 73 | { 74 | name: "Revenue", 75 | data: [10, 100, 50, 70, 80, 30, 40], 76 | }, 77 | ], 78 | }, 79 | { 80 | title: "Popularity", 81 | color: { 82 | backGround: 83 | "linear-gradient(rgb(248, 212, 154) -146.42%, rgb(255 202 113) -46.42%)", 84 | boxShadow: "0px 10px 20px 0px #F9D59B", 85 | }, 86 | barValue: 60, 87 | value: "4,270", 88 | png: UilClipboardAlt, 89 | series: [ 90 | { 91 | name: "Expenses", 92 | data: [10, 25, 15, 30, 12, 15, 20], 93 | }, 94 | ], 95 | }, 96 | ]; 97 | 98 | // Recent Update Card Data 99 | export const UpdatesData = [ 100 | { 101 | img: img1, 102 | name: "Shubham Gaikwad", 103 | // noti: "has great problem solving ability.", 104 | }, 105 | { 106 | img: img2, 107 | name: "Anjali Dhanjode", 108 | // noti: "has experties in UI Developement.", 109 | }, 110 | { 111 | img: img3, 112 | name: "Prakash Rajesh Singh", 113 | // noti: "has ordered Apple smart watch, samsung Gear 2500mh battery.", 114 | }, 115 | , 116 | { 117 | img: img3, 118 | name: "Sandeep Gond", 119 | // noti: "has ordered Apple smart watch, samsung Gear 2500mh battery.", 120 | }, 121 | , 122 | { 123 | img: img3, 124 | name: "Ajay Jha", 125 | // noti: "has ordered Apple smart watch, samsung Gear 2500mh battery.", 126 | }, 127 | ]; 128 | -------------------------------------------------------------------------------- /server/src/config/facebook-oauth.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const express = require("express"); 3 | const cors = require("cors"); 4 | const Router = express.Router(); 5 | const jwt = require("jsonwebtoken"); 6 | const FacebookStrategy = require("passport-facebook").Strategy; 7 | const passport = require("passport"); 8 | const session = require("express-session"); 9 | const UserModel = require("../models/user.model"); 10 | const FACEBOOK_APP_ID = process.env.FACEBOOK_APP_ID; 11 | const FACEBOOK_APP_SECRET = process.env.FACEBOOK_APP_SECRET; 12 | const JWT_SECRET = process.env.JWT_SECRET; 13 | 14 | Router.use(cors({ origin: `http://localhost:3000`, credentials: true })); 15 | 16 | Router.use( 17 | session({ 18 | secret: "secretcode", 19 | resave: true, 20 | saveUninitialized: true, 21 | // cookie: { 22 | // sameSite: "none", 23 | // secure: true, 24 | // maxAge: 1000 * 60 * 60 * 60 * 24 * 7, 25 | // }, 26 | }) 27 | ); 28 | 29 | Router.use(passport.initialize()); 30 | Router.use(passport.session()); 31 | 32 | passport.serializeUser(function (user, done) { 33 | done(null, user); 34 | }); 35 | 36 | passport.deserializeUser(function (user, done) { 37 | done(null, user); 38 | }); 39 | 40 | passport.use( 41 | new FacebookStrategy( 42 | { 43 | clientID: FACEBOOK_APP_ID, 44 | clientSecret: FACEBOOK_APP_SECRET, 45 | callbackURL: `/auth/facebook/callback`, 46 | }, 47 | async function (accessToken, refreshToken, profile, cb) { 48 | let { name, email } = profile._json; 49 | let res = await fetch( 50 | `https://graph.facebook.com/v15.0/me?fields=id,name,email,picture,gender&access_token=${accessToken}` 51 | ); 52 | let data = await res.json(); 53 | // console.log(profile); 54 | // const user = await UserModel.findOne({ email }); 55 | // if (!user) { 56 | // const newUser = new UserModel({ 57 | // name, 58 | // email, 59 | // password: "1234", 60 | // }); 61 | // newUser.save(); 62 | // let { _id } = await UserModel.findOne({ email }); 63 | // const token = jwt.sign({ _id }, JWT_SECRET, { 64 | // expiresIn: "6h", 65 | // }); 66 | // profile.token = token; 67 | // return cb(null, profile); 68 | // } 69 | // const token = jwt.sign({ _id: user._id }, JWT_SECRET, { 70 | // expiresIn: "6h", 71 | // }); 72 | // profile.token = token; 73 | return cb(null, profile); 74 | } 75 | ) 76 | ); 77 | 78 | Router.get("/", passport.authenticate("facebook")); 79 | 80 | Router.get( 81 | "/callback", 82 | passport.authenticate("facebook", { 83 | failureRedirect: "http://localhost:3000", 84 | }), 85 | function (req, res) { 86 | // Successful authentication, redirect home. 87 | res.redirect("http://localhost:3000"); 88 | } 89 | ); 90 | 91 | Router.get("/getuser", (req, res) => { 92 | if (req.user) { 93 | return res.status(200).send(req.user); 94 | } 95 | return res.status(401).send("Please Login first"); 96 | }); 97 | 98 | Router.get("/logout", (req, res) => { 99 | req.logout((err, done) => { 100 | if (err) { 101 | return res.send("Something went wrong"); 102 | } 103 | return res.send("Logout Successfully"); 104 | }); 105 | }); 106 | 107 | module.exports = Router; 108 | -------------------------------------------------------------------------------- /client/src/components/prakash/Components/Footer/Footer.jsx: -------------------------------------------------------------------------------- 1 | import { Flex, Image, Text, } from "@chakra-ui/react"; 2 | import Eco from "../../images/logo.jpg" 3 | 4 | 5 | function Footer(){ 6 | 7 | return ( 8 | 9 | 10 | 11 | 12 | Download 13 | 14 | 15 | 16 | 17 | Copyright ©2022 Ecotone | Privacy | Terms | Security 18 | 19 | 20 | 21 | Tools 22 | Publishing 23 | Analytics 24 | Engagement 25 | Start Page 26 | Extras 27 | 28 | 29 | 30 | 31 | Resources 32 | Blog 33 | Content Library 34 | Browser Extension 35 | Free Image Editor 36 | 37 | 38 | 39 | 40 | Support 41 | Help Center 42 | Status 43 | Changelog 44 | Product Roadmap 45 | 46 | 47 | 48 | 49 | Company 50 | About 51 | Transparency 52 | Careers 53 | Accessibility 54 | Press 55 | Sitemap 56 | 57 | 58 | 59 | 60 | 61 | 62 | ) 63 | } 64 | 65 | export default Footer; 66 | -------------------------------------------------------------------------------- /client/src/routes/AllRoutes.jsx: -------------------------------------------------------------------------------- 1 | import { Flex } from "@chakra-ui/react"; 2 | import React from "react"; 3 | import { Route, Routes, useLocation } from "react-router-dom"; 4 | import { Channels } from "../components/anjali/Channels"; 5 | import Footer from "../components/prakash/Components/Footer/Footer"; 6 | import Navbar from "../components/prakash/Components/Navbar/Navbar"; 7 | import AltNavbar from "../components/shubham/AltNavbar"; 8 | import CalendarComponent from "../components/shubham/Calendar"; 9 | import SideBar from "../components/shubham/SideBar"; 10 | import FacebookPage from "../pages/FacebookPage"; 11 | import Home from "../pages/Home"; 12 | import InstagramPage from "../pages/InstagramPage"; 13 | import LinkedinPage from "../pages/LinkedinPage"; 14 | import Login from "../pages/Login"; 15 | import Pricing from "../pages/PricePage"; 16 | import { Publishing } from "../pages/Publishing"; 17 | import Register from "../pages/Register"; 18 | import AdminPrivateAuth from "./AdminPrivateAuth"; 19 | import PublishingRoutes from "./PublishingRoutes"; 20 | 21 | const AllRoutes = () => { 22 | const location = useLocation(); 23 | 24 | if ( 25 | location.pathname === "/login" || 26 | location.pathname === "/register" || 27 | location.pathname === "/admin" 28 | ) { 29 | return ( 30 | 31 | }> 32 | }> 33 | 34 | ); 35 | } else if (location.pathname === "/channels") { 36 | return ( 37 | <> 38 | <> 39 | 40 | 41 | <> 42 | 43 | }> 44 | 45 | 46 | 47 | ); 48 | } else if ( 49 | location.pathname === "/publishing" || 50 | location.pathname === "/publishing/calender" || 51 | location.pathname === "/publishing/facebook" || 52 | location.pathname === "/publishing/instagram" || 53 | location.pathname === "/publishing/linkedin" 54 | ) { 55 | return ( 56 | <> 57 | 58 | 59 | 60 | 61 | 62 | 63 | ); 64 | } else { 65 | return ( 66 | <> 67 | <> 68 | 69 | 70 | <> 71 | 72 | }> 73 | }> 74 | 75 | 76 | <> 77 |