└── frontend
├── src
├── index.css
├── images
│ ├── Spur.png
│ ├── sdlc.png
│ └── logo1.png
├── components
│ ├── Post
│ │ ├── Scroll.css
│ │ └── CreatePost.js
│ ├── Messenger
│ │ ├── Scroll.css
│ │ ├── Conversations.js
│ │ ├── Messages.js
│ │ ├── ChatAside.js
│ │ └── MessengerDetails.js
│ ├── common
│ │ ├── Scroll.css
│ │ ├── TopDesign.js
│ │ └── Footer.js
│ ├── Sweetalert
│ │ └── sweetAlert.js
│ ├── Landingpage
│ │ ├── StaticHeading.js
│ │ ├── Bubble.css
│ │ └── StaticRowOne.js
│ ├── Admin
│ │ ├── Dashboard
│ │ │ ├── PieChartUser.js
│ │ │ ├── BarChart.js
│ │ │ ├── LineChart.js
│ │ │ ├── Dashboard.js
│ │ │ └── DashboardDesign.js
│ │ ├── AdminRegister.js
│ │ ├── AdminLogin.js
│ │ ├── Report
│ │ │ └── Report.js
│ │ ├── AdminAside.js
│ │ ├── UserManagement
│ │ │ └── UpdateUser.js
│ │ └── InterviewerManagement
│ │ │ └── UpdateInterviewer.js
│ ├── Interviewer
│ │ ├── Dashboard
│ │ │ ├── BarChart.js
│ │ │ ├── LineChart.js
│ │ │ ├── Dashboard.js
│ │ │ └── DashboardDesign.js
│ │ ├── Wallet
│ │ │ ├── shimmer.css
│ │ │ ├── WalletDesign.js
│ │ │ └── Wallet.js
│ │ ├── Requests
│ │ │ └── AllRequests.js
│ │ ├── Upcomming
│ │ │ ├── InterAllUpcomming.js
│ │ │ └── InterUpcommings.js
│ │ ├── InterStatistics.js
│ │ └── Report
│ │ │ └── Report.js
│ ├── About
│ │ ├── UserDetails.js
│ │ ├── Statistics.js
│ │ ├── InterStatistics.js
│ │ └── About.js
│ ├── User
│ │ ├── Upcomming
│ │ │ ├── AllUpcomming.js
│ │ │ └── Upcomming.js
│ │ ├── Feedback
│ │ │ └── ViewFeedback.js
│ │ ├── Interviews
│ │ │ ├── AllCompletedInterviews.js
│ │ │ └── CompletedInterviews.js
│ │ ├── Notification
│ │ │ ├── AllNotifications.js
│ │ │ └── Notification.js
│ │ ├── Statistics.js
│ │ └── Aside.js
│ └── Profile
│ │ └── PasswordChange.js
├── axiosinstance.js
├── Layouts
│ ├── userLayout.js
│ └── adminLayout.js
├── Redux
│ ├── Features
│ │ ├── userData.js
│ │ ├── postData.js
│ │ ├── adminData.js
│ │ └── notificationData.js
│ └── store.js
├── pages
│ ├── Common
│ │ ├── ProfilePage.js
│ │ ├── LoginPage.js
│ │ ├── JoinNowPage.js
│ │ ├── Home.js
│ │ ├── AboutPage.js
│ │ ├── MessengerPage.js
│ │ ├── PostsPage.js
│ │ └── UserHome.js
│ ├── Admin
│ │ ├── AdminLoginPage.js
│ │ ├── AdminRegisterPage.js
│ │ ├── ReportPage.js
│ │ ├── ManageUserPage.js
│ │ ├── UpdateUserPage.js
│ │ ├── MangeInterviewPage.js
│ │ ├── ManageInterviewerPage.js
│ │ ├── AdminDashboardPage.js
│ │ └── UpdateInterviewerPage.js
│ ├── Interviewer
│ │ ├── DashboardPage.js
│ │ ├── InterviewerReportPage.js
│ │ ├── InterviewRequestPage.js
│ │ ├── InterviewManagementPage.js
│ │ ├── WalletPage.js
│ │ └── InterviewerUpcommingPage.js
│ └── User
│ │ ├── PaymentPage.js
│ │ ├── FeedbackPage.js
│ │ ├── UserUpcommingPage.js
│ │ ├── userNotification.js
│ │ └── CompletedInterviewsPage.js
├── App.css
├── index.js
├── Theme.js
└── App.js
├── public
├── robots.txt
├── favicon.ico
├── manifest.json
└── index.html
├── .gitignore
├── package.json
└── README.md
/frontend/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding:0;
4 | }
5 |
--------------------------------------------------------------------------------
/frontend/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/frontend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sudheeshmpgt/spur-adminUI/HEAD/frontend/public/favicon.ico
--------------------------------------------------------------------------------
/frontend/src/images/Spur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sudheeshmpgt/spur-adminUI/HEAD/frontend/src/images/Spur.png
--------------------------------------------------------------------------------
/frontend/src/images/sdlc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sudheeshmpgt/spur-adminUI/HEAD/frontend/src/images/sdlc.png
--------------------------------------------------------------------------------
/frontend/src/images/logo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sudheeshmpgt/spur-adminUI/HEAD/frontend/src/images/logo1.png
--------------------------------------------------------------------------------
/frontend/src/components/Post/Scroll.css:
--------------------------------------------------------------------------------
1 | .scrollbar-hidden::-webkit-scrollbar {
2 | display: none;
3 | }
4 | .scrollbar-hidden {
5 | -ms-overflow-style: none;
6 | scrollbar-width: none;
7 | }
--------------------------------------------------------------------------------
/frontend/src/components/Messenger/Scroll.css:
--------------------------------------------------------------------------------
1 | .scrollbar-hidden::-webkit-scrollbar {
2 | display: none;
3 | }
4 | .scrollbar-hidden {
5 | -ms-overflow-style: none;
6 | scrollbar-width: none;
7 | }
--------------------------------------------------------------------------------
/frontend/src/components/common/Scroll.css:
--------------------------------------------------------------------------------
1 | .scrollbar-hidden::-webkit-scrollbar {
2 | display: none;
3 | }
4 | .scrollbar-hidden {
5 | -ms-overflow-style: none;
6 | scrollbar-width: none;
7 | }
--------------------------------------------------------------------------------
/frontend/src/axiosinstance.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 |
3 | const instance = axios.create({
4 | baseURL:'https://spur-backend.herokuapp.com/'
5 | });
6 |
7 | // instance.defaults.headers.common['Authorisation'] = 'Auth from instance'
8 |
9 | export default instance;
--------------------------------------------------------------------------------
/frontend/src/components/common/TopDesign.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | function TopDesign() {
4 | return (
5 |
8 | )
9 | }
10 |
11 | export default TopDesign
--------------------------------------------------------------------------------
/frontend/src/Layouts/userLayout.js:
--------------------------------------------------------------------------------
1 | import { Grid } from '@mui/material'
2 | import Header from '../components/common/Header'
3 | import TopDesign from '../components/common/TopDesign'
4 |
5 | function layout({children}) {
6 | return (
7 |
8 |
9 |
10 | {children}
11 |
12 | )
13 | }
14 |
15 | export default layout
--------------------------------------------------------------------------------
/frontend/.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.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/frontend/src/Layouts/adminLayout.js:
--------------------------------------------------------------------------------
1 | import { Grid } from '@mui/material'
2 | import AdminHeader from '../components/Admin/AdminHeader'
3 | import TopDesign from '../components/common/TopDesign'
4 |
5 | function adminLayout({children}) {
6 | return (
7 |
8 |
9 |
10 | {children}
11 |
12 | )
13 | }
14 |
15 | export default adminLayout
--------------------------------------------------------------------------------
/frontend/src/Redux/Features/userData.js:
--------------------------------------------------------------------------------
1 | import {createSlice} from '@reduxjs/toolkit';
2 |
3 | export const userDataSlice = createSlice({
4 | name: 'userData',
5 | initialState: {value:{}},
6 | reducers: {
7 | login : (state, action) => {
8 | state.value = action.payload;
9 | }
10 | }
11 | });
12 |
13 | export const {login} = userDataSlice.actions;
14 | export default userDataSlice.reducer;
--------------------------------------------------------------------------------
/frontend/src/components/Sweetalert/sweetAlert.js:
--------------------------------------------------------------------------------
1 | import Swal from 'sweetalert2';
2 |
3 | const Toast = Swal.mixin({
4 | toast: true,
5 | position: 'top-start',
6 | showConfirmButton: false,
7 | timer: 3000,
8 | didOpen: (toast) => {
9 | toast.addEventListener('mouseenter', Swal.stopTimer)
10 | toast.addEventListener('mouseleave', Swal.resumeTimer)
11 | }
12 | })
13 |
14 | export default Toast;
--------------------------------------------------------------------------------
/frontend/src/Redux/Features/postData.js:
--------------------------------------------------------------------------------
1 | import {createSlice} from '@reduxjs/toolkit';
2 |
3 | export const postDataSlice = createSlice({
4 | name: 'postData',
5 | initialState: {value:[]},
6 | reducers: {
7 | createPost : (state, action) => {
8 | state.value = action.payload;
9 | }
10 | }
11 | });
12 |
13 | export const {createPost} = postDataSlice.actions;
14 | export default postDataSlice.reducer;
--------------------------------------------------------------------------------
/frontend/src/pages/Common/ProfilePage.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Grid } from "@mui/material";
3 | import UserLayout from "../../Layouts/userLayout";
4 | import ProfileDesign from "../../components/Profile/ProfileDesign";
5 |
6 | function Profile() {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 | );
14 | }
15 |
16 | export default Profile;
17 |
--------------------------------------------------------------------------------
/frontend/src/Redux/Features/adminData.js:
--------------------------------------------------------------------------------
1 | import {createSlice} from '@reduxjs/toolkit';
2 |
3 | export const adminDataSlice = createSlice({
4 | name: 'adminData',
5 | initialState: {value:{}},
6 | reducers: {
7 | adminLogin : (state, action) => {
8 | state.value = action.payload;
9 | }
10 | }
11 | });
12 |
13 | export const {adminLogin} = adminDataSlice.actions;
14 | export default adminDataSlice.reducer;
--------------------------------------------------------------------------------
/frontend/src/Redux/Features/notificationData.js:
--------------------------------------------------------------------------------
1 | import {createSlice} from '@reduxjs/toolkit';
2 |
3 | export const notificationDataSlice = createSlice({
4 | name: 'notificationData',
5 | initialState: {value:[]},
6 | reducers: {
7 | notification : (state, action) => {
8 | state.value = action.payload;
9 | }
10 | }
11 | });
12 |
13 | export const { notification} = notificationDataSlice.actions;
14 | export default notificationDataSlice.reducer;
--------------------------------------------------------------------------------
/frontend/src/pages/Common/LoginPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import UserLayout from "../../Layouts/userLayout";
4 | import Login from "../../components/Login/Login";
5 |
6 | function LoginPage() {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | );
16 | }
17 |
18 | export default LoginPage;
19 |
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/AdminLoginPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminLogin from "../../components/Admin/AdminLogin";
4 | import AdminLayout from "../../Layouts/adminLayout"
5 |
6 | function AdminLoginPage() {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | )
16 | }
17 |
18 | export default AdminLoginPage
--------------------------------------------------------------------------------
/frontend/src/pages/Common/JoinNowPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import JoinNow from "../../components/UserRegister/JoinNow";
4 | import UserLayout from "../../Layouts/userLayout";
5 |
6 | function JoinNowPage() {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | );
16 | }
17 |
18 | export default JoinNowPage;
19 |
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/AdminRegisterPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminRegister from "../../components/Admin/AdminRegister";
4 | import AdminLayout from "../../Layouts/adminLayout"
5 |
6 | function AdminRegisterPage() {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | )
16 | }
17 |
18 | export default AdminRegisterPage
19 |
--------------------------------------------------------------------------------
/frontend/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 |
--------------------------------------------------------------------------------
/frontend/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | padding:0;
3 | margin:0;
4 | }
5 | .Rectangle {
6 | width:100%;
7 | height:360px;
8 | position:absolute;
9 | background-color: #80c7ff;
10 | z-index: -1;
11 | }
12 | .Ellipse{
13 | width:100%;
14 | margin-top: 230px;
15 | height:250px;
16 | position:absolute;
17 | border-radius: 45% 45% 45% 45%;
18 | background-color: #80c7ff;
19 | z-index: -1;
20 | }
21 | .EllipseFooter{
22 | width:100%;
23 | height:250px;
24 | margin-bottom: 10;
25 | position:absolute;
26 | border-radius: 45% 45% 45% 45%;
27 | background-color: #80c7ff;
28 | z-index: -1;
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/frontend/src/components/Landingpage/StaticHeading.js:
--------------------------------------------------------------------------------
1 | import { Typography } from '@mui/material'
2 | import { Box } from '@mui/system'
3 | import React from 'react'
4 |
5 | function StaticHeading() {
6 | return (
7 |
8 |
17 | Unhappy with your performance at interviews?
18 |
19 |
20 | )
21 | }
22 |
23 | export default StaticHeading
--------------------------------------------------------------------------------
/frontend/src/Redux/store.js:
--------------------------------------------------------------------------------
1 | import {configureStore} from '@reduxjs/toolkit'
2 | import userReducer from '../Redux/Features/userData'
3 | import postReducer from '../Redux/Features/postData'
4 | import adminReducer from '../Redux/Features/adminData'
5 | import notificationReducer from '../Redux/Features/notificationData'
6 | import storage from 'redux-persist/lib/storage'
7 | import {persistReducer} from 'redux-persist'
8 | import {combineReducers} from 'redux'
9 |
10 | const persistConfig = {
11 | key: 'root',
12 | storage,
13 | }
14 |
15 | const reducer = combineReducers({
16 | userData: userReducer,
17 | postData: postReducer,
18 | notificationData : notificationReducer,
19 | adminData: adminReducer
20 | })
21 |
22 | const persistedReducer = persistReducer(persistConfig, reducer)
23 |
24 | const store = configureStore({
25 | reducer: persistedReducer,
26 | })
27 |
28 | export default store;
--------------------------------------------------------------------------------
/frontend/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import { BrowserRouter } from 'react-router-dom'
4 | import './index.css';
5 | import App from './App';
6 | import { Theme } from './Theme'
7 | import { ThemeProvider } from '@mui/material/styles'
8 | import { Provider } from 'react-redux'
9 | import store from '../src/Redux/store'
10 | import { persistStore } from 'redux-persist'
11 | import { PersistGate } from 'redux-persist/integration/react'
12 |
13 | const persistor = persistStore(store);
14 |
15 | const root = ReactDOM.createRoot(document.getElementById('root'));
16 | root.render(
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
--------------------------------------------------------------------------------
/frontend/src/components/Admin/Dashboard/PieChartUser.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Pie } from 'react-chartjs-2'
3 | import { Chart, registerables } from 'chart.js'
4 | Chart.register(...registerables)
5 |
6 | function PieChartUser({ datas}) {
7 | const value = ["Interviewer", "Interviewee"]
8 | return (
9 |
24 | )
25 | }
26 |
27 | export default PieChartUser
--------------------------------------------------------------------------------
/frontend/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
15 | Spur
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/frontend/src/pages/Common/Home.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import { Box, Grid } from "@mui/material";
3 | import UserLayout from "../../Layouts/userLayout";
4 | import StaticContents from "../../components/Landingpage/StaticHeading";
5 | import StaticRowOne from "../../components/Landingpage/StaticRowOne";
6 | import Footer from "../../components/common/Footer";
7 | import { useNavigate } from "react-router-dom";
8 |
9 | function Home() {
10 | const [token, setToken] = useState("");
11 |
12 | const navigate = useNavigate();
13 | useEffect(() => {
14 | const token = localStorage.getItem("usertoken");
15 | setToken(token);
16 | }, [token]);
17 |
18 | if (token) {
19 | navigate("/home");
20 | }
21 |
22 | return (
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | );
33 | }
34 |
35 | export default Home;
36 |
--------------------------------------------------------------------------------
/frontend/src/pages/Interviewer/DashboardPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import Dashboard from "../../components/Interviewer/Dashboard/Dashboard";
4 | import InterAside from "../../components/Interviewer/InterAside";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function DashboardPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
27 |
28 |
33 |
34 |
35 |
36 |
37 | )
38 | }
39 |
40 | export default DashboardPage
--------------------------------------------------------------------------------
/frontend/src/pages/User/PaymentPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import Aside from "../../components/User/Aside";
4 | import UserLayout from "../../Layouts/userLayout";
5 | import Payment from "../../components/User/Notification/Payment";
6 |
7 | function PaymentPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default PaymentPage
--------------------------------------------------------------------------------
/frontend/src/pages/User/FeedbackPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import Aside from "../../components/User/Aside";
4 | import ViewFeedback from "../../components/User/Feedback/ViewFeedback";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function FeedbackPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default FeedbackPage
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/ReportPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import Report from "../../components/Admin/Report/Report";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function ReportPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default ReportPage
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Dashboard/BarChart.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react'
2 | import { Bar } from 'react-chartjs-2'
3 | import { Chart, registerables } from 'chart.js'
4 | Chart.register(...registerables)
5 |
6 | function BarChart({data}) {
7 | const value = ["Pending", "Credited"]
8 | return (
9 |
10 |
34 |
35 | )
36 | }
37 |
38 | export default BarChart
--------------------------------------------------------------------------------
/frontend/src/pages/User/UserUpcommingPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import Aside from "../../components/User/Aside";
4 | import UserLayout from "../../Layouts/userLayout";
5 | import AllPending from "../../components/User/Upcomming/AllUpcomming";
6 |
7 | function UserUpcommingPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default UserUpcommingPage
--------------------------------------------------------------------------------
/frontend/src/components/Admin/Dashboard/BarChart.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react'
2 | import { Bar } from 'react-chartjs-2'
3 | import { Chart, registerables } from 'chart.js'
4 | Chart.register(...registerables)
5 |
6 | function BarChart({data}) {
7 | const value = ["Post by interviewer", "Post by interviewees"]
8 | return (
9 |
10 |
34 |
35 | )
36 | }
37 |
38 | export default BarChart
--------------------------------------------------------------------------------
/frontend/src/pages/User/userNotification.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AllNotifications from '../../components/User/Notification/AllNotifications'
4 | import Aside from "../../components/User/Aside";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function userNotification() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default userNotification
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/ManageUserPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import MangeUser from "../../components/Admin/UserManagement/MangeUser";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function ManageUserPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default ManageUserPage
--------------------------------------------------------------------------------
/frontend/src/components/Landingpage/Bubble.css:
--------------------------------------------------------------------------------
1 | .box {
2 | width: 200px;
3 | margin: 1px auto;
4 | background: #cce8ff;
5 | padding: 20px;
6 | text-align: center;
7 | border-radius: 15px;
8 | position:relative;
9 | }
10 | .sb1:before {
11 | content: "";
12 | width: 0px;
13 | height: 0px;
14 | position: absolute;
15 | border-left: 10px solid #cce8ff;
16 | border-right: 10px solid transparent;
17 | border-top: 10px solid #cce8ff;
18 | border-bottom: 10px solid transparent;
19 | left: 100px;
20 | bottom: -20px;
21 | }
22 | .sb2:before {
23 | content: "";
24 | width: 0px;
25 | height: 0px;
26 | position: absolute;
27 | border-left: 10px solid #cce8ff;
28 | border-right: 10px solid transparent;
29 | border-top: 10px solid #cce8ff;
30 | border-bottom: 10px solid transparent;
31 | left: 60px;
32 | bottom: -20px;
33 | }
34 | .sb3:before {
35 | content: "";
36 | width: 0px;
37 | height: 0px;
38 | position: absolute;
39 | border-left: 10px solid #cce8ff;
40 | border-right: 10px solid transparent;
41 | border-top: 10px solid #cce8ff;
42 | border-bottom: 10px solid transparent;
43 | right: 60px;
44 | bottom: -20px;
45 | }
46 |
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/UpdateUserPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import UpdateUser from "../../components/Admin/UserManagement/UpdateUser";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function UpdateUserPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default UpdateUserPage
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/MangeInterviewPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import ManageInterview from "../../components/Admin/InteviewMangement/ManageInterview";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function MangeInterviewPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default MangeInterviewPage
--------------------------------------------------------------------------------
/frontend/src/pages/User/CompletedInterviewsPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import Aside from "../../components/User/Aside";
4 | import AllCompletedInterviews from "../../components/User/Interviews/AllCompletedInterviews";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function CompletedInterviewsPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default CompletedInterviewsPage;
--------------------------------------------------------------------------------
/frontend/src/Theme.js:
--------------------------------------------------------------------------------
1 | import {createTheme} from '@mui/material/styles'
2 |
3 | export const Theme = createTheme({
4 | palette:{
5 | primary:{
6 | main: '#80c7ff',
7 | light:'#99d2ff',
8 | },
9 | secondary:{
10 | main:'#cce8ff',
11 | dark:'#b3ddff'
12 | }
13 | },
14 | typography:{
15 | fontFamily:[
16 | 'Poppins, sans-serif',
17 | ],
18 | fontSize:'1rem',
19 | body2:{
20 | fontFamily:['Oswald, sans-serif', 'Poppins, sans-serif'],
21 | fontSize:'1rem'
22 | }
23 | },
24 | components:{
25 | MuiButton:{
26 | styleOverrides:{
27 | root:{
28 | textTransform:'none',
29 | }
30 | }
31 | },
32 | MuiIconButton:{
33 | defaultProps:{
34 | disableRipple: true,
35 | }
36 | },
37 | MuiButtonBase:{
38 | defaultProps:{
39 | disableRipple: true,
40 | }
41 | },
42 | MuiPaper:{
43 | defaultProps:{
44 | elevation: 5,
45 | }
46 | },
47 | MuiCard:{
48 | defaultProps:{
49 | elevation:5,
50 | }
51 | },
52 | MuiInputBase:{
53 | styleOverrides:{
54 | root:{
55 | // color:'white',
56 | }
57 | }
58 | }
59 | }
60 | })
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/ManageInterviewerPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import ManageInterviewer from "../../components/Admin/InterviewerManagement/ManageInterviewer";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function ManageInterviewerPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default ManageInterviewerPage
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/AdminDashboardPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import Dashboard from "../../components/Admin/Dashboard/Dashboard";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function AdminDashboardPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default AdminDashboardPage
--------------------------------------------------------------------------------
/frontend/src/pages/Interviewer/InterviewerReportPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import InterAside from "../../components/Interviewer/InterAside";
4 | import Report from "../../components/Interviewer/Report/Report";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function InterviewerReportPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default InterviewerReportPage
--------------------------------------------------------------------------------
/frontend/src/pages/Interviewer/InterviewRequestPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import InterAside from "../../components/Interviewer/InterAside";
4 | import Requests from "../../components/Interviewer/Requests/AllRequests";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function InterviewRequestPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | );
40 | }
41 |
42 | export default InterviewRequestPage;
43 |
--------------------------------------------------------------------------------
/frontend/src/pages/Interviewer/InterviewManagementPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import InterAside from "../../components/Interviewer/InterAside";
4 | import ManageInterview from "../../components/Interviewer/ManageInterview/ManageInterview";
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function InterviewManagementPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default InterviewManagementPage
--------------------------------------------------------------------------------
/frontend/src/pages/Interviewer/WalletPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import InterAside from "../../components/Interviewer/InterAside";
4 | import Wallet from "../../components/Interviewer/Wallet/Wallet"
5 | import UserLayout from "../../Layouts/userLayout";
6 |
7 | function WalletPage() {
8 |
9 | return (
10 |
11 |
12 |
20 |
21 |
22 |
23 |
30 |
31 |
36 |
37 |
38 |
39 |
40 | );
41 | }
42 |
43 | export default WalletPage
--------------------------------------------------------------------------------
/frontend/src/components/About/UserDetails.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Typography } from '@mui/material'
2 | import React from 'react'
3 |
4 | function UserDetails({userData}) {
5 | return (
6 |
7 |
8 |
9 | Name
10 | About
11 | Phone
12 | Email
13 |
14 |
15 | : {userData?.name}
16 | : {userData?.about}
17 | : {userData?.phone}
18 | : {userData?.email}
19 |
20 |
21 |
22 | )
23 | }
24 |
25 | export default UserDetails
--------------------------------------------------------------------------------
/frontend/src/pages/Admin/UpdateInterviewerPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import AdminAside from "../../components/Admin/AdminAside";
4 | import UpdateInterviewer from "../../components/Admin/InterviewerManagement/UpdateInterviewer";
5 | import AdminLayout from "../../Layouts/adminLayout"
6 |
7 | function UpdateInterviewerPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default UpdateInterviewerPage
--------------------------------------------------------------------------------
/frontend/src/pages/Interviewer/InterviewerUpcommingPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React from "react";
3 | import UserLayout from "../../Layouts/userLayout";
4 | import InterAside from "../../components/Interviewer/InterAside";
5 | import InterAllUpcomming from "../../components/Interviewer/Upcomming/InterAllUpcomming";
6 |
7 | function InterviewerUpcommingPage() {
8 | return (
9 |
10 |
11 |
19 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
42 | export default InterviewerUpcommingPage
--------------------------------------------------------------------------------
/frontend/src/components/Admin/Dashboard/LineChart.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react'
2 | import { Line } from 'react-chartjs-2'
3 | import { Chart, registerables } from 'chart.js'
4 | Chart.register(...registerables)
5 |
6 | function LineChart({data, value}) {
7 |
8 | return (
9 |
10 |
37 |
38 | )
39 | }
40 |
41 | export default LineChart
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Dashboard/LineChart.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react'
2 | import { Line } from 'react-chartjs-2'
3 | import { Chart, registerables } from 'chart.js'
4 | Chart.register(...registerables)
5 |
6 | function LineChart({data, value}) {
7 |
8 | return (
9 |
10 |
37 |
38 | )
39 | }
40 |
41 | export default LineChart
--------------------------------------------------------------------------------
/frontend/src/components/Messenger/Conversations.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Typography } from '@mui/material'
2 | import React, { useEffect } from 'react'
3 | import axios from '../../axiosinstance'
4 |
5 | function Conversations({ conversation, currentUser }) {
6 | const [user, setUser] = React.useState(null)
7 |
8 | useEffect(() => {
9 | const friendId = conversation.members.filter(member => member !== currentUser._id)
10 | const getUser = () => {
11 | axios.get(`api/user/details/${friendId}`, {
12 | headers: {
13 | 'authToken': localStorage.getItem("usertoken")
14 | }
15 | })
16 | .then(res => {
17 | setUser(res.data.user)
18 | })
19 | .catch(err => {
20 | console.log(err)
21 | })
22 | }
23 | getUser();
24 | }, [conversation, currentUser])
25 |
26 | return (
27 |
28 |
29 |
30 |
31 |
32 | {user?.name}
33 |
34 |
35 | )
36 | }
37 |
38 | export default Conversations
--------------------------------------------------------------------------------
/frontend/src/components/Messenger/Messages.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Grid, Typography } from '@mui/material'
2 | import React from 'react'
3 | import './Scroll.css'
4 | import dayjs from 'dayjs'
5 |
6 | function Messages({ message, own, senderImg, recieverImg }) {
7 | var relativeTime = require('dayjs/plugin/relativeTime')
8 | dayjs.extend(relativeTime)
9 | const ownStyle = { display: 'flex', mt: 2, width: '100%', justifyContent: 'flex-end', mr:2.7 }
10 | const normalStyle = { display: 'flex', mt: 2, width: '100%', ml: 2.7 }
11 | const ownMessageStyle = {maxWidth:'88%', height: 'auto', backgroundColor: 'secondary.main', borderRadius: '10px', p: 1}
12 | const normalMessageStyle = {maxWidth: '88%', height: 'auto', backgroundColor: '#f5f3f0', borderRadius: '10px', p: 1}
13 |
14 | return (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {message.text}
23 |
24 | {dayjs(message.createdAt).fromNow()}
25 |
26 |
27 |
28 | )
29 | }
30 |
31 | export default Messages
--------------------------------------------------------------------------------
/frontend/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import './App.css';
3 | import { Routes, Route } from 'react-router-dom'
4 | import AdminLoginPage from './pages/Admin/AdminLoginPage';
5 | import AdminRegisterPage from './pages/Admin/AdminRegisterPage';
6 | import AdminDashboardPage from './pages/Admin/AdminDashboardPage';
7 | import ManageUserPage from './pages/Admin/ManageUserPage';
8 | import UpdateUserPage from './pages/Admin/UpdateUserPage';
9 | import ManageInterviewerPage from './pages/Admin/ManageInterviewerPage';
10 | import UpdateInterviewerPage from './pages/Admin/UpdateInterviewerPage';
11 | import MangeInterviewPage from './pages/Admin/MangeInterviewPage'
12 | import ReportPage from './pages/Admin/ReportPage';
13 |
14 |
15 |
16 | function App() {
17 | return (
18 |
19 | } />
20 | } />
21 | } />
22 | } />
23 | } />
24 | } />
25 | }/>
26 | }/>
27 | }/>
28 | }/>
29 |
30 | );
31 | }
32 |
33 | export default App;
34 |
--------------------------------------------------------------------------------
/frontend/src/components/Admin/Dashboard/Dashboard.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import '../../common/Scroll.css';
5 | import { useNavigate } from "react-router-dom";
6 | import DashboardDesign from "./DashboardDesign";
7 |
8 | function Dashboard() {
9 | const navigate = useNavigate()
10 |
11 | useEffect(() => {
12 | const token = localStorage.getItem("admintoken")
13 | if(!token){
14 | navigate("/admin/login")
15 | }
16 | }, []);
17 |
18 | return (
19 |
20 |
27 |
38 |
42 | My Dashboard
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | );
51 | }
52 |
53 | export default Dashboard
--------------------------------------------------------------------------------
/frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "frontend",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@date-io/dayjs": "^2.14.0",
7 | "@emotion/react": "^11.9.0",
8 | "@emotion/styled": "^11.8.1",
9 | "@mui/icons-material": "^5.8.3",
10 | "@mui/lab": "^5.0.0-alpha.88",
11 | "@mui/material": "^5.8.3",
12 | "@mui/x-data-grid": "^5.12.3",
13 | "@react-pdf-viewer/core": "^2.4.1",
14 | "@react-pdf-viewer/default-layout": "^3.6.0",
15 | "@reduxjs/toolkit": "^1.8.2",
16 | "@testing-library/jest-dom": "^5.16.4",
17 | "@testing-library/react": "^13.3.0",
18 | "@testing-library/user-event": "^13.5.0",
19 | "axios": "^0.27.2",
20 | "chart.js": "^3.8.0",
21 | "date-fns": "^2.28.0",
22 | "dayjs": "^1.11.3",
23 | "jspdf": "^2.5.1",
24 | "pdfjs-dist": "^2.6.347",
25 | "react": "^18.1.0",
26 | "react-chartjs-2": "^4.3.1",
27 | "react-dom": "^18.1.0",
28 | "react-hook-form": "^7.31.3",
29 | "react-pdf": "^5.7.2",
30 | "react-redux": "^8.0.2",
31 | "react-router-dom": "^6.3.0",
32 | "react-scripts": "5.0.1",
33 | "react-to-print": "^2.14.7",
34 | "redux": "^4.2.0",
35 | "redux-persist": "^6.0.0",
36 | "socket.io-client": "^4.5.1",
37 | "sweetalert2": "^11.4.17",
38 | "web-vitals": "^2.1.4"
39 | },
40 | "scripts": {
41 | "start": "react-scripts start",
42 | "build": "react-scripts build",
43 | "test": "react-scripts test",
44 | "eject": "react-scripts eject"
45 | },
46 | "eslintConfig": {
47 | "extends": [
48 | "react-app",
49 | "react-app/jest"
50 | ]
51 | },
52 | "browserslist": {
53 | "production": [
54 | ">0.2%",
55 | "not dead",
56 | "not op_mini all"
57 | ],
58 | "development": [
59 | "last 1 chrome version",
60 | "last 1 firefox version",
61 | "last 1 safari version"
62 | ]
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Dashboard/Dashboard.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import '../../common/Scroll.css';
5 | import { useNavigate } from "react-router-dom";
6 | import DashboardDesign from "./DashboardDesign";
7 |
8 | function Dashboard() {
9 | const navigate = useNavigate()
10 |
11 | useEffect(() => {
12 | const token = localStorage.getItem("usertoken")
13 | if(!token){
14 | navigate('/login')
15 | }
16 | }, []);
17 |
18 | const handleClick = () => {
19 | navigate('/home')
20 | }
21 |
22 | return (
23 |
24 |
31 |
42 |
46 | My Dashboard
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | );
58 | }
59 |
60 |
61 | export default Dashboard
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Wallet/shimmer.css:
--------------------------------------------------------------------------------
1 | .shimmer {
2 | color: rgba(255, 255, 255, 0.086);
3 | background: -webkit-gradient(linear, left top, right top, from(rgb(0, 0, 0)), to(#222), color-stop(0.5, rgba(255, 255, 255, 0.898)));
4 | background: -moz-gradient(linear, left top, right top, from(rgb(0, 0, 0)), to(#222), color-stop(0.5, rgba(255, 255, 255, 0.898)));
5 | background: gradient(linear, left top, right top, from(rgb(0, 0, 0)), to(#222), color-stop(0.5, rgba(255, 255, 255, 0.898)));
6 | -webkit-background-size: 40px 100%;
7 | -moz-background-size: 40px 100%;
8 | background-size: 40px 100%;
9 | -webkit-background-clip: text;
10 | -moz-background-clip: text;
11 | background-clip: text;
12 | -webkit-animation-name: shimmer;
13 | -moz-animation-name: shimmer;
14 | animation-name: shimmer;
15 | -webkit-animation-duration: 3s;
16 | -moz-animation-duration: 3s;
17 | animation-duration: 3s;
18 | -webkit-animation-iteration-count: infinite;
19 | -moz-animation-iteration-count: infinite;
20 | animation-iteration-count: infinite;
21 | background-repeat: no-repeat;
22 | background-position: 0 0;
23 | background-color: rgb(0, 0, 0);
24 | }
25 |
26 | @-moz-keyframes shimmer {
27 | 0% {
28 | background-position: top left;
29 | }
30 | 100% {
31 | background-position: top right;
32 | }
33 | }
34 |
35 | @-webkit-keyframes shimmer {
36 | 0% {
37 | background-position: top left;
38 | }
39 | 100% {
40 | background-position: top right;
41 | }
42 | }
43 |
44 | @-o-keyframes shimmer {
45 | 0% {
46 | background-position: top left;
47 | }
48 | 100% {
49 | background-position: top right;
50 | }
51 | }
52 |
53 | @keyframes shimmer {
54 | 0% {
55 | background-position: top left;
56 | }
57 | 100% {
58 | background-position: top right;
59 | }
60 | }
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Wallet/WalletDesign.js:
--------------------------------------------------------------------------------
1 | import { Box, Paper, Typography } from "@mui/material";
2 | import CurrencyRupeeIcon from "@mui/icons-material/CurrencyRupee";
3 | import React from "react";
4 | import './shimmer.css'
5 |
6 | function WalletDesign({ balance }) {
7 | return (
8 |
9 |
20 |
21 |
30 |
31 |
32 |
33 |
34 | {balance}
35 |
36 |
37 |
51 |
63 |
64 |
65 |
66 |
67 | );
68 | }
69 |
70 | export default WalletDesign;
71 |
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Wallet/Wallet.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import axios from "../../../axiosinstance";
5 | import { useSelector } from "react-redux";
6 | import '../../common/Scroll.css';
7 | import { useNavigate } from "react-router-dom";
8 | import WalletDesign from "./WalletDesign";
9 |
10 | function Wallet() {
11 | const user = useSelector((state) => state.userData.value);
12 | const navigate = useNavigate()
13 | const [balance, setBalance] = useState([])
14 |
15 | useEffect(() => {
16 | const getBalanceData = () => {
17 | axios.get(`/api/interviewer/wallet/${user._id}`, {
18 | headers: {
19 | authToken: localStorage.getItem("usertoken"),
20 | },
21 | })
22 | .then((res)=>{
23 | console.log(res.data)
24 | setBalance(res.data.balance)
25 | })
26 | };
27 | getBalanceData();
28 | }, [user]);
29 |
30 | const handleClick = () => {
31 | navigate('/home')
32 | }
33 |
34 | return (
35 |
36 |
43 |
54 |
58 | My Wallet
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | );
70 | }
71 |
72 |
73 | export default Wallet
--------------------------------------------------------------------------------
/frontend/src/components/About/Statistics.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Typography } from '@mui/material'
2 | import React, { useEffect, useState } from 'react'
3 | import axios from '../../axiosinstance'
4 |
5 | function Statistics({userData}) {
6 |
7 | const [postCount, setPostCount] = useState(0);
8 | const [completed, setCompleted] = useState(0);
9 |
10 | useEffect(() => {
11 | const getPostData = () => {
12 | axios.get(`api/post/posts/${userData._id}`, {
13 | headers: {
14 | authToken: localStorage.getItem("usertoken"),
15 | },
16 | })
17 | .then((res)=>{
18 | setPostCount(res.data.postsCount)
19 | })
20 | };
21 |
22 | const getUpcommingData = () => {
23 | axios.get(`api/interview/user/upcomming/${userData._id}`, {
24 | headers: {
25 | authToken: localStorage.getItem("usertoken"),
26 | },
27 | })
28 | .then((res)=>{
29 | setCompleted(res.data.completedCount)
30 | })
31 | };
32 |
33 | getPostData();
34 | getUpcommingData();
35 | },[])
36 |
37 | return (
38 |
39 |
40 |
41 | Networks
42 | Interviews
43 | Posts
44 |
45 |
46 | {userData?.connections?.length}
47 | {completed}
48 | {postCount}
49 |
50 |
51 |
52 | )
53 | }
54 |
55 | export default Statistics
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Requests/AllRequests.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import Request from "./Request";
5 | import axios from "../../../axiosinstance";
6 | import { useSelector } from "react-redux";
7 | import Toast from "../../Sweetalert/sweetAlert";
8 | import {useNavigate} from 'react-router-dom'
9 |
10 | function AllRequests() {
11 | const user = useSelector((state) => state.userData.value);
12 | const [request, setRequest] = useState([])
13 | const navigate = useNavigate()
14 |
15 | const handleCloseClick =() =>{
16 | navigate('/home')
17 | }
18 |
19 | useEffect(() => {
20 | axios
21 | .get(`api/interview/${user._id}`, {
22 | headers: {
23 | authToken: localStorage.getItem("usertoken"),
24 | },
25 | })
26 | .then((res) => {
27 | setRequest(res.data.requests);
28 | })
29 | .catch((err) => {
30 | Toast.fire({
31 | icon: "error",
32 | title: "Something went wrong",
33 | });
34 | });
35 | }, [user]);
36 |
37 | return (
38 |
39 |
46 |
57 |
61 | Requests
62 |
63 |
64 |
65 |
66 |
67 |
68 | {
69 | request?.map((data)=>(
70 |
71 | ))
72 | }
73 |
74 |
75 |
76 | );
77 | }
78 |
79 | export default AllRequests;
80 |
--------------------------------------------------------------------------------
/frontend/src/components/User/Upcomming/AllUpcomming.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import axios from "../../../axiosinstance";
5 | import { useSelector } from "react-redux";
6 | import '../../common/Scroll.css';
7 | import { useNavigate } from "react-router-dom";
8 | import Upcomming from "./Upcomming";
9 |
10 | function AllUpcomming() {
11 | const user = useSelector((state) => state.userData.value);
12 | const navigate = useNavigate()
13 | const [upcomming, setupComming] = useState([])
14 |
15 | useEffect(() => {
16 | const getupCommingData = () => {
17 | axios.get(`api/interview/user/upcomming/${user._id}`, {
18 | headers: {
19 | authToken: localStorage.getItem("usertoken"),
20 | },
21 | })
22 | .then((res)=>{
23 | setupComming(res.data.upcomming)
24 | })
25 | };
26 | getupCommingData();
27 | }, [user]);
28 |
29 | const handleClick = () => {
30 | navigate('/home')
31 | }
32 |
33 | return (
34 |
35 |
42 |
53 |
57 | Upcomming Interviews
58 |
59 |
60 |
61 |
62 |
63 |
64 | {
65 | upcomming?.map((data)=>(
66 |
67 | ))
68 | }
69 |
70 |
71 |
72 | );
73 | }
74 |
75 |
76 | export default AllUpcomming
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Upcomming/InterAllUpcomming.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import axios from "../../../axiosinstance";
5 | import { useSelector } from "react-redux";
6 | import '../../common/Scroll.css';
7 | import { useNavigate } from "react-router-dom";
8 | import InterUpcommings from "./InterUpcommings";
9 |
10 | function InterAllUpcomming() {
11 | const user = useSelector((state) => state.userData.value);
12 | const navigate = useNavigate()
13 | const [upcomming, setupComming] = useState([])
14 |
15 | useEffect(() => {
16 | const getupCommingData = () => {
17 | axios.get(`api/interview/interviewer/upcomming/${user._id}`, {
18 | headers: {
19 | authToken: localStorage.getItem("usertoken"),
20 | },
21 | })
22 | .then((res)=>{
23 | setupComming(res.data.upcomming)
24 | })
25 | };
26 | getupCommingData();
27 | }, [user]);
28 |
29 | const handleClick = () => {
30 | navigate('/home')
31 | }
32 |
33 | return (
34 |
35 |
42 |
53 |
57 | Upcomming Interviews
58 |
59 |
60 |
61 |
62 |
63 |
64 | {
65 | upcomming?.map((data)=>(
66 |
67 | ))
68 | }
69 |
70 |
71 |
72 | );
73 | }
74 |
75 |
76 | export default InterAllUpcomming
--------------------------------------------------------------------------------
/frontend/src/components/User/Feedback/ViewFeedback.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import "../../common/Scroll.css";
5 | import { Document, Page } from "react-pdf/dist/esm/entry.webpack";
6 | import { useLocation, useNavigate } from "react-router-dom";
7 |
8 | function ViewFeedback() {
9 | const location = useLocation();
10 | const navigate = useNavigate();
11 | const [numPages, setNumPages] = useState(null);
12 | const [pageNumber, setPageNumber] = useState(1);
13 | const [file, setFile] = useState('')
14 |
15 | useEffect(()=>{
16 | const data = location.state.file
17 | setFile(data)
18 | },[location.state.file])
19 |
20 | function onDocumentLoadSuccess({ numPages }) {
21 | setNumPages(numPages);
22 | }
23 |
24 | const handleClick = () => {
25 | navigate("/interviews");
26 | };
27 |
28 | return (
29 |
30 |
37 |
48 |
52 | Feedback
53 |
54 |
55 |
56 |
57 |
58 |
62 |
69 |
73 |
74 |
75 |
76 | Page {pageNumber} of {numPages}
77 |
78 |
79 |
80 |
81 |
82 | );
83 | }
84 |
85 | export default ViewFeedback;
86 |
--------------------------------------------------------------------------------
/frontend/src/components/User/Interviews/AllCompletedInterviews.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import axios from "../../../axiosinstance";
5 | import { useSelector } from "react-redux";
6 | import '../../common/Scroll.css';
7 | import { useNavigate } from "react-router-dom";
8 | import CompletedInterviews from "./CompletedInterviews";
9 |
10 | function AllCompletedInterviews() {
11 | const user = useSelector((state) => state.userData.value);
12 |
13 | const navigate = useNavigate()
14 | const [completedInterviews, setCompletedInterviews] = useState([])
15 |
16 | useEffect(() => {
17 | const getcompletedInterviewsData = () => {
18 | axios.get(`/api/interview//user/completed/${user._id}`, {
19 | headers: {
20 | authToken: localStorage.getItem("usertoken"),
21 | },
22 | })
23 | .then((res)=>{
24 | setCompletedInterviews(res.data.interviews)
25 | })
26 | };
27 | getcompletedInterviewsData();
28 | }, [user]);
29 |
30 | const handleClick = () => {
31 | navigate('/home')
32 | }
33 |
34 | return (
35 |
36 |
43 |
54 |
58 | Completed Interviews
59 |
60 |
61 |
62 |
63 |
64 |
65 | {
66 | completedInterviews?.map((data)=>(
67 |
68 | ))
69 | }
70 |
71 |
72 |
73 | );
74 | }
75 |
76 |
77 | export default AllCompletedInterviews
--------------------------------------------------------------------------------
/frontend/src/components/About/InterStatistics.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import axios from "../../axiosinstance";
4 |
5 | function InterStatistics({userData}) {
6 | const [postCount, setPostCount] = useState(0);
7 | const [completed, setCompleted] = useState(0);
8 |
9 | useEffect(() => {
10 | const getPostData = () => {
11 | axios
12 | .get(`api/post/posts/${userData._id}`, {
13 | headers: {
14 | authToken: localStorage.getItem("usertoken"),
15 | },
16 | })
17 | .then((res) => {
18 | setPostCount(res.data.postsCount);
19 | });
20 | };
21 |
22 | const getUpcommingData = () => {
23 | axios
24 | .get(`api/interview/interviewer/upcomming/${userData._id}`, {
25 | headers: {
26 | authToken: localStorage.getItem("usertoken"),
27 | },
28 | })
29 | .then((res) => {
30 | setCompleted(res.data.completedCount);
31 | });
32 | };
33 |
34 | getPostData();
35 | getUpcommingData();
36 | }, []);
37 |
38 | return (
39 |
40 |
48 |
55 |
56 | Networks
57 |
58 |
59 | Interviews
60 |
61 |
62 | Posts
63 |
64 |
65 |
71 |
72 | {userData?.connections?.length}
73 |
74 |
75 | {completed}
76 |
77 |
78 | {postCount}
79 |
80 |
81 |
82 |
83 | );
84 | }
85 |
86 | export default InterStatistics;
87 |
--------------------------------------------------------------------------------
/frontend/src/pages/Common/AboutPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React, { useEffect } from "react";
3 | import Aside from "../../components/User/Aside";
4 | import "../../components/common/Scroll.css";
5 | import { useSelector } from "react-redux";
6 | import InterAside from "../../components/Interviewer/InterAside";
7 | import { useNavigate } from "react-router-dom";
8 | import Layouts from "../../Layouts/userLayout";
9 | import About from "../../components/About/About";
10 |
11 | function AboutPage() {
12 | const user = useSelector((state) => state.userData.value);
13 | const navigate = useNavigate();
14 |
15 | useEffect(() => {
16 | const token = localStorage.getItem("usertoken");
17 | if (!token) {
18 | navigate("/");
19 | }
20 | }, [navigate]);
21 | return (
22 |
23 |
24 | {user?.interviewer ? (
25 |
33 |
34 |
35 |
36 |
44 |
45 |
50 |
51 |
52 | ) : (
53 |
61 |
62 |
63 |
64 |
72 |
73 |
78 |
79 |
80 | )}
81 |
82 |
83 | );
84 | }
85 |
86 | export default AboutPage;
87 |
--------------------------------------------------------------------------------
/frontend/src/pages/Common/MessengerPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React, { useEffect } from "react";
3 | import UserLayout from "../../Layouts/userLayout";
4 | import Aside from "../../components/User/Aside";
5 | import ChatAside from "../../components/Messenger/ChatAside";
6 | import "../../components/common/Scroll.css";
7 | import { useSelector } from "react-redux";
8 | import InterAside from "../../components/Interviewer/InterAside";
9 | import { useNavigate } from "react-router-dom";
10 | import MessengerDetails from "../../components/Messenger/MessengerDetails";
11 |
12 | function Messenger() {
13 | const user = useSelector((state) => state.userData.value);
14 | const navigate = useNavigate();
15 |
16 | useEffect(() => {
17 | const token = localStorage.getItem("usertoken");
18 | if (!token) {
19 | navigate("/");
20 | }
21 | }, [navigate]);
22 |
23 | return (
24 |
25 |
26 | {user.interviewer ? (
27 |
35 |
36 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | ) : (
54 |
62 |
63 |
64 |
65 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | )}
81 |
82 |
83 | );
84 | }
85 |
86 | export default Messenger;
87 |
--------------------------------------------------------------------------------
/frontend/src/components/User/Notification/AllNotifications.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, IconButton, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CloseIcon from "@mui/icons-material/Close";
4 | import axios from "../../../axiosinstance";
5 | import { useSelector } from "react-redux";
6 | import Toast from "../../Sweetalert/sweetAlert";
7 | import Notification from "./Notification";
8 | import '../../common/Scroll.css'
9 | import { useNavigate } from "react-router-dom";
10 | import {useDispatch} from "react-redux"
11 | import {notification} from "../../../Redux/Features/notificationData"
12 |
13 | function AllNotifications() {
14 | const user = useSelector((state) => state.userData.value);
15 | const dispatch = useDispatch()
16 | const navigate = useNavigate()
17 | const [notifications, setNotifications] = useState([])
18 |
19 | useEffect(() => {
20 | axios
21 | .get(`api/interview/user/${user._id}`, {
22 | headers: {
23 | authToken: localStorage.getItem("usertoken"),
24 | },
25 | })
26 | .then((res) => {
27 | setNotifications(res.data.requests);
28 | dispatch(notification(res.data.requests))
29 | })
30 | .catch((err) => {
31 | Toast.fire({
32 | icon: "error",
33 | title: "Something went wrong",
34 | });
35 | });
36 | }, [user, dispatch]);
37 |
38 | const handleClick = () => {
39 | navigate('/home')
40 | }
41 |
42 | return (
43 |
44 |
51 |
62 |
66 | Notifications
67 |
68 |
69 |
70 |
71 |
72 |
73 | {
74 | notifications?.map((data)=>(
75 |
76 | ))
77 | }
78 |
79 |
80 |
81 | );
82 | }
83 |
84 | export default AllNotifications
--------------------------------------------------------------------------------
/frontend/src/pages/Common/PostsPage.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React, { useEffect } from "react";
3 | import Aside from "../../components/User/Aside";
4 | import ChatAside from "../../components/Messenger/ChatAside";
5 | import Posts from "../../components/Post/Posts";
6 | import "../../components/common/Scroll.css";
7 | import { useSelector } from "react-redux";
8 | import InterAside from "../../components/Interviewer/InterAside";
9 | import { useNavigate } from "react-router-dom";
10 | import Layouts from "../../Layouts/userLayout";
11 | import MyPosts from "../../components/Post/MyPosts";
12 |
13 | function PostsPage() {
14 | const user = useSelector((state) => state.userData.value);
15 | const navigate = useNavigate();
16 |
17 | useEffect(() => {
18 | const token = localStorage.getItem("usertoken");
19 | if (!token) {
20 | navigate("/");
21 | }
22 | }, [navigate]);
23 |
24 | return (
25 |
26 |
27 | {user.interviewer ? (
28 |
36 |
37 |
38 |
39 |
45 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | ) : (
58 |
66 |
67 |
68 |
69 |
75 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | )}
88 |
89 |
90 | );
91 | }
92 |
93 | export default PostsPage
--------------------------------------------------------------------------------
/frontend/src/components/User/Statistics.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Typography } from '@mui/material'
2 | import React, { useEffect, useState } from 'react'
3 | import axios from '../../axiosinstance'
4 |
5 | function Statistics({userData}) {
6 |
7 | const [postCount, setPostCount] = useState(0);
8 | const [upcomming, setUpcomming] = useState(0);
9 | const [pending, setPending] = useState(0);
10 | const [completed, setCompleted] = useState(0);
11 |
12 | useEffect(() => {
13 | const getPostData = () => {
14 | axios.get(`api/post/posts/${userData._id}`, {
15 | headers: {
16 | authToken: localStorage.getItem("usertoken"),
17 | },
18 | })
19 | .then((res)=>{
20 | setPostCount(res.data.postsCount)
21 | })
22 | };
23 |
24 | const getUpcommingData = () => {
25 | axios.get(`api/interview/user/upcomming/${userData._id}`, {
26 | headers: {
27 | authToken: localStorage.getItem("usertoken"),
28 | },
29 | })
30 | .then((res)=>{
31 | setUpcomming(res.data.upcommingCount)
32 | setPending(res.data.pendingCount)
33 | setCompleted(res.data.completedCount)
34 | })
35 | };
36 |
37 | getPostData();
38 | getUpcommingData();
39 | },[userData])
40 |
41 | return (
42 |
43 |
44 |
45 | Networks
46 | Interviews
47 | Posts
48 | Pending
49 | Upcomming
50 |
51 |
52 | {userData?.connections?.length}
53 | {completed}
54 | {postCount}
55 | {pending}
56 | {upcomming}
57 |
58 |
59 |
60 | )
61 | }
62 |
63 | export default Statistics
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/InterStatistics.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Typography } from '@mui/material'
2 | import React, { useEffect, useState } from 'react'
3 | import axios from '../../axiosinstance'
4 |
5 | function Statistics({userData}) {
6 |
7 | const [postCount, setPostCount] = useState(0);
8 | const [upcomming, setUpcomming] = useState(0);
9 | const [pending, setPending] = useState(0);
10 | const [completed, setCompleted] = useState(0);
11 |
12 | useEffect(() => {
13 | const getPostData = () => {
14 | axios.get(`api/post/posts/${userData._id}`, {
15 | headers: {
16 | authToken: localStorage.getItem("usertoken"),
17 | },
18 | })
19 | .then((res)=>{
20 | setPostCount(res.data.postsCount)
21 | })
22 | };
23 |
24 | const getUpcommingData = () => {
25 | axios.get(`api/interview/interviewer/upcomming/${userData._id}`, {
26 | headers: {
27 | authToken: localStorage.getItem("usertoken"),
28 | },
29 | })
30 | .then((res)=>{
31 | setUpcomming(res.data.upcommingCount)
32 | setPending(res.data.pendingCount)
33 | setCompleted(res.data.completedCount)
34 | })
35 | };
36 |
37 | getPostData();
38 | getUpcommingData();
39 | },[userData])
40 |
41 | return (
42 |
43 |
44 |
45 | Networks
46 | Interviews
47 | Posts
48 | Pending
49 | Upcomming
50 |
51 |
52 | {userData?.connections?.length}
53 | {completed}
54 | {postCount}
55 | {pending}
56 | {upcomming}
57 |
58 |
59 |
60 | )
61 | }
62 |
63 | export default Statistics
--------------------------------------------------------------------------------
/frontend/src/components/User/Interviews/CompletedInterviews.js:
--------------------------------------------------------------------------------
1 | import { Box, Button, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
4 | import ScheduleIcon from "@mui/icons-material/Schedule";
5 | import CurrencyRupeeIcon from "@mui/icons-material/CurrencyRupee";
6 | import dayjs from "dayjs";
7 | import PreviewIcon from "@mui/icons-material/Preview";
8 | import { useNavigate } from "react-router-dom";
9 |
10 | function CompletedInterviews({ requestData }) {
11 | const navigate = useNavigate()
12 |
13 | const handleClickFeedback = () => {
14 | navigate('/user/feedback', {state:{file : requestData.feedback}})
15 | };
16 |
17 | return (
18 | <>
19 |
26 |
31 |
39 | Interview Details
40 |
41 |
42 |
43 |
44 |
45 |
46 | {dayjs(requestData.date).format("DD/MM/YYYY")}
47 |
48 |
49 |
50 |
51 |
52 | {dayjs(requestData.time).format("hh:mm a")}
53 |
54 |
55 |
56 |
57 |
58 | {requestData.interviewerFee}
59 |
60 |
61 |
62 |
63 |
68 | Feedback notes
69 |
70 |
71 |
72 |
73 | Your Interview with {requestData.interviewerId.name} is completed
74 | Successfully on {dayjs(requestData.date).format("MMM DD, YYYY")}
75 |
76 |
77 |
78 |
79 | >
80 | );
81 | }
82 |
83 | export default CompletedInterviews;
84 |
--------------------------------------------------------------------------------
/frontend/src/pages/Common/UserHome.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid } from "@mui/material";
2 | import React, { useEffect } from "react";
3 | import Aside from "../../components/User/Aside";
4 | import ChatAside from "../../components/Messenger/ChatAside";
5 | import CreatePost from "../../components/Post/CreatePost";
6 | import Posts from "../../components/Post/Posts";
7 | import "../../components/common/Scroll.css";
8 | import { useSelector } from "react-redux";
9 | import InterAside from "../../components/Interviewer/InterAside";
10 | import { useNavigate } from "react-router-dom";
11 | import Layouts from "../../Layouts/userLayout";
12 |
13 | function UserHome() {
14 | const user = useSelector((state) => state.userData.value);
15 | const navigate = useNavigate();
16 |
17 | useEffect(() => {
18 | const token = localStorage.getItem("usertoken");
19 | if (!token) {
20 | navigate("/");
21 | }
22 | }, [navigate]);
23 | return (
24 |
25 |
26 | {user?.interviewer ? (
27 |
35 |
36 |
37 |
38 |
46 |
47 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | ) : (
60 |
68 |
69 |
70 |
71 |
79 |
80 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 | )}
93 |
94 |
95 | );
96 | }
97 |
98 | export default UserHome;
99 |
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Upcomming/InterUpcommings.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Paper, Typography } from "@mui/material";
2 | import React from "react";
3 | import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
4 | import ScheduleIcon from "@mui/icons-material/Schedule";
5 | import CurrencyRupeeIcon from "@mui/icons-material/CurrencyRupee";
6 | import dayjs from "dayjs";
7 | import VideocamIcon from "@mui/icons-material/Videocam";
8 |
9 | function InterUpcommings({ requestData }) {
10 | return (
11 |
18 |
19 |
23 |
34 |
35 |
36 | {requestData?.userId?.name}
37 |
38 |
39 |
40 |
41 | {requestData?.userId?.about}
42 |
43 |
44 |
45 |
46 |
47 |
48 | Your interview with {requestData?.userId?.name} is scheduled as
49 | follows,
50 |
51 |
52 |
53 |
54 |
55 | {dayjs(requestData.date).format("DD/MM/YYYY")}
56 |
57 |
58 |
59 |
60 |
61 | {dayjs(requestData.time).format("hh:mm a")}
62 |
63 |
64 |
65 |
66 |
67 | {requestData.amount}
68 |
69 |
70 | (PAID)
71 |
72 |
73 |
74 |
75 |
76 | {requestData?.link}
77 |
78 |
79 |
80 |
81 | *video call link available before 5 minutes of actual timing
82 |
83 |
84 |
85 |
86 | );
87 | }
88 |
89 | export default InterUpcommings;
90 |
--------------------------------------------------------------------------------
/frontend/src/components/Messenger/ChatAside.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Paper, Typography } from "@mui/material";
2 | import "../common/Scroll.css";
3 | import React, { useEffect } from "react";
4 | import Conversations from "./Conversations";
5 | import { useSelector } from "react-redux";
6 | import axios from "../../axiosinstance";
7 | import { useNavigate } from "react-router-dom";
8 |
9 | function ChatAside() {
10 | const user = useSelector((state) => state.userData.value);
11 | const navigate = useNavigate();
12 | const [conversation, setConversation] = React.useState([]);
13 |
14 | useEffect(() => {
15 | const getConversations = async () => {
16 | axios
17 | .get(`api/conversations/${user._id}`, {
18 | headers: {
19 | authToken: localStorage.getItem("usertoken"),
20 | },
21 | })
22 | .then((res) => {
23 | setConversation(res.data.conversation);
24 | });
25 | };
26 | getConversations();
27 | }, [user]);
28 |
29 | return (
30 |
31 |
32 |
40 |
48 |
56 |
65 |
73 |
79 | Messaging
80 |
81 |
82 |
83 |
89 | {conversation.map((data, index) => (
90 |
93 | navigate("/messenger", { state: { chat: data } })
94 | }
95 | sx={{ cursor: "pointer" }}
96 | >
97 |
98 |
99 | ))}
100 |
101 |
102 |
103 |
104 |
105 | );
106 | }
107 |
108 | export default ChatAside;
109 |
--------------------------------------------------------------------------------
/frontend/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39 |
40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/frontend/src/components/User/Upcomming/Upcomming.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Paper, Typography } from "@mui/material";
2 | import React from "react";
3 | import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
4 | import ScheduleIcon from "@mui/icons-material/Schedule";
5 | import CurrencyRupeeIcon from "@mui/icons-material/CurrencyRupee";
6 | import dayjs from "dayjs";
7 | import VideocamIcon from "@mui/icons-material/Videocam";
8 |
9 | function Upcomming({requestData}) {
10 |
11 | return (
12 |
19 |
20 |
24 |
35 |
36 |
37 | {requestData?.interviewerId?.name}
38 |
39 |
40 |
41 |
42 | {requestData?.interviewerId?.about}
43 |
44 |
45 |
46 |
47 |
48 |
49 | Your request for mock interview with {" "} {requestData?.interviewerId?.name} is scheduled as follows,
50 |
51 |
52 |
53 |
54 |
55 | {dayjs(requestData.date).format("DD/MM/YYYY")}
56 |
57 |
58 |
59 |
60 |
61 | {dayjs(requestData.time).format("hh:mm a")}
62 |
63 |
64 |
65 |
66 |
67 | {requestData.amount}
68 |
69 |
70 | (PAID)
71 |
72 |
73 |
74 |
75 |
76 | {requestData?.link}
77 |
78 |
79 |
80 |
81 | *video call link available before 5 minutes of actual timing
82 |
83 |
84 |
85 |
86 | );
87 | }
88 |
89 | export default Upcomming
--------------------------------------------------------------------------------
/frontend/src/components/Profile/PasswordChange.js:
--------------------------------------------------------------------------------
1 | import { Box, Button, TextField } from '@mui/material'
2 | import React from 'react'
3 | import { useForm } from 'react-hook-form'
4 | import Toast from '../Sweetalert/sweetAlert'
5 | import axios from '../../axiosinstance'
6 | import { useNavigate } from 'react-router-dom'
7 |
8 | function PasswordChange() {
9 | const { register, handleSubmit, formState: { errors } } = useForm();
10 | const navigate = useNavigate();
11 |
12 | const changeOnSubmit = (data) => {
13 | const {email, password, confirmPassword} = data
14 | if(email && password && (password === confirmPassword)){
15 | axios.put('api/user/change/credentials', data, {
16 | headers: {
17 | 'authToken': localStorage.getItem("usertoken"),
18 | }
19 | })
20 | .then((res)=>{
21 | const message = res.data.message
22 | navigate('/login')
23 | Toast.fire({
24 | icon: 'success',
25 | title: message
26 | })
27 | })
28 | .catch((err)=>{
29 | Toast.fire({
30 | icon: 'error',
31 | title: "Some thing went wrong"
32 | })
33 | })
34 | }else{
35 | Toast.fire({
36 | icon: 'error',
37 | title: "Invalid Credentials"
38 | })
39 | }
40 |
41 | };
42 |
43 | return (
44 |
45 |
103 |
104 | )
105 | }
106 |
107 | export default PasswordChange
--------------------------------------------------------------------------------
/frontend/src/components/Admin/Dashboard/DashboardDesign.js:
--------------------------------------------------------------------------------
1 | import { Box, Card, CardContent, Grid, Typography } from '@mui/material';
2 | import React, { useEffect, useState } from 'react';
3 | import axios from "../../../axiosinstance";
4 | import { useSelector } from "react-redux";
5 | import CurrencyRupeeIcon from '@mui/icons-material/CurrencyRupee';
6 | import BarChart from './BarChart.js';
7 | import PieChartUser from './PieChartUser';
8 |
9 | function DashboardDesign() {
10 | const [adminProfit, setAdminProfit] = useState(0);
11 | const [totalUserCount, setTotalUserCount] = useState(0);
12 | const [revenew, setRevenew] = useState(0);
13 | const [interviewees, setInterviewees] = useState([])
14 | const [interviewers, setInterviewers] = useState([])
15 | const [userAndInter, setUserAndInter] = useState([])
16 | const [posts, setPosts] = useState([])
17 |
18 | const user = useSelector((state) => state.userData.value);
19 | useEffect(()=>{
20 | axios.get(`/api/chart/admin`,{
21 | headers: {
22 | authToken: localStorage.getItem("admintoken"),
23 | },
24 | }).then(res=>{
25 | setAdminProfit(res.data.adminProfit);
26 | setTotalUserCount(res.data.totalUserCount);
27 | setRevenew(res.data.revenew);
28 | setInterviewees(res.data.interviewees);
29 | setInterviewers(res.data.interviewers);
30 | setPosts(res.data.posts);
31 | setUserAndInter(res.data.userAndInter);
32 | })
33 | },[])
34 |
35 | return (
36 |
37 |
38 |
39 |
40 |
41 | Total Users
42 |
43 |
44 |
45 |
46 | {totalUserCount}
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Admin Profit
56 |
57 |
58 |
59 |
60 |
61 | {adminProfit}
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | Revenue
71 |
72 |
73 |
74 |
75 |
76 | {revenew}
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 | )
93 | }
94 |
95 | export default DashboardDesign
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Dashboard/DashboardDesign.js:
--------------------------------------------------------------------------------
1 | import { Box, Card, CardContent, Grid, Typography } from '@mui/material';
2 | import React, { useEffect, useState } from 'react';
3 | import axios from "../../../axiosinstance";
4 | import { useSelector } from "react-redux";
5 | import CurrencyRupeeIcon from '@mui/icons-material/CurrencyRupee';
6 | import BarChart from './BarChart';
7 | import LineChart from './LineChart';
8 |
9 | function DashboardDesign() {
10 |
11 | const [request, setRequest] = useState(0);
12 | const [interview, setInterview] = useState(0);
13 | const [revenew, setRevenew] = useState(0);
14 | const [orderStatus, setOrderStatus] = useState([])
15 | const [orderStatusValue, setOrderStatusValue] = useState([])
16 | const [walletStatus, setWalletStatus] = useState([])
17 | const [walletStatusValue, setWalletStatusValue] = useState([])
18 |
19 | const user = useSelector((state) => state.userData.value);
20 | useEffect(()=>{
21 | axios.get(`/api/chart/interviewer/${user._id}`,{
22 | headers: {
23 | authToken: localStorage.getItem("usertoken"),
24 | },
25 | }).then(res=>{
26 | setRequest(res.data.requests);
27 | setInterview(res.data.interviews);
28 | setRevenew(res.data.revenew);
29 | setOrderStatus(res.data.orderStatus)
30 | setOrderStatusValue(res.data.orderStatusValue)
31 | setWalletStatus(res.data.walletStatus)
32 | setWalletStatusValue(res.data.walletStatusValue)
33 |
34 | })
35 | },[])
36 |
37 | return (
38 |
39 |
40 |
41 |
42 |
43 | Requests
44 |
45 |
46 |
47 |
48 | {request}
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | Interviews
58 |
59 |
60 |
61 |
62 | {interview}
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | Revenue
72 |
73 |
74 |
75 |
76 |
77 | {revenew}
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | )
95 | }
96 |
97 | export default DashboardDesign
--------------------------------------------------------------------------------
/frontend/src/components/Admin/AdminRegister.js:
--------------------------------------------------------------------------------
1 | import {
2 | Avatar,
3 | Box,
4 | Button,
5 | Grid,
6 | Paper,
7 | TextField,
8 | Typography,
9 | } from "@mui/material";
10 | import axios from "../../axiosinstance";
11 | import { useForm } from "react-hook-form";
12 | import { useNavigate } from "react-router-dom";
13 | import Toast from "../Sweetalert/sweetAlert";
14 | import HowToRegIcon from "@mui/icons-material/HowToReg";
15 |
16 | function AdminRegister() {
17 | const navigate = useNavigate();
18 | const {
19 | register,
20 | handleSubmit,
21 | formState: { errors },
22 | } = useForm();
23 |
24 |
25 | const registerOnSubmit = (data) => {
26 | const { email, password } = data;
27 | if (email && password) {
28 | axios
29 | .post("api/admin/registration", data)
30 | .then((res) => {
31 | if (res.data.admin) {
32 | const message = res.data.message;
33 | Toast.fire({
34 | icon: "success",
35 | title: message,
36 | });
37 | navigate("/admin/login");
38 | } else {
39 | Toast.fire({
40 | icon: "error",
41 | title: "Invalid credentials",
42 | });
43 | }
44 | })
45 | .catch((e) => {
46 | console.log(e)
47 | Toast.fire({
48 | icon: "error",
49 | title: "Something went wrong",
50 | });
51 | });
52 | } else {
53 | Toast.fire({
54 | icon: "error",
55 | title: "Please fill all the details",
56 | });
57 | }
58 | };
59 |
60 | return (
61 |
62 |
63 |
64 |
75 |
79 |
80 |
81 |
90 | ADMIN
91 |
92 |
100 | Register
101 |
102 |
155 |
156 |
157 |
158 |
159 | );
160 | }
161 |
162 | export default AdminRegister;
163 |
--------------------------------------------------------------------------------
/frontend/src/components/Landingpage/StaticRowOne.js:
--------------------------------------------------------------------------------
1 | import { Box, Button, Grid } from '@mui/material'
2 | import React from 'react'
3 | import ImageOne from '../../images/imageOne.svg'
4 | import ImageTwo from '../../images/imageTwo.svg'
5 | import ImageThree from '../../images/imageThree.svg'
6 | import ImageFour from '../../images/imageFour.svg'
7 | import ImageFive from '../../images/imageFive.svg'
8 | import ImageSix from '../../images/imageSix.svg'
9 | import './Bubble.css'
10 | import { useNavigate } from 'react-router-dom'
11 |
12 | function StaticrowOne() {
13 | const navigate = useNavigate()
14 | const handleLearnMore = () => {
15 | navigate('/register')
16 | }
17 | return (
18 |
19 |
20 |
21 |
22 | can’t crack the test?
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | doesn’t get the right job?
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | tired of interviews?
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Get help from 10+ years of
experienced interviewers
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | Get more idea on interview by
attending mock interviews
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | Join with us and be a success in
your career
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | )
86 | }
87 |
88 | export default StaticrowOne
--------------------------------------------------------------------------------
/frontend/src/components/Admin/AdminLogin.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Button, Grid, Paper, TextField } from "@mui/material";
2 | import axios from "../../axiosinstance";
3 | import { useForm } from "react-hook-form";
4 | import { useNavigate } from "react-router-dom";
5 | import Toast from "../Sweetalert/sweetAlert";
6 | import { useDispatch } from "react-redux";
7 | import { adminLogin } from "../../Redux/Features/adminData";
8 | import LockOpenIcon from "@mui/icons-material/LockOpen";
9 | import { useEffect } from "react";
10 |
11 | function AdminLogin() {
12 | const navigate = useNavigate();
13 | const {
14 | register,
15 | handleSubmit,
16 | formState: { errors },
17 | } = useForm();
18 | const dispatch = useDispatch();
19 |
20 | const logOnSubmit = (data) => {
21 | const { email, password } = data;
22 | if (email && password) {
23 | axios
24 | .post("api/admin/login", data)
25 | .then((res) => {
26 | if (res.data.admin) {
27 | const message = res.data.message;
28 | Toast.fire({
29 | icon: "success",
30 | title: message,
31 | });
32 | const token = res.data.token;
33 | localStorage.setItem("admintoken", token);
34 | dispatch(adminLogin(res.data.admin));
35 | navigate("/admin/dashboard");
36 | } else {
37 | Toast.fire({
38 | icon: "error",
39 | title: "Invalid credentials",
40 | });
41 | }
42 | })
43 | .catch((e) => {
44 | Toast.fire({
45 | icon: "error",
46 | title: "Something went wrong",
47 | });
48 | });
49 | } else {
50 | Toast.fire({
51 | icon: "warning",
52 | title: "Please fill all the details",
53 | });
54 | }
55 | };
56 |
57 | useEffect(() => {
58 | const token = localStorage.getItem("admintoken")
59 | if(token){
60 | navigate("/admin/dashboard")
61 | }else{
62 | navigate("/admin/login")
63 | }
64 | }, [])
65 |
66 |
67 | return (
68 |
69 |
70 |
71 |
82 |
86 |
87 |
88 |
95 | ADMIN
96 |
97 |
150 |
151 |
152 |
153 |
154 | );
155 | }
156 |
157 | export default AdminLogin;
158 |
--------------------------------------------------------------------------------
/frontend/src/components/About/About.js:
--------------------------------------------------------------------------------
1 | import {
2 | Avatar,
3 | Box,
4 | Button,
5 | Grid,
6 | IconButton,
7 | Paper,
8 | Switch,
9 | Typography,
10 | } from "@mui/material";
11 | import React, { useEffect, useState } from "react";
12 | import ArrowBackIcon from "@mui/icons-material/ArrowBack";
13 | import axios from "../../axiosinstance";
14 | import "../common/Scroll.css";
15 | import { useLocation, useNavigate } from "react-router-dom";
16 | import Statistics from "./Statistics";
17 | import InterStatistics from "./InterStatistics";
18 | import UserDetails from "./UserDetails";
19 | import Postsview from "./Postsview";
20 |
21 | function About() {
22 | const navigate = useNavigate();
23 | const location = useLocation();
24 | const [userData, setUserData] = useState([]);
25 | const [postViewStatus, setPostViewStatus] = useState(false);
26 |
27 | useEffect(() => {
28 | console.log("hii");
29 | const id = location.state.id;
30 | const getUserDataData = () => {
31 | axios
32 | .get(`api/user/details/${id}`, {
33 | headers: {
34 | authToken: localStorage.getItem("usertoken"),
35 | },
36 | })
37 | .then((res) => {
38 | setUserData(res.data.user);
39 | });
40 | };
41 | getUserDataData();
42 | }, []);
43 |
44 | const goBack = () => {
45 | navigate("/home");
46 | };
47 |
48 | const handlePostViews = () => {
49 | setPostViewStatus(!postViewStatus);
50 | };
51 |
52 | return (
53 |
54 |
61 |
71 |
81 |
86 | Go Back
87 |
88 |
89 |
99 |
104 |
105 |
113 | {userData && userData.name}
114 |
115 |
116 | {userData && userData.about}
117 |
118 | {userData.interviewer && (
119 |
127 | Interviewer
128 |
129 | )}
130 |
131 |
140 |
141 |
142 |
150 | {userData.interviewer ? (
151 |
152 | ) : (
153 |
154 | )}
155 |
156 |
157 | {/*
158 |
159 | View Posts
160 |
161 |
162 |
163 |
164 |
165 | {postViewStatus && } */}
166 |
167 |
168 |
169 | );
170 | }
171 |
172 | export default About;
173 |
--------------------------------------------------------------------------------
/frontend/src/components/Interviewer/Report/Report.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import { DataGrid, GridToolbarExport } from "@mui/x-data-grid";
3 | import {
4 | Box,
5 | Grid,
6 | IconButton,
7 | Paper,
8 | TableContainer,
9 | Typography,
10 | } from "@mui/material";
11 | import { useNavigate } from "react-router-dom";
12 | import axios from "../../../axiosinstance";
13 | import CloseIcon from "@mui/icons-material/Close";
14 | import Toast from "../../Sweetalert/sweetAlert";
15 | import { useSelector } from "react-redux";
16 | import dayjs from "dayjs";
17 | import "../../common/Scroll.css";
18 |
19 | function Report() {
20 | const user = useSelector((state) => state.userData.value);
21 | const [request, setRequest] = useState([]);
22 | const navigate = useNavigate();
23 |
24 | const handleCloseClick = () => {
25 | navigate("/home");
26 | };
27 |
28 |
29 |
30 | useEffect(() => {
31 | axios
32 | .get(`api/interview/${user._id}`, {
33 | headers: {
34 | authToken: localStorage.getItem("usertoken"),
35 | },
36 | })
37 | .then((res) => {
38 | setRequest(res.data.requests);
39 | })
40 | .catch((err) => {
41 | Toast.fire({
42 | icon: "error",
43 | title: "Something went wrong",
44 | });
45 | });
46 | }, [user]);
47 |
48 |
49 | const columns = [
50 | {
51 | field: "id",
52 | headerClassName: "super-app-theme--header",
53 | headerName: "ID",
54 | width: 75,
55 | },
56 | {
57 | field: "name",
58 | headerClassName: "super-app-theme--header",
59 | headerName: "Name",
60 | width: 165,
61 | editable: true,
62 | },
63 | {
64 | field: "about",
65 | headerClassName: "super-app-theme--header",
66 | headerName: "About",
67 | width: 140,
68 | editable: true,
69 | },
70 | {
71 | field: "phone",
72 | headerClassName: "super-app-theme--header",
73 | headerName: "Phone",
74 | width: 130,
75 | editable: true,
76 | },
77 | {
78 | field: "date",
79 | headerClassName: "super-app-theme--header",
80 | headerName: "Date",
81 | width: 130,
82 | editable: true,
83 | },
84 | {
85 | field: "time",
86 | headerClassName: "super-app-theme--header",
87 | headerName: "Time",
88 | type: "number",
89 | width: 110,
90 | editable: true,
91 | },
92 | {
93 | field: "fee",
94 | headerClassName: "super-app-theme--header",
95 | headerName: "Fee",
96 | type: "number",
97 | width: 100,
98 | editable: true,
99 | },
100 | {
101 | field: "status",
102 | headerClassName: "super-app-theme--header",
103 | headerName: "Status",
104 | width: 140,
105 | editable: true,
106 | },
107 | ];
108 |
109 |
110 | const rows = request.map((data, index) => ({
111 | id: index + 1,
112 | name: data.userId.name,
113 | about: data.userId.about,
114 | phone: data.userId.phone,
115 | date: dayjs(data.date).format("MMM, DD YYYY"),
116 | time: dayjs(data.time).format("hh:mm a"),
117 | fee: data.status === 'Cancelled' ? "-" : (data.creditStatus ? `Rs. ${data.interviewerFee}` : `Pending`),
118 | status: data.status
119 | }));
120 |
121 | return (
122 |
123 |
130 |
141 |
145 | Report
146 |
147 |
148 |
149 |
150 |
151 |
161 |
170 |
179 |
180 |
181 |
182 |
183 | );
184 | }
185 |
186 |
187 | export default Report
--------------------------------------------------------------------------------
/frontend/src/components/common/Footer.js:
--------------------------------------------------------------------------------
1 | import { Grid, Link } from '@mui/material'
2 | import { Box } from '@mui/system'
3 | import FacebookIcon from '@mui/icons-material/Facebook';
4 | import InstagramIcon from '@mui/icons-material/Instagram';
5 | import LinkedInIcon from '@mui/icons-material/LinkedIn';
6 | import HomeIcon from '@mui/icons-material/Home';
7 | import InfoIcon from '@mui/icons-material/Info';
8 | import PhoneIcon from '@mui/icons-material/Phone';
9 | import FmdGoodIcon from '@mui/icons-material/FmdGood';
10 | import React from 'react'
11 |
12 | function Footer() {
13 | return (
14 |
15 |
16 |
20 |
29 |
30 | For Contact
31 |
32 |
33 | Spur, good professionals are made from here
34 |
35 |
36 |
37 | Sudheesh Manikandan
38 |
39 |
40 |
41 | Kerala, India
42 |
43 |
44 |
45 | +91 7736288180
46 |
47 |
48 |
49 | Quick Links
50 |
51 |
52 | Home
53 |
54 |
55 |
56 | About us
57 |
58 |
59 |
60 | Contact us
61 |
62 |
63 |
64 | Connect Us
65 |
66 |
67 | Facebook
68 |
69 |
70 |
71 | Instagram
72 |
73 |
74 |
75 | Linked In
76 |
77 |
78 |
79 |
80 |
81 | Sudheesh Manikandan ® {new Date().getFullYear()}
82 |
83 |
84 |
85 |
86 | )
87 | }
88 |
89 | export default Footer
--------------------------------------------------------------------------------
/frontend/src/components/Admin/Report/Report.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import { DataGrid, GridToolbarExport } from "@mui/x-data-grid";
3 | import {
4 | Box,
5 | Grid,
6 | IconButton,
7 | Paper,
8 | TableContainer,
9 | Typography,
10 | } from "@mui/material";
11 | import { useNavigate } from "react-router-dom";
12 | import axios from "../../../axiosinstance";
13 | import CloseIcon from "@mui/icons-material/Close";
14 | import Toast from "../../Sweetalert/sweetAlert";
15 | import { useSelector } from "react-redux";
16 | import dayjs from "dayjs";
17 | import '../../common/Scroll.css'
18 |
19 | function Report() {
20 | const user = useSelector((state) => state.userData.value);
21 | const [interviews, setInterviews] = useState([]);
22 | const navigate = useNavigate();
23 |
24 | const handleCloseClick = () => {
25 | navigate("/admin/dashboard");
26 | };
27 |
28 |
29 |
30 | useEffect(() => {
31 | axios
32 | .get(`/api/admin/manage/interview`, {
33 | headers: {
34 | authToken: localStorage.getItem("admintoken"),
35 | },
36 | })
37 | .then((res) => {
38 | setInterviews(res.data.interviews);
39 | })
40 | .catch((err) => {
41 | Toast.fire({
42 | icon: "error",
43 | title: "Something went wrong",
44 | });
45 | });
46 | }, [user]);
47 |
48 |
49 | const columns = [
50 | {
51 | field: "id",
52 | headerClassName: "super-app-theme--header",
53 | headerName: "ID",
54 | width: 75,
55 | },
56 | {
57 | field: "interviewee",
58 | headerClassName: "super-app-theme--header",
59 | headerName: "Interviewee",
60 | width: 165,
61 | editable: true,
62 | },
63 | {
64 | field: "interviewer",
65 | headerClassName: "super-app-theme--header",
66 | headerName: "Interviewer",
67 | width: 140,
68 | editable: true,
69 | },
70 | {
71 | field: "date",
72 | headerClassName: "super-app-theme--header",
73 | headerName: "Date",
74 | width: 130,
75 | editable: true,
76 | },
77 | {
78 | field: "time",
79 | headerClassName: "super-app-theme--header",
80 | headerName: "Time",
81 | type: "number",
82 | width: 110,
83 | editable: true,
84 | },
85 | {
86 | field: "status",
87 | headerClassName: "super-app-theme--header",
88 | headerName: "Status",
89 | width: 140,
90 | editable: true,
91 | },
92 | {
93 | field: "interviewerFee",
94 | headerClassName: "super-app-theme--header",
95 | headerName: "InterviewerFee",
96 | type: "number",
97 | width: 100,
98 | editable: true,
99 | },
100 | {
101 | field: "profit",
102 | headerClassName: "super-app-theme--header",
103 | headerName: "Profit",
104 | width: 130,
105 | editable: true,
106 | },
107 | {
108 | field: "total",
109 | headerClassName: "super-app-theme--header",
110 | headerName: "Total",
111 | width: 140,
112 | editable: true,
113 | },
114 | ];
115 |
116 |
117 | const rows = interviews.map((data, index) => ({
118 | id: index + 1,
119 | interviewee: data?.userId?.name,
120 | interviewer: data?.interviewerId?.about,
121 | date: dayjs(data.date).format("MMM, DD YYYY"),
122 | time: dayjs(data.time).format("hh:mm a"),
123 | status: data?.status,
124 | interviewerFee:`Rs. ${data?.interviewerFee}`,
125 | profit:`Rs. ${data?.adminProfit}`,
126 | total: data?.status ==='Cancelled'? 'Rs.0' : `Rs. ${data?.amount}`
127 | }));
128 |
129 | return (
130 |
131 |
138 |
149 |
153 | Report
154 |
155 |
156 |
157 |
158 |
159 |
169 |
178 |
187 |
188 |
189 |
190 |
191 | );
192 | }
193 |
194 | export default Report
--------------------------------------------------------------------------------
/frontend/src/components/User/Notification/Notification.js:
--------------------------------------------------------------------------------
1 | import { Box, Button, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
4 | import ScheduleIcon from "@mui/icons-material/Schedule";
5 | import CurrencyRupeeIcon from "@mui/icons-material/CurrencyRupee";
6 | import Swal from "sweetalert2";
7 | import axios from "../../../axiosinstance";
8 | import dayjs from "dayjs";
9 | import { useNavigate } from "react-router-dom";
10 | import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
11 | import HighlightOffIcon from '@mui/icons-material/HighlightOff';
12 |
13 | function Notification({ notificationData }) {
14 | const [userSubmit, setUserSubmit] = useState(false);
15 | const [userCancel, setUserCancel] = useState(false);
16 | const navigate = useNavigate();
17 |
18 | const handleSubmit = (id) => {
19 | navigate("/payment", { state: { id: id } });
20 | };
21 |
22 | const handleCancel = (id) => {
23 | const values = {
24 | requestId: id,
25 | };
26 |
27 | Swal.fire({
28 | title: "Are you sure?",
29 | text: "You won't be able to revert this!",
30 | icon: "warning",
31 | showCancelButton: true,
32 | confirmButtonColor: "#3085d6",
33 | cancelButtonColor: "#d33",
34 | confirmButtonText: "Yes, cancel it!",
35 | }).then((result) => {
36 | if (result.isConfirmed) {
37 | axios
38 | .post("api/interview/user/cancel", values, {
39 | headers: {
40 | authToken: localStorage.getItem("usertoken"),
41 | },
42 | })
43 | .then((res) => {
44 | console.log(res.data.message);
45 | setUserCancel(!userCancel);
46 | });
47 | Swal.fire(
48 | "Cancelled!",
49 | "Interview request has been cancelled.",
50 | "success"
51 | );
52 | }
53 | });
54 | };
55 |
56 | useEffect(() => {
57 | setUserSubmit(notificationData.userConfirmation);
58 | setUserCancel(notificationData.userCancellation);
59 | }, [notificationData]);
60 |
61 | return (
62 | <>
63 | {(notificationData.confirmed || notificationData.cancelled) && (
64 |
71 |
76 |
84 | Request Notification
85 |
86 |
87 |
88 | {notificationData.confirmed ? (
89 |
90 | Your request for mock interview is confirmed by{" "}
91 | {notificationData.interviewerId.name}
92 |
93 | ) : (
94 | notificationData.cancelled && (
95 |
96 | Your request for mock interview is cancelled by{" "}
97 | {notificationData.interviewerId.name}
98 |
99 | )
100 | )}
101 |
102 |
103 |
104 | {dayjs(notificationData.date).format("DD/MM/YYYY")}
105 |
106 |
107 |
108 |
109 |
110 | {dayjs(notificationData.time).format("hh:mm a")}
111 |
112 |
113 |
114 |
115 |
116 | {notificationData.amount}
117 |
118 |
119 |
120 | {userCancel || notificationData.cancelled ? (
121 |
129 | ) : userSubmit ? (
130 |
134 |
135 | Confirmed
136 |
137 | ) : (
138 | <>
139 |
147 |
155 | >
156 | )}
157 |
158 |
159 |
160 | )}
161 | >
162 | );
163 | }
164 |
165 | export default Notification;
166 |
--------------------------------------------------------------------------------
/frontend/src/components/Admin/AdminAside.js:
--------------------------------------------------------------------------------
1 | import { Box, Grid, Paper, Typography } from "@mui/material";
2 | import React, { useEffect } from "react";
3 | import { useNavigate } from "react-router-dom";
4 | import DashboardIcon from "@mui/icons-material/Dashboard";
5 | import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
6 | import SupervisedUserCircleIcon from "@mui/icons-material/SupervisedUserCircle";
7 | import AssignmentIcon from "@mui/icons-material/Assignment";
8 | import SensorOccupiedIcon from '@mui/icons-material/SensorOccupied';
9 |
10 | function AdminAside() {
11 | const navigate = useNavigate();
12 |
13 | useEffect(() => {
14 | const token = localStorage.getItem("admintoken");
15 | if (!token) {
16 | navigate("/");
17 | }
18 | }, [navigate]);
19 |
20 | const handleUsersClick = () => {
21 | navigate("/admin/user");
22 | };
23 |
24 | const handleInterviewersClick = () => {
25 | navigate("/admin/interviewer")
26 | };
27 |
28 | const handleInterviewClick = () => {
29 | navigate("/admin/interview")
30 | }
31 |
32 | const handleReportClick = () => {
33 | navigate("/admin/report")
34 | }
35 |
36 | const handleDashboardClick = () => {
37 | navigate("/admin/dashboard")
38 | }
39 |
40 | return (
41 |
42 |
43 |
51 |
59 |
67 |
80 |
86 | Admin
87 |
88 |
89 |
90 |
98 |
99 |
100 |
101 |
102 |
103 | Dashboard
104 |
105 |
106 |
107 |
115 |
116 |
117 |
118 |
119 |
120 | Interviewers
121 |
122 |
123 |
124 |
132 |
133 |
136 |
137 |
138 |
143 | Users
144 |
145 |
146 |
147 |
155 |
156 |
157 |
158 |
159 |
160 | Interviews
161 |
162 |
163 |
164 |
172 |
173 |
174 |
175 |
176 |
177 | Report
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | );
187 | }
188 |
189 | export default AdminAside;
190 |
--------------------------------------------------------------------------------
/frontend/src/components/Messenger/MessengerDetails.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Card, Fab, Grid, IconButton, Input, InputBase, Paper, TextField, Typography } from '@mui/material'
2 | import CloseIcon from '@mui/icons-material/Close';
3 | import SendRoundedIcon from '@mui/icons-material/SendRounded';
4 | import { useNavigate, useLocation } from 'react-router-dom';
5 | import React, { useEffect, useRef, useState } from 'react'
6 | import axios from '../../axiosinstance'
7 | import { useSelector } from 'react-redux'
8 | import './Scroll.css'
9 | import Messages from './Messages';
10 | import io from 'socket.io-client'
11 |
12 | const ENDPOINT = "https://spur-backend.herokuapp.com";
13 | var socket, selectedChatCompare;
14 |
15 | function MessengerDetails() {
16 | const navigate = useNavigate();
17 | const location = useLocation();
18 | const currentUser = useSelector(state => state.userData.value)
19 | const [currentChat, setCurrentChat] = useState(null)
20 | const [user, setUser] = useState(null)
21 | const [newMessage, setNewMessage] = useState('')
22 | const [messages, setMessages] = React.useState([])
23 | const [socketConnected, setSocketConnected] = useState(false)
24 | const scrollRef = useRef()
25 |
26 | useEffect(()=>{
27 | socket = io(ENDPOINT)
28 | socket.emit("setup",currentUser)
29 | socket.on("connection", ()=>setSocketConnected(true))
30 | },[])
31 |
32 | useEffect(() => {
33 | const data = location.state.chat
34 | setCurrentChat(data)
35 | const friendId = data?.members.filter(member => member !== currentUser._id)
36 | const getUser = () => {
37 | axios.get(`api/user/details/${friendId}`, {
38 | headers: {
39 | 'authToken': localStorage.getItem("usertoken")
40 | }
41 | })
42 | .then(res => {
43 | setUser(res.data.user)
44 | })
45 | .catch(err => {
46 | console.log(err)
47 | })
48 | }
49 | getUser();
50 | }, [location.state.chat, currentUser?._id])
51 |
52 | const fetchMessages = () => {
53 | const id = currentChat?._id
54 | axios.get(`api/messages/${id}`, {
55 | header: {
56 | 'authToken': localStorage.getItem("usertoken")
57 | }
58 | })
59 | .then(res => {
60 | setMessages(res.data.message)
61 | socket.emit("join chat",currentChat?._id)
62 | })
63 | .catch(err => {
64 | console.log(err)
65 | })
66 | }
67 |
68 | useEffect(()=>{
69 | fetchMessages();
70 | selectedChatCompare = currentChat;
71 | },[currentChat])
72 |
73 |
74 | const handleSubmit = (e) =>{
75 | e.preventDefault();
76 | const message = {
77 | sender: currentUser._id,
78 | text: newMessage,
79 | conversationId : currentChat._id
80 | }
81 |
82 | socket.emit("new message",{
83 | senderId: currentUser._id,
84 | chat: currentChat,
85 | text: newMessage
86 | })
87 |
88 | axios.post('api/messages', message)
89 | .then(res=>{
90 | setMessages([...messages, res.data.message])
91 | setNewMessage('')
92 | })
93 | }
94 |
95 | useEffect(()=>{
96 | socket.on("message recieved",(newMessageRecieved)=>{
97 | if(!selectedChatCompare || selectedChatCompare._id !== newMessageRecieved.chat._id)
98 | {
99 | //send notification
100 | }else{
101 | setMessages([...messages, newMessageRecieved])
102 | }
103 | })
104 | })
105 |
106 |
107 | useEffect(()=>{
108 | scrollRef.current?.scrollIntoView({behavior:"smooth"})
109 | },[messages])
110 |
111 | return (
112 |
113 |
114 |
115 |
124 |
125 |
126 | {user?.name}
127 |
128 |
129 | navigate('/home')}>
130 |
131 |
132 |
133 |
134 |
135 | {
136 | messages.map((data, index) =>(
137 |
138 |
139 |
140 | ))
141 | }
142 |
143 |
144 |
145 | setNewMessage(e.target.value)}
148 | value={newMessage}
149 | fullWidth
150 | variant='outlined'
151 | placeholder='Write something...'>
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | )
162 | }
163 |
164 | export default MessengerDetails
--------------------------------------------------------------------------------
/frontend/src/components/Post/CreatePost.js:
--------------------------------------------------------------------------------
1 | import { Box, Button, Grid, Paper, Typography, Modal, IconButton, InputBase } from '@mui/material'
2 | import React, { useState } from 'react'
3 | import { useNavigate } from 'react-router-dom'
4 | import CloseIcon from '@mui/icons-material/Close';
5 | import AddPhotoAlternateIcon from '@mui/icons-material/AddPhotoAlternate';
6 | import { styled } from '@mui/material/styles';
7 | import { useForm } from 'react-hook-form';
8 | import axios from '../../axiosinstance';
9 | import Toast from '../Sweetalert/sweetAlert';
10 | import { useSelector } from 'react-redux'
11 | import {useDispatch} from 'react-redux'
12 | import { createPost } from '../../Redux/Features/postData';
13 |
14 | function CreatePost() {
15 | const navigate = useNavigate()
16 | const user = useSelector(state => state.userData.value)
17 | const dispatch = useDispatch();
18 | const { register, handleSubmit } = useForm()
19 | const [open, setOpen] = React.useState(false);
20 | const handleOpen = () => setOpen(true);
21 | const handleClose = () => {
22 | setOpen(false);
23 | setDescription("");
24 | setImage("");
25 | navigate('/home')
26 | }
27 | const [image, setImage] = useState('')
28 | const [description, setDescription] = useState('')
29 |
30 | const handlePost = (data) => {
31 | const { description } = data
32 | setDescription(description)
33 | let values = new FormData()
34 | if (description) {
35 | values.append('postImg', image)
36 | values.append('description', description)
37 | values.append('createdBy', user._id)
38 | }
39 |
40 | if (description) {
41 | axios.post(`api/post/posts/create`, values, {
42 | headers: {
43 | 'authToken': localStorage.getItem("usertoken"),
44 | "Content-Type": "multipart/form-data"
45 | }
46 | })
47 | .then(res => {
48 | const message = res.data.message
49 | Toast.fire({
50 | icon: 'success',
51 | title: message
52 | })
53 | dispatch(createPost(res.data.posts))
54 | handleClose();
55 | })
56 | .catch(err => {
57 | Toast.fire({
58 | icon: 'error',
59 | title: 'Something went wrong'
60 | })
61 | })
62 | }
63 | }
64 |
65 | const Input = styled('input')({
66 | display: 'none',
67 | });
68 |
69 | const changeImage = (e) => {
70 | setImage(e.target.files[0])
71 | }
72 |
73 | return (
74 |
75 |
76 |
77 |
78 |
79 |
89 |
90 |
91 |
92 |
93 |
98 |
99 |
100 |
101 | Create a post
102 |
103 |
104 |
105 |
106 |
107 |
145 |
146 |
147 |
148 | )
149 | }
150 |
151 | export default CreatePost
--------------------------------------------------------------------------------
/frontend/src/components/Admin/UserManagement/UpdateUser.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Button,
4 | Grid,
5 | IconButton,
6 | Paper,
7 | TextField,
8 | Typography,
9 | } from "@mui/material";
10 | import React, { useEffect, useState } from "react";
11 | import { useLocation, useNavigate } from "react-router-dom";
12 | import { useForm } from "react-hook-form";
13 | import axios from "../../../axiosinstance";
14 | import Toast from "../../Sweetalert/sweetAlert";
15 | import CloseIcon from "@mui/icons-material/Close";
16 |
17 | function UpdateUser() {
18 | const location = useLocation();
19 | const [userId, setUserId] = useState("");
20 | const {
21 | register,
22 | handleSubmit,
23 | reset,
24 | formState: { errors },
25 | } = useForm();
26 | const [users, setUsers] = useState({
27 | name: "",
28 | phone: "",
29 | email: "",
30 | about: "",
31 | });
32 |
33 | const navigate = useNavigate();
34 |
35 | const editOnSubmit = () => {
36 | const { name, phone, email, about } = users;
37 | const values = {
38 | name,
39 | phone,
40 | email,
41 | about,
42 | };
43 | axios
44 | .put(`/api/admin/manage/user/update/${userId}`, values, {
45 | headers: {
46 | authToken: localStorage.getItem("admintoken"),
47 | },
48 | })
49 | .then((res) => {
50 | const message = res.data.message;
51 | Toast.fire({
52 | icon: "success",
53 | title: message,
54 | });
55 | navigate("/admin/user");
56 | })
57 | .catch((err) => {
58 | Toast.fire({
59 | icon: "error",
60 | title: "Something went wrong",
61 | });
62 | });
63 | };
64 |
65 | useEffect(() => {
66 | const token = localStorage.getItem("admintoken");
67 | const id = location.state.id;
68 | setUserId(id);
69 | axios
70 | .get(`api/user/details/${id}`, {
71 | headers: {
72 | authToken: token,
73 | },
74 | })
75 | .then((res) => {
76 | setUsers(res.data.user);
77 | reset(res.data.user);
78 | });
79 | }, [location.state.id, reset]);
80 |
81 | const handleChange = (e) => {
82 | const { name, value } = e.target;
83 | setUsers({
84 | ...users,
85 | [name]: value,
86 | });
87 | };
88 |
89 | const handleCloseClick = () => {
90 | navigate("/admin/user");
91 | };
92 |
93 | return (
94 |
95 |
102 |
113 |
117 | Edit User
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
137 |
227 |
228 |
229 |
230 |
231 | );
232 | }
233 |
234 | export default UpdateUser;
235 |
--------------------------------------------------------------------------------
/frontend/src/components/Admin/InterviewerManagement/UpdateInterviewer.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Button,
4 | Grid,
5 | IconButton,
6 | Paper,
7 | TextField,
8 | Typography,
9 | } from "@mui/material";
10 | import React, { useEffect, useState } from "react";
11 | import { useLocation, useNavigate } from "react-router-dom";
12 | import { useForm } from "react-hook-form";
13 | import axios from "../../../axiosinstance";
14 | import Toast from "../../Sweetalert/sweetAlert";
15 | import CloseIcon from "@mui/icons-material/Close";
16 |
17 | function UpdateInterviewer() {
18 | const location = useLocation();
19 | const [userId, setUserId] = useState("");
20 | const {
21 | register,
22 | handleSubmit,
23 | reset,
24 | formState: { errors },
25 | } = useForm();
26 | const [users, setUsers] = useState({
27 | name: "",
28 | phone: "",
29 | email: "",
30 | about: "",
31 | });
32 |
33 | const navigate = useNavigate();
34 |
35 | const editOnSubmit = () => {
36 | const { name, phone, email, about, experience } = users;
37 | const values = {
38 | name,
39 | phone,
40 | email,
41 | about,
42 | experience,
43 | };
44 | axios
45 | .put(`/api/admin/manage/interviewer/update/${userId}`, values, {
46 | headers: {
47 | authToken: localStorage.getItem("admintoken"),
48 | },
49 | })
50 | .then((res) => {
51 | const message = res.data.message;
52 | Toast.fire({
53 | icon: "success",
54 | title: message,
55 | });
56 | navigate("/admin/interviewer");
57 | })
58 | .catch((err) => {
59 | Toast.fire({
60 | icon: "error",
61 | title: "Something went wrong",
62 | });
63 | });
64 | reset({ values });
65 | };
66 |
67 | useEffect(() => {
68 | const token = localStorage.getItem("admintoken");
69 | const id = location.state.id;
70 | setUserId(id);
71 | axios
72 | .get(`api/user/details/${id}`, {
73 | headers: {
74 | authToken: token,
75 | },
76 | })
77 | .then((res) => {
78 | setUsers(res.data.user);
79 | reset(res.data.user)
80 | });
81 | }, [location.state.id, reset]);
82 |
83 | const handleChange = (e) => {
84 | const { name, value } = e.target;
85 | setUsers({
86 | ...users,
87 | [name]: value,
88 | });
89 | };
90 |
91 | const handleCloseClick = () => {
92 | navigate("/admin/interviewer");
93 | };
94 |
95 | return (
96 |
97 |
104 |
115 |
119 | Edit Interviewer
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
139 |
248 |
249 |
250 |
251 |
252 | );
253 | }
254 |
255 | export default UpdateInterviewer;
256 |
--------------------------------------------------------------------------------
/frontend/src/components/User/Aside.js:
--------------------------------------------------------------------------------
1 | import { Avatar, Box, Grid, Paper, Typography } from "@mui/material";
2 | import React, { useEffect, useState } from "react";
3 | import { useSelector } from "react-redux";
4 | import { useNavigate } from "react-router-dom";
5 | import NotificationsActiveIcon from "@mui/icons-material/NotificationsActive";
6 | import UpcomingIcon from "@mui/icons-material/Upcoming";
7 | import DynamicFeedIcon from "@mui/icons-material/DynamicFeed";
8 | import axios from "../../axiosinstance";
9 | import SensorOccupiedIcon from "@mui/icons-material/SensorOccupied";
10 |
11 | function Aside() {
12 | const navigate = useNavigate();
13 | const user = useSelector((state) => state.userData.value);
14 |
15 | const [postCount, setPostCount] = useState(0);
16 | const [pending, setPending] = useState(0);
17 | const [completed, setCompleted] = useState(0);
18 |
19 | useEffect(() => {
20 | const token = localStorage.getItem("usertoken");
21 | if (!token) {
22 | navigate("/");
23 | }
24 | }, [navigate]);
25 |
26 | useEffect(() => {
27 | const getPostData = () => {
28 | axios
29 | .get(`api/post/posts/${user._id}`, {
30 | headers: {
31 | authToken: localStorage.getItem("usertoken"),
32 | },
33 | })
34 | .then((res) => {
35 | setPostCount(res.data.postsCount);
36 | });
37 | };
38 |
39 | const getUpcommingData = () => {
40 | axios
41 | .get(`api/interview//user/upcomming/${user._id}`, {
42 | headers: {
43 | authToken: localStorage.getItem("usertoken"),
44 | },
45 | })
46 | .then((res) => {
47 | setPending(res.data.pendingCount);
48 | setCompleted(res.data.completedCount);
49 | });
50 | };
51 |
52 | getPostData();
53 | getUpcommingData();
54 | }, [user]);
55 |
56 | const handleClickNotification = () => {
57 | navigate("/notifications");
58 | };
59 |
60 | const handleClickUpcomming = () => {
61 | navigate("/upcomming");
62 | };
63 |
64 | const handleClickPosts = () => {
65 | navigate('/posts')
66 | }
67 |
68 | const handleClickInterviews = () => {
69 | navigate('/interviews')
70 | }
71 |
72 | return (
73 |
74 |
75 |
83 |
91 |
99 |
100 |
104 |
105 |
111 |
118 | {user?.name }
119 |
120 |
126 | {user && user?.about}
127 |
128 |
129 |
135 |
143 |
144 | Networks
145 |
146 |
147 | {user?.connections?.length}
148 |
149 |
150 |
158 |
159 | Pending Requests
160 |
161 |
162 | {pending}
163 |
164 |
165 |
166 |
167 |
175 |
176 |
177 |
178 |
179 |
185 | Notifications
186 |
187 |
188 |
189 |
197 |
198 |
199 |
200 |
201 |
206 | Upcomming
207 |
208 |
209 |
210 |
218 |
219 |
220 |
221 |
222 |
223 | My Posts
224 |
225 |
226 |
227 |
235 |
236 |
237 |
238 |
239 |
240 | My Interviews
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 | );
250 | }
251 |
252 | export default Aside;
253 |
--------------------------------------------------------------------------------