├── sms-frontend ├── README.md ├── public │ ├── _redirects │ ├── favicon.png │ └── index.html ├── src │ ├── img │ │ ├── admin.jpg │ │ └── school.jpg │ ├── App.js │ ├── Pages │ │ └── Dashboard │ │ │ ├── Main-Dashboard │ │ │ ├── AllPages │ │ │ │ ├── Admin │ │ │ │ │ ├── CSS │ │ │ │ │ │ ├── Payment.scss │ │ │ │ │ │ ├── AddBed.scss │ │ │ │ │ │ └── AddTeacher.scss │ │ │ │ │ ├── AllDoubts.jsx │ │ │ │ │ ├── AddNotice.jsx │ │ │ │ │ ├── AddAdmin.jsx │ │ │ │ │ ├── AddStudent.jsx │ │ │ │ │ └── AddTeacher.jsx │ │ │ │ ├── Student │ │ │ │ │ ├── CSS │ │ │ │ │ │ ├── BookAppointment.scss │ │ │ │ │ │ ├── Appointment.scss │ │ │ │ │ │ └── Profiles.scss │ │ │ │ │ ├── AddDoubt.jsx │ │ │ │ │ └── StudentProfile.jsx │ │ │ │ └── Teacher │ │ │ │ │ ├── CSS │ │ │ │ │ └── TeacherProfile.scss │ │ │ │ │ ├── CheckReports.jsx │ │ │ │ │ ├── CreateReport.jsx │ │ │ │ │ └── TeacherProfile.jsx │ │ │ └── GlobalFiles │ │ │ │ ├── Topbar.jsx │ │ │ │ ├── FrontPage.jsx │ │ │ │ ├── CommonCSS.scss │ │ │ │ └── Sidebar.jsx │ │ │ └── Dashboard-Login │ │ │ ├── DLogin.scss │ │ │ └── DLogin.jsx │ ├── Redux │ │ ├── index.js │ │ ├── Datas │ │ │ ├── types.js │ │ │ ├── reducer.js │ │ │ └── action.js │ │ ├── auth │ │ │ ├── types.js │ │ │ ├── reducer.js │ │ │ └── action.js │ │ └── store.js │ ├── App.scss │ ├── index.js │ └── Routes │ │ └── AllRoutes.jsx ├── .gitignore └── package.json ├── sms-backend ├── readme.md ├── .gitignore ├── Config │ └── db.js ├── models │ ├── quiz.model.js │ ├── notice.model.js │ ├── doubt.model.js │ ├── report.model.js │ ├── admin.model.js │ ├── student.model.js │ └── teacher.model.js ├── package.json ├── middlewares │ ├── admin.middleware.js │ ├── teacher.middleware.js │ └── student.middleware.js ├── routes │ ├── quiz.route.js │ ├── school.route.js │ ├── doubt.route.js │ ├── notice.route.js │ ├── reports.route.js │ ├── student.route.js │ ├── teacher.route.js │ └── admin.route.js └── index.js ├── sma-chat-backend ├── .gitignore ├── package.json └── index.js ├── sms-chat-frontend ├── .gitignore ├── build │ ├── favicon.png │ ├── asset-manifest.json │ ├── static │ │ ├── js │ │ │ ├── runtime-main.03887cff.js │ │ │ ├── 2.c372d7dd.chunk.js.LICENSE.txt │ │ │ ├── main.069092f1.chunk.js │ │ │ ├── runtime-main.03887cff.js.map │ │ │ └── main.069092f1.chunk.js.map │ │ └── css │ │ │ ├── main.b18b9ae0.chunk.css │ │ │ └── main.b18b9ae0.chunk.css.map │ └── index.html ├── public │ ├── favicon.png │ └── index.html ├── src │ ├── index.js │ ├── components │ │ ├── Header │ │ │ ├── Header.jsx │ │ │ └── Header.css │ │ ├── Call │ │ │ ├── call.css │ │ │ └── call.jsx │ │ ├── Video │ │ │ ├── Video.css │ │ │ └── Video.jsx │ │ └── ID │ │ │ ├── ID.css │ │ │ └── ID.jsx │ ├── App.js │ ├── App.css │ └── Context.js ├── package.json ├── .eslintrc.js └── readme.md └── README.md /sms-frontend/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sms-backend/readme.md: -------------------------------------------------------------------------------- 1 | Hello -------------------------------------------------------------------------------- /sma-chat-backend/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /sms-backend/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | .env -------------------------------------------------------------------------------- /sms-frontend/public/_redirects: -------------------------------------------------------------------------------- 1 | /* /index.html 200. -------------------------------------------------------------------------------- /sms-chat-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # Local Netlify folder 2 | .netlify 3 | -------------------------------------------------------------------------------- /sms-frontend/src/img/admin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frozen-dev71/School-Management-System/main/sms-frontend/src/img/admin.jpg -------------------------------------------------------------------------------- /sms-frontend/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frozen-dev71/School-Management-System/main/sms-frontend/public/favicon.png -------------------------------------------------------------------------------- /sms-frontend/src/img/school.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frozen-dev71/School-Management-System/main/sms-frontend/src/img/school.jpg -------------------------------------------------------------------------------- /sms-chat-frontend/build/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frozen-dev71/School-Management-System/main/sms-chat-frontend/build/favicon.png -------------------------------------------------------------------------------- /sms-chat-frontend/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frozen-dev71/School-Management-System/main/sms-chat-frontend/public/favicon.png -------------------------------------------------------------------------------- /sms-backend/Config/db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | require("dotenv").config(); 3 | 4 | const connection = mongoose.connect(process.env.dbURL); 5 | 6 | module.exports = { connection }; -------------------------------------------------------------------------------- /sms-frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import "./App.scss"; 2 | import AllRoutes from "./Routes/AllRoutes"; 3 | 4 | function App() { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | } 11 | 12 | export default App; 13 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/CSS/Payment.scss: -------------------------------------------------------------------------------- 1 | @media only screen and (max-width: 900px) { 2 | .patientBox { 3 | width: 60%; 4 | border: 2px solid; 5 | } 6 | 7 | .Payment_Page { 8 | width: 30%; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from "redux"; 2 | import authReducer from "./auth/reducer"; 3 | import dataReducer from "./Datas/reducer"; 4 | export const rootReducer = combineReducers({ 5 | auth: authReducer, 6 | data: dataReducer, 7 | }); 8 | -------------------------------------------------------------------------------- /sms-backend/models/quiz.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const quizSchema = mongoose.Schema({ 4 | 5 | 6 | email: { 7 | type: String, 8 | }, 9 | 10 | score: { 11 | type: String, 12 | }, 13 | 14 | }); 15 | 16 | const QuizModel = mongoose.model("quiz", quizSchema); 17 | 18 | module.exports = { QuizModel }; 19 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | 4 | import App from './App'; 5 | import { ContextProvider } from './Context'; 6 | 7 | import './App.css'; 8 | 9 | ReactDOM.render( 10 | 11 | 12 | , 13 | document.getElementById('root'), 14 | ); 15 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/Header/Header.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Header.css'; 3 | 4 | export default function Header() { 5 | return ( 6 |
7 |

Lets Meet

8 | 9 |

Home

10 |
11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /sms-frontend/src/App.scss: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap"); 2 | 3 | * { 4 | margin: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | } 8 | 9 | body { 10 | font-family: "Poppins", sans-serif; 11 | } 12 | 13 | .inputdiv input::placeholder { 14 | font-family: "Poppins", sans-serif; 15 | opacity: 1; 16 | } 17 | -------------------------------------------------------------------------------- /sms-backend/models/notice.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const noticetSchema = mongoose.Schema({ 4 | 5 | 6 | details: { 7 | type: String, 8 | }, 9 | 10 | title: { 11 | type: String, 12 | }, 13 | 14 | 15 | date: { 16 | type: Date, 17 | }, 18 | 19 | 20 | }); 21 | 22 | const NoticeModel = mongoose.model("notice", noticetSchema); 23 | 24 | module.exports = { NoticeModel }; 25 | -------------------------------------------------------------------------------- /sms-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 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Student/CSS/BookAppointment.scss: -------------------------------------------------------------------------------- 1 | .book_formsubmitbutton { 2 | border: none; 3 | padding: 1rem; 4 | display: block; 5 | margin: auto; 6 | margin-top: 2rem; 7 | font-size: 1.6rem; 8 | border-radius: 10px; 9 | background-color: #fdb095; 10 | } 11 | 12 | @media only screen and (max-width: 1024px) { 13 | .book_formsubmitbutton { 14 | width: 50%; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sma-chat-backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "videochat", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "dev": "nodemon index.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "cors": "^2.8.5", 15 | "express": "^4.17.1", 16 | "nodemon": "^2.0.7", 17 | "serve": "^11.3.2", 18 | "socket.io": "^4.0.0" 19 | } 20 | } -------------------------------------------------------------------------------- /sms-chat-frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import VideoPlayer from './components/Video/Video'; 3 | import ID from './components/ID/ID'; 4 | import Call from './components/Call/call'; 5 | import Header from './components/Header/Header'; 6 | 7 | export default function App() { 8 | return ( 9 |
10 |
11 | 12 | 13 | 14 | 15 |
16 | ); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/Header/Header.css: -------------------------------------------------------------------------------- 1 | .header { 2 | width: 100%; 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | padding: 1rem; 7 | gap: 20px; 8 | background-color: rgba(240, 248, 255, 0.393); 9 | 10 | } 11 | .header a { 12 | color: white; 13 | background-color: #5a77e8; 14 | border-radius: 10px; 15 | padding: 5px 10px; 16 | cursor: pointer; 17 | text-decoration: none; 18 | font-weight: 500; 19 | } 20 | -------------------------------------------------------------------------------- /sms-frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import App from "./App"; 4 | import { BrowserRouter } from "react-router-dom"; 5 | import { Provider } from "react-redux"; 6 | import { store } from "./Redux/store"; 7 | const root = ReactDOM.createRoot(document.getElementById("root")); 8 | root.render( 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /sms-chat-frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Video Chat 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/Call/call.css: -------------------------------------------------------------------------------- 1 | .call { 2 | position: absolute; 3 | top: 0; 4 | right: 0; 5 | margin: 1rem 2rem; 6 | padding: 1rem; 7 | background-color: aliceblue; 8 | border-radius: 10px; 9 | } 10 | .call > div:nth-child(2) { 11 | margin-top: 10px; 12 | background-color: rgb(34, 189, 34); 13 | color: white; 14 | font-weight: 700; 15 | text-align: center; 16 | } 17 | .decline { 18 | background-color: rgb(215, 53, 53); 19 | color: white; 20 | text-align: center; 21 | } 22 | -------------------------------------------------------------------------------- /sms-frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | School Management System 13 | 14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/App.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap"); 2 | 3 | body { 4 | background: url(https://images.unsplash.com/photo-1618556450994-a6a128ef0d9d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=764&q=80); 5 | background-repeat: no-repeat; 6 | background-size: cover; 7 | position: relative; 8 | } 9 | body::-webkit-scrollbar { 10 | display: none; 11 | } 12 | * { 13 | margin: 0; 14 | padding: 0; 15 | font-family: "Rubik", sans-serif; 16 | } 17 | -------------------------------------------------------------------------------- /sms-backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sms-backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "dev": "nodemon index.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "bcrypt": "^5.1.0", 15 | "cors": "^2.8.5", 16 | "dotenv": "^16.0.3", 17 | "express": "^4.18.2", 18 | "jsonwebtoken": "^8.5.1", 19 | "mongoose": "^6.9.0", 20 | "nodemailer": "^6.9.1", 21 | "nodemon": "^2.0.20", 22 | "validator": "^13.7.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sms-backend/middlewares/admin.middleware.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | require("dotenv").config(); 3 | 4 | const authenticate = (req, res, next) => { 5 | const token = req.headers.authorization; 6 | if (token) { 7 | const decoded = jwt.verify(token, process.env.key); 8 | if (decoded) { 9 | const adminID = decoded.adminID; 10 | req.body.adminID = adminID; 11 | next(); 12 | } else { 13 | res.send("You cannot edit this token."); 14 | } 15 | } else { 16 | res.send("Inadequate permissions, Please login first."); 17 | } 18 | }; 19 | 20 | module.exports = { authenticate }; -------------------------------------------------------------------------------- /sms-backend/models/doubt.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const doubtSchema = mongoose.Schema({ 4 | class: { 5 | type: String, 6 | }, 7 | 8 | studentID: { 9 | type: String 10 | }, 11 | 12 | 13 | subject: { 14 | type: String, 15 | }, 16 | 17 | 18 | teacher: { 19 | type: String, 20 | }, 21 | 22 | details: { 23 | type: String, 24 | }, 25 | 26 | image: { 27 | type: String, 28 | }, 29 | 30 | 31 | date: { 32 | type: Date, 33 | }, 34 | }); 35 | 36 | const DoubtModel = mongoose.model("doubt", doubtSchema); 37 | 38 | module.exports = { DoubtModel }; 39 | -------------------------------------------------------------------------------- /sms-backend/middlewares/teacher.middleware.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | require("dotenv").config(); 3 | 4 | const authenticate = (req, res, next) => { 5 | const token = req.headers.authorization; 6 | if (token) { 7 | const decoded = jwt.verify(token, process.env.key); 8 | if (decoded) { 9 | const teacherID = decoded.teacherID; 10 | req.body.teacherID = teacherID; 11 | next(); 12 | } else { 13 | res.send("You cannot edit this token."); 14 | } 15 | } else { 16 | res.send("Inadequate permissions, Please login first."); 17 | } 18 | }; 19 | 20 | module.exports = { authenticate }; -------------------------------------------------------------------------------- /sms-backend/middlewares/student.middleware.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | require("dotenv").config(); 3 | 4 | const authenticate = (req, res, next) => { 5 | const token = req.headers.authorization; 6 | if (token) { 7 | const decoded = jwt.verify(token, process.env.key); 8 | if (decoded) { 9 | const studentID = decoded.studentID; 10 | req.body.studentID = studentID; 11 | next(); 12 | } else { 13 | res.send("You cannot edit this token."); 14 | } 15 | } else { 16 | res.send("Inadequate permissions, Please login first."); 17 | } 18 | }; 19 | 20 | module.exports = { authenticate }; 21 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/Video/Video.css: -------------------------------------------------------------------------------- 1 | .video { 2 | width: 100vw; 3 | display: flex; 4 | margin-top: 25px; 5 | height: 100vh; 6 | } 7 | .video > div { 8 | width: 600px; 9 | justify-content: center; 10 | align-items: center; 11 | margin: 0 auto; 12 | } 13 | video { 14 | width: 100%; 15 | } 16 | @media screen and (max-width: 1100px) { 17 | .video > div { 18 | width: 400px; 19 | } 20 | } 21 | @media screen and (max-width: 900px) { 22 | .video { 23 | display: flex; 24 | flex-direction: column; 25 | gap: 1rem; 26 | } 27 | } 28 | @media screen and (max-width: 50px) { 29 | .video > div { 30 | width: 300px; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/GlobalFiles/Topbar.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { FaUserMd } from "react-icons/fa"; 3 | import "./CommonCSS.scss"; 4 | 5 | const Topbar = ({ onclick }) => { 6 | return ( 7 | <> 8 |
9 |
10 |

HMS

11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 | 20 | ); 21 | }; 22 | 23 | export default Topbar; 24 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/Call/call.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext } from 'react'; 2 | import './call.css'; 3 | import { SocketContext } from '../../Context'; 4 | 5 | const Notifications = () => { 6 | const { answerCall, call, callAccepted, leaveCall } = useContext(SocketContext); 7 | 8 | return ( 9 | <> 10 | {call.isReceivingCall && !callAccepted && ( 11 |
12 |

Call from {call.name ? call.name : 'unknown'}

13 |
Answer
14 |
Decline
15 |
16 | )} 17 | 18 | ); 19 | }; 20 | 21 | export default Notifications; 22 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/ID/ID.css: -------------------------------------------------------------------------------- 1 | .form { 2 | width: 100%; 3 | padding: 1rem; 4 | display: flex; 5 | flex-direction: column; 6 | justify-content: center; 7 | align-items: center; 8 | background-color: rgba(158, 210, 255, 0.54); 9 | gap: 1rem; 10 | position: relative; 11 | } 12 | .form > div { 13 | display: flex; 14 | align-items: center; 15 | gap: 20px; 16 | } 17 | .form > div input { 18 | padding: 5px; 19 | outline: none; 20 | border: none; 21 | border-radius: 5px; 22 | } 23 | .button { 24 | color: white; 25 | background-color: #5a77e8; 26 | border-radius: 5px; 27 | padding: 5px 10px; 28 | cursor: pointer; 29 | text-decoration: none; 30 | font-weight: 400; 31 | margin: 5px 0; 32 | } 33 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/Datas/types.js: -------------------------------------------------------------------------------- 1 | export const GET_DOUBT_SUCCESS = " GET_DOUBT_SUCCESS"; 2 | export const GET_DOUBT_ERROR = "GET_DOUBT_ERROR"; 3 | export const GET_DOUBT_REQUEST = "GET_DOUBT_REQUEST"; 4 | 5 | export const DELETE_DOUBT_SUCCESS = " DELETE_DOUBT_SUCCESS"; 6 | export const DELETE_DOUBT_REQUEST = "DELETE_DOUBT_REQUEST"; 7 | 8 | export const GET_NOTICE_SUCCESS = " GET_NOTICE_SUCCESS"; 9 | export const GET_NOTICE_ERROR = "GET_NOTICE_ERROR"; 10 | export const GET_NOTICE_REQUEST = "GET_NOTICE_REQUEST"; 11 | 12 | export const GET_REPORT_DETAILS_SUCCESS = 13 | " GET_APPOINTMENT_DETAILS_SUCCESS"; 14 | 15 | export const GET_ALLDATA_SUCCESS = " GET_ALLDATA_SUCCESS"; 16 | export const GET_ALLDATA_REQUEST = "GET_ALLDATA_REQUEST"; 17 | 18 | export const DELETE_REPORT_SUCCESS = " DELETE_APPOINTMENT_SUCCESS"; 19 | -------------------------------------------------------------------------------- /sms-backend/routes/quiz.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { QuizModel } = require("../models/quiz.model"); 3 | 4 | const router = express.Router(); 5 | 6 | router.get("/", async (req, res) => { 7 | let query = req.body; 8 | try { 9 | const quizes = await QuizModel.find(query); 10 | res.status(200).send(quizes); 11 | } catch (error) { 12 | console.log(error); 13 | res.status(400).send({ error: "Something went wrong" }); 14 | } 15 | }); 16 | 17 | router.post("/create", async (req, res) => { 18 | const payload = req.body; 19 | try { 20 | const quiz = new QuizModel(payload); 21 | await quiz.save(); 22 | res.send({ message: "quiz successfully created", quiz }); 23 | } catch (error) { 24 | res.send(error); 25 | } 26 | }); 27 | 28 | 29 | module.exports = router; 30 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/Video/Video.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext } from 'react'; 2 | import { SocketContext } from '../../Context'; 3 | import './Video.css'; 4 | 5 | const VideoPlayer = () => { 6 | const { callAccepted, myVideo, userVideo, callEnded, stream } = useContext(SocketContext); 7 | 8 | return ( 9 |
10 | {stream && ( 11 |
12 |
13 |
15 |
16 | )} 17 | {callAccepted && !callEnded && ( 18 |
19 |
20 |
22 |
23 | )} 24 |
25 | ); 26 | }; 27 | 28 | export default VideoPlayer; 29 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/auth/types.js: -------------------------------------------------------------------------------- 1 | export const LOGIN_STUDENT_REQUEST = "LOGIN_STUDENT_REQUEST"; 2 | export const LOGIN_STUDENT_ERROR = "LOGIN_STUDENT_ERROR"; 3 | export const LOGIN_STUDENT_SUCCESS = "LOGIN_STUDENT_SUCCESS"; 4 | 5 | export const LOGIN_TEACHER_SUCCESS = "LOGIN_TEACHER_SUCCESS"; 6 | export const LOGIN_TEACHER_ERROR = "LOGIN_TEACHER_ERROR"; 7 | export const LOGIN_TEACHER_REQUEST = "LOGIN_TEACHER_REQUEST"; 8 | 9 | export const LOGIN_ADMIN_ERROR = "LOGIN_ADMIN_ERROR"; 10 | export const LOGIN_ADMIN_SUCCESS = "LOGIN_ADMIN_SUCCESS"; 11 | export const LOGIN_ADMIN_REQUEST = "LOGIN_ADMIN_REQUEST"; 12 | 13 | export const AUTH_LOGOUT = "AUTH_LOGOUT"; 14 | 15 | export const EDIT_STUDENT_SUCCESS = " EDIT_STUDENT_SUCCESS"; 16 | export const EDIT_STUDENT_REQUEST = "EDIT_STUDENT_REQUEST"; 17 | 18 | export const EDIT_TEACHER_SUCCESS = " EDIT_TEACHER_SUCCESS"; 19 | export const EDIT_TEACHER_REQUEST = "EDIT_TEACHER_REQUEST"; 20 | -------------------------------------------------------------------------------- /sms-backend/models/report.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const reportSchema = mongoose.Schema({ 4 | 5 | 6 | details: { 7 | type: String, 8 | }, 9 | 10 | name: { 11 | type: String, 12 | 13 | }, 14 | 15 | age: { 16 | type: Number, 17 | 18 | }, 19 | 20 | email: { 21 | type: String, 22 | 23 | }, 24 | 25 | gender: { 26 | type: String, 27 | 28 | }, 29 | 30 | mobile: { 31 | type: Number, 32 | 33 | }, 34 | 35 | marks: [ 36 | { 37 | subject: { 38 | type: String, 39 | }, 40 | score: { 41 | type: Number, 42 | }, 43 | total: { 44 | type: Number, 45 | }, 46 | }, 47 | ], 48 | 49 | 50 | date: { 51 | type: Date, 52 | }, 53 | 54 | class: { 55 | type: Number, 56 | }, 57 | 58 | }); 59 | 60 | const ReportModel = mongoose.model("report", reportSchema); 61 | 62 | module.exports = { ReportModel }; 63 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "main.css": "/static/css/main.b18b9ae0.chunk.css", 4 | "main.js": "/static/js/main.069092f1.chunk.js", 5 | "main.js.map": "/static/js/main.069092f1.chunk.js.map", 6 | "runtime-main.js": "/static/js/runtime-main.03887cff.js", 7 | "runtime-main.js.map": "/static/js/runtime-main.03887cff.js.map", 8 | "static/js/2.c372d7dd.chunk.js": "/static/js/2.c372d7dd.chunk.js", 9 | "static/js/2.c372d7dd.chunk.js.map": "/static/js/2.c372d7dd.chunk.js.map", 10 | "index.html": "/index.html", 11 | "static/css/main.b18b9ae0.chunk.css.map": "/static/css/main.b18b9ae0.chunk.css.map", 12 | "static/js/2.c372d7dd.chunk.js.LICENSE.txt": "/static/js/2.c372d7dd.chunk.js.LICENSE.txt" 13 | }, 14 | "entrypoints": [ 15 | "static/js/runtime-main.03887cff.js", 16 | "static/js/2.c372d7dd.chunk.js", 17 | "static/css/main.b18b9ae0.chunk.css", 18 | "static/js/main.069092f1.chunk.js" 19 | ] 20 | } -------------------------------------------------------------------------------- /sma-chat-backend/index.js: -------------------------------------------------------------------------------- 1 | const app = require("express")(); 2 | const server = require("http").createServer(app); 3 | const cors = require("cors"); 4 | 5 | const io = require("socket.io")(server, { 6 | cors: { 7 | origin: "*", 8 | methods: ["GET", "POST"], 9 | }, 10 | }); 11 | 12 | app.use(cors()); 13 | 14 | const PORT = process.env.PORT || 5000; 15 | 16 | app.get("/", (req, res) => { 17 | res.send("Running"); 18 | }); 19 | 20 | io.on("connection", (socket) => { 21 | socket.emit("me", socket.id); 22 | 23 | socket.on("disconnect", () => { 24 | socket.broadcast.emit("callEnded"); 25 | }); 26 | 27 | socket.on("callUser", ({ userToCall, signalData, from, name }) => { 28 | io.to(userToCall).emit("callUser", { signal: signalData, from, name }); 29 | }); 30 | 31 | socket.on("answerCall", (data) => { 32 | io.to(data.to).emit("callAccepted", data.signal); 33 | }); 34 | }); 35 | 36 | server.listen(PORT, () => console.log(`Server is running on port ${PORT}`)); 37 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Student/CSS/Appointment.scss: -------------------------------------------------------------------------------- 1 | .MainAppointment { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | padding: 1rem; 6 | } 7 | 8 | form { 9 | display: flex; 10 | flex-direction: column; 11 | gap: 1rem; 12 | border: 1px solid; 13 | border-radius: 5px; 14 | padding: 2rem; 15 | } 16 | 17 | :where(.css-dev-only-do-not-override-1s3dcof).ant-select-single:not( 18 | .ant-select-customize-input 19 | ) 20 | .ant-select-selector { 21 | width: 100%; 22 | height: 43px; 23 | padding: 0 11px; 24 | justify-content: center; 25 | display: flex; 26 | align-items: center; 27 | } 28 | 29 | .dateofAppointment div { 30 | display: flex; 31 | gap: 1rem; 32 | } 33 | 34 | .SubmitButton { 35 | height: 3rem; 36 | font-size: 1.2rem; 37 | } 38 | 39 | .GenderClass { 40 | display: flex; 41 | gap: 1rem; 42 | } 43 | 44 | .GenderClass div { 45 | display: flex; 46 | gap: 10px; 47 | align-items: center; 48 | } 49 | 50 | .ChangeDisplayProblem { 51 | border: 2px solid; 52 | } 53 | -------------------------------------------------------------------------------- /sms-backend/models/admin.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const adminSchema = mongoose.Schema({ 4 | userType: { 5 | type: String, 6 | default: "admin", 7 | }, 8 | 9 | adminID: { 10 | type: Number, 11 | required: true, 12 | }, 13 | 14 | adminName: { 15 | type: String, 16 | }, 17 | 18 | email: { 19 | type: String, 20 | }, 21 | 22 | password: { 23 | type: String, 24 | required: true, 25 | }, 26 | 27 | gender: { 28 | type: String, 29 | }, 30 | 31 | age: { 32 | type: Number, 33 | }, 34 | 35 | mobile: { 36 | type: Number, 37 | minlength: 10, 38 | }, 39 | 40 | DOB: { 41 | type: String, 42 | }, 43 | 44 | address: { 45 | type: String, 46 | }, 47 | 48 | education: { 49 | type: String, 50 | }, 51 | 52 | image: { 53 | type: String, 54 | default: 55 | "https://res.cloudinary.com/diverse/image/upload/v1674562453/diverse/oipm1ecb1yudf9eln7az.jpg", 56 | }, 57 | }); 58 | 59 | const AdminModel = mongoose.model("admin", adminSchema); 60 | 61 | module.exports = { AdminModel }; 62 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/store.js: -------------------------------------------------------------------------------- 1 | import { 2 | legacy_createStore as createStore, 3 | applyMiddleware, 4 | compose, 5 | } from "redux"; 6 | import thunk from "redux-thunk"; 7 | import { rootReducer } from "./index.js"; 8 | 9 | function saveToLocalStorage(store) { 10 | try { 11 | const serializedStore = JSON.stringify(store); 12 | window.localStorage.setItem("store", serializedStore); 13 | } catch (e) { 14 | console.log(e); 15 | } 16 | } 17 | 18 | function loadFromLocalStorage() { 19 | try { 20 | const serializedStore = window.localStorage.getItem("store"); 21 | if (serializedStore === null) return undefined; 22 | return JSON.parse(serializedStore); 23 | } catch (e) { 24 | console.log(e); 25 | return undefined; 26 | } 27 | } 28 | const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; 29 | const persistedState = loadFromLocalStorage(); 30 | 31 | export const store = createStore( 32 | rootReducer, 33 | persistedState, 34 | composeEnhancers(applyMiddleware(thunk)) 35 | ); 36 | 37 | store.subscribe(() => saveToLocalStorage(store.getState())); 38 | 39 | 40 | -------------------------------------------------------------------------------- /sms-backend/routes/school.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { AdminModel } = require("../models/admin.model"); 3 | const { TeacherModel } = require("../models/teacher.model"); 4 | const { StudentModel } = require("../models/student.model"); 5 | const { NoticeModel } = require("../models/notice.model"); 6 | const { ReportModel } = require("../models/report.model"); 7 | 8 | const router = express.Router(); 9 | 10 | router.get("/", async (req, res) => { 11 | try { 12 | let admins = await AdminModel.find(); 13 | let students = await StudentModel.find(); 14 | let teachers = await TeacherModel.find(); 15 | let reports = await ReportModel.find(); 16 | let notices = await NoticeModel.find(); 17 | 18 | let data = { 19 | admin: admins.length, 20 | student: students.length, 21 | report: reports.length, 22 | teacher: teachers.length, 23 | notice: notices.length, 24 | }; 25 | res.status(200).send({ data }); 26 | } catch (error) { 27 | console.log(error); 28 | res.status(400).send({ error: "Something went wrong" }); 29 | } 30 | }); 31 | 32 | module.exports = router; 33 | 34 | -------------------------------------------------------------------------------- /sms-backend/models/student.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const studentSchema = mongoose.Schema({ 4 | userType: { 5 | type: String, 6 | default: "student", 7 | }, 8 | 9 | studentID: { 10 | type: Number, 11 | required: true, 12 | }, 13 | 14 | studentName: { 15 | type: String, 16 | }, 17 | 18 | mobile: { 19 | type: Number, 20 | minlength: 10, 21 | }, 22 | 23 | email: { 24 | type: String, 25 | }, 26 | 27 | password: { 28 | type: String, 29 | required: true, 30 | }, 31 | 32 | age: { 33 | type: Number, 34 | }, 35 | 36 | gender: { 37 | type: String, 38 | }, 39 | 40 | 41 | 42 | DOB: { 43 | type: String, 44 | }, 45 | 46 | address: { 47 | type: String, 48 | }, 49 | 50 | class: { 51 | type: String, 52 | }, 53 | 54 | image: { 55 | type: String, 56 | default: 57 | "https://res.cloudinary.com/diverse/image/upload/v1674562453/diverse/oipm1ecb1yudf9eln7az.jpg", 58 | }, 59 | 60 | details: { 61 | type: String, 62 | }, 63 | }); 64 | 65 | const StudentModel = mongoose.model("student", studentSchema); 66 | 67 | module.exports = { StudentModel }; 68 | -------------------------------------------------------------------------------- /sms-backend/models/teacher.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const teacherSchema = mongoose.Schema({ 4 | userType: { 5 | type: String, 6 | default: "teacher", 7 | }, 8 | 9 | teacherID: { 10 | type: Number, 11 | required: true, 12 | }, 13 | 14 | teacherName: { 15 | type: String, 16 | }, 17 | 18 | mobile: { 19 | type: Number, 20 | }, 21 | 22 | email: { 23 | type: String, 24 | }, 25 | 26 | password: { 27 | type: String, 28 | required: true, 29 | }, 30 | 31 | age: { 32 | type: Number, 33 | }, 34 | 35 | gender: { 36 | type: String, 37 | }, 38 | 39 | subject: { 40 | type: String, 41 | }, 42 | 43 | DOB: { 44 | type: Date, 45 | }, 46 | 47 | address: { 48 | type: String, 49 | }, 50 | 51 | education: { 52 | type: String, 53 | }, 54 | 55 | image: { 56 | type: String, 57 | default: 58 | "https://res.cloudinary.com/diverse/image/upload/v1674562453/diverse/oipm1ecb1yudf9eln7az.jpg", 59 | }, 60 | 61 | details: { 62 | type: String, 63 | }, 64 | }); 65 | 66 | const TeacherModel = mongoose.model("teacher", teacherSchema); 67 | 68 | module.exports = { TeacherModel }; 69 | -------------------------------------------------------------------------------- /sms-backend/routes/doubt.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { DoubtModel } = require("../models/doubt.model"); 3 | 4 | const router = express.Router(); 5 | 6 | router.post("/", async (req, res) => { 7 | let query = req.body; 8 | try { 9 | const doubts = await DoubtModel.find(query); 10 | res.status(200).send(doubts); 11 | } catch (error) { 12 | console.log(error); 13 | res.status(400).send({ error: "Something went wrong" }); 14 | } 15 | }); 16 | 17 | router.post("/create", async (req, res) => { 18 | const payload = req.body; 19 | try { 20 | const doubt = new DoubtModel(payload); 21 | await doubt.save(); 22 | res.send({ message: "doubt successfully created", doubt }); 23 | } catch (error) { 24 | res.send(error); 25 | } 26 | }); 27 | 28 | 29 | router.delete("/:doubtId", async (req, res) => { 30 | const id = req.params.doubtId; 31 | try { 32 | const doubt = await DoubtModel.findByIdAndDelete({ _id: id }); 33 | if (!doubt) { 34 | res.status(404).send({ msg: `doubt with id ${id} not found` }); 35 | } 36 | res.status(200).send(`doubt with id ${id} deleted`); 37 | } catch (error) { 38 | console.log(error); 39 | res.status(400).send({ error: "Something went wrong, unable to Delete." }); 40 | } 41 | }); 42 | 43 | module.exports = router; 44 | -------------------------------------------------------------------------------- /sms-backend/routes/notice.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { NoticeModel } = require("../models/notice.model"); 3 | 4 | const router = express.Router(); 5 | 6 | router.get("/", async (req, res) => { 7 | let query = req.query; 8 | try { 9 | const notices = await NoticeModel.find(query); 10 | res.status(200).send(notices); 11 | } catch (error) { 12 | console.log(error); 13 | res.status(400).send({ error: "Something went wrong" }); 14 | } 15 | }); 16 | 17 | router.post("/create", async (req, res) => { 18 | const payload = req.body; 19 | try { 20 | const notice = new NoticeModel(payload); 21 | await notice.save(); 22 | res.send({ message: "Notice successfully created", notice }); 23 | } catch (error) { 24 | res.send(error); 25 | } 26 | }); 27 | 28 | 29 | 30 | router.delete("/:noticeId", async (req, res) => { 31 | const id = req.params.noticeId; 32 | try { 33 | const notice = await NoticeModel.findByIdAndDelete({ _id: id }); 34 | if (!notice) { 35 | res.status(404).send({ msg: `Notice with id ${id} not found` }); 36 | } 37 | res.status(200).send(`Notice with id ${id} deleted`); 38 | } catch (error) { 39 | console.log(error); 40 | res.status(400).send({ error: "Something went wrong, unable to Delete." }); 41 | } 42 | }); 43 | 44 | module.exports = router; 45 | -------------------------------------------------------------------------------- /sms-frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hms-backend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@fullcalendar/core": "^6.0.3", 7 | "@fullcalendar/daygrid": "^6.0.3", 8 | "@fullcalendar/list": "^6.0.3", 9 | "@fullcalendar/timegrid": "^6.0.3", 10 | "@testing-library/jest-dom": "^5.16.5", 11 | "@testing-library/react": "^13.4.0", 12 | "@testing-library/user-event": "^13.5.0", 13 | "antd": "^5.0.3", 14 | "axios": "^1.2.0", 15 | "react": "^18.2.0", 16 | "react-dom": "^18.2.0", 17 | "react-icons": "^4.7.1", 18 | "react-redux": "^8.0.5", 19 | "react-router-dom": "^6.4.4", 20 | "react-scripts": "5.0.1", 21 | "react-toastify": "^9.1.1", 22 | "redux": "^4.2.0", 23 | "redux-thunk": "^2.4.2", 24 | "sass": "^1.57.1", 25 | "web-vitals": "^2.1.4" 26 | }, 27 | "scripts": { 28 | "start": "react-scripts start", 29 | "build": "react-scripts build", 30 | "test": "react-scripts test", 31 | "eject": "react-scripts eject" 32 | }, 33 | "eslintConfig": { 34 | "extends": [ 35 | "react-app", 36 | "react-app/jest" 37 | ] 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.2%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 1 chrome version", 47 | "last 1 firefox version", 48 | "last 1 safari version" 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/Datas/reducer.js: -------------------------------------------------------------------------------- 1 | import * as types from "./types"; 2 | 3 | const initialState = { 4 | loading: false, 5 | error: false, 6 | reports: [], 7 | doubts: [], 8 | notices: [], 9 | dashboard: [], 10 | }; 11 | 12 | export default function dataReducer(state = initialState, { type, payload }) { 13 | switch (type) { 14 | case types.GET_DOUBT_REQUEST: 15 | return { 16 | ...state, 17 | loading: true, 18 | }; 19 | case types.GET_DOUBT_SUCCESS: 20 | return { 21 | ...state, 22 | loading: false, 23 | doubts: payload, 24 | }; 25 | case types.GET_NOTICE_SUCCESS: 26 | return { 27 | ...state, 28 | loading: false, 29 | notices: payload, 30 | }; 31 | case types.GET_ALLDATA_SUCCESS: 32 | return { 33 | ...state, 34 | loading: false, 35 | dashboard: payload, 36 | }; 37 | case types.DELETE_DOUBT_SUCCESS: 38 | return { 39 | ...state, 40 | doubts: [...state.doubts.filter((ele) => ele._id !== payload)], 41 | }; 42 | case types.DELETE_REPORT_SUCCESS: 43 | return { 44 | ...state, 45 | reports: [...state.reports.filter((ele) => ele._id !== payload)], 46 | }; 47 | case types.GET_REPORT_DETAILS_SUCCESS: 48 | return { 49 | ...state, 50 | loading: false, 51 | reports: payload, 52 | }; 53 | 54 | default: 55 | return state; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/components/ID/ID.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useContext } from 'react'; 2 | import { CopyToClipboard } from 'react-copy-to-clipboard'; 3 | import './ID.css'; 4 | import { SocketContext } from '../../Context'; 5 | 6 | const Sidebar = ({ children }) => { 7 | const { me, callAccepted, name, setName, callEnded, leaveCall, callUser } = useContext(SocketContext); 8 | const [idToCall, setIdToCall] = useState(''); 9 | 10 | return ( 11 |
12 |
13 |
14 |
15 |
16 |

Enter Name

17 | setName(e.target.value)} /> 18 | 19 |
Copy ID
20 |
21 |
22 |
23 |

Meeting ID

24 | setIdToCall(e.target.value)} 27 | /> 28 | {callAccepted && !callEnded ? ( 29 |
Hang Up
30 | ) : ( 31 |
callUser(idToCall)}>Call
32 | )} 33 |
34 |
35 |
36 | {children} 37 |
38 |
39 | ); 40 | }; 41 | 42 | export default Sidebar; 43 | -------------------------------------------------------------------------------- /sms-backend/index.js: -------------------------------------------------------------------------------- 1 | const express = require("express") 2 | const {connection} = require("./Config/db") 3 | require("dotenv").config(); 4 | const cors = require("cors"); 5 | 6 | 7 | const adminRouter = require('./routes/admin.route') 8 | const teacherRouter = require('./routes/teacher.route') 9 | const studentRouter = require('./routes/student.route'); 10 | const reportRouter = require('./routes/reports.route'); 11 | const doubtRouter = require('./routes/doubt.route'); 12 | const noticeRouter = require('./routes/notice.route') 13 | const schoolRouter = require("./routes/school.route"); 14 | const quizRouter = require('./routes/quiz.route') 15 | 16 | 17 | const app = express() 18 | 19 | app.use(express.json()) 20 | app.use(cors()); 21 | 22 | app.get("/",(req,res)=>{ 23 | res.send("Homepage") 24 | }) 25 | 26 | app.use("/admin", adminRouter); 27 | app.use('/teachers', teacherRouter); 28 | app.use('/students', studentRouter); 29 | app.use("/reports", reportRouter); 30 | app.use("/doubts", doubtRouter); 31 | app.use('/notices', noticeRouter) 32 | app.use('/schools', schoolRouter) 33 | app.use('/quiz', quizRouter) 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | app.listen(process.env.port, async ()=>{ 42 | try { 43 | await connection 44 | console.log("Connected to DB"); 45 | } catch (error) { 46 | console.log("Unable to connect to DB"); 47 | console.log(error); 48 | } 49 | console.log(`Listening at port ${process.env.port}`); 50 | } ) 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/static/js/runtime-main.03887cff.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(t){for(var n,l,i=t[0],f=t[1],a=t[2],p=0,s=[];p0.2%", 38 | "not dead", 39 | "not op_mini all" 40 | ], 41 | "development": [ 42 | "last 1 chrome version", 43 | "last 1 firefox version", 44 | "last 1 safari version" 45 | ] 46 | }, 47 | "devDependencies": { 48 | "eslint": "^7.22.0", 49 | "eslint-config-airbnb": "^18.2.1", 50 | "eslint-plugin-import": "^2.22.1", 51 | "eslint-plugin-jsx-a11y": "^6.4.1", 52 | "eslint-plugin-react": "^7.22.0", 53 | "eslint-plugin-react-hooks": "^4.2.0" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/static/js/2.c372d7dd.chunk.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | /*! 8 | * The buffer module from node.js, for the browser. 9 | * 10 | * @author Feross Aboukhadijeh 11 | * @license MIT 12 | */ 13 | 14 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ 15 | 16 | /*! queue-microtask. MIT License. Feross Aboukhadijeh */ 17 | 18 | /*! safe-buffer. MIT License. Feross Aboukhadijeh */ 19 | 20 | /** @license React v0.20.2 21 | * scheduler.production.min.js 22 | * 23 | * Copyright (c) Facebook, Inc. and its affiliates. 24 | * 25 | * This source code is licensed under the MIT license found in the 26 | * LICENSE file in the root directory of this source tree. 27 | */ 28 | 29 | /** @license React v17.0.2 30 | * react-dom.production.min.js 31 | * 32 | * Copyright (c) Facebook, Inc. and its affiliates. 33 | * 34 | * This source code is licensed under the MIT license found in the 35 | * LICENSE file in the root directory of this source tree. 36 | */ 37 | 38 | /** @license React v17.0.2 39 | * react-jsx-runtime.production.min.js 40 | * 41 | * Copyright (c) Facebook, Inc. and its affiliates. 42 | * 43 | * This source code is licensed under the MIT license found in the 44 | * LICENSE file in the root directory of this source tree. 45 | */ 46 | 47 | /** @license React v17.0.2 48 | * react.production.min.js 49 | * 50 | * Copyright (c) Facebook, Inc. and its affiliates. 51 | * 52 | * This source code is licensed under the MIT license found in the 53 | * LICENSE file in the root directory of this source tree. 54 | */ 55 | -------------------------------------------------------------------------------- /sms-backend/routes/reports.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { ReportModel } = require("../models/report.model"); 3 | 4 | const router = express.Router(); 5 | 6 | router.post("/", async (req, res) => { 7 | let query = req.body; 8 | try { 9 | const reports = await ReportModel.find(query); 10 | res.status(200).send(reports); 11 | } catch (error) { 12 | console.log(error); 13 | res.status(400).send({ error: "Something went wrong" }); 14 | } 15 | }); 16 | 17 | router.post("/create", async (req, res) => { 18 | const payload = req.body; 19 | try { 20 | const report = new ReportModel(payload); 21 | await report.save(); 22 | res.send({ message: "Report successfully created", report }); 23 | } catch (error) { 24 | res.send(error); 25 | } 26 | }); 27 | 28 | router.patch("/:reportId", async (req, res) => { 29 | const id = req.params.reportId; 30 | const payload = req.body; 31 | try { 32 | const report = await ReportModel.findByIdAndUpdate({ _id: id }, payload); 33 | if (!report) { 34 | res.status(404).send({ msg: `Report with id ${id} not found` }); 35 | } 36 | res.status(200).send(`Report with id ${id} updated`); 37 | } catch (error) { 38 | console.log(error); 39 | res.status(400).send({ error: "Something went wrong, unable to Update." }); 40 | } 41 | }); 42 | 43 | router.delete("/:reportId", async (req, res) => { 44 | const id = req.params.reportId; 45 | try { 46 | const report = await ReportModel.findByIdAndDelete({ _id: id }); 47 | if (!report) { 48 | res.status(404).send({ msg: `Report with id ${id} not found` }); 49 | } 50 | res.status(200).send(`Report with id ${id} deleted`); 51 | } catch (error) { 52 | console.log(error); 53 | res.status(400).send({ error: "Something went wrong, unable to Delete." }); 54 | } 55 | }); 56 | 57 | module.exports = router; 58 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/static/css/main.b18b9ae0.chunk.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap);.video{width:100vw;display:flex;margin-top:25px;height:100vh}.video>div{width:600px;justify-content:center;align-items:center;margin:0 auto}video{width:100%}@media screen and (max-width:1100px){.video>div{width:400px}}@media screen and (max-width:900px){.video{display:flex;flex-direction:column;grid-gap:1rem;gap:1rem}}@media screen and (max-width:50px){.video>div{width:300px}}.form{width:100%;padding:1rem;flex-direction:column;justify-content:center;background-color:rgba(158,210,255,.54);grid-gap:1rem;gap:1rem;position:relative}.form,.form>div{display:flex;align-items:center}.form>div{grid-gap:20px;gap:20px}.form>div input{padding:5px;outline:none;border:none;border-radius:5px}.button{color:#fff;background-color:#5a77e8;border-radius:5px;padding:5px 10px;cursor:pointer;text-decoration:none;font-weight:400;margin:5px 0}.call{position:absolute;top:0;right:0;margin:1rem 2rem;padding:1rem;background-color:#f0f8ff;border-radius:10px}.call>div:nth-child(2){margin-top:10px;background-color:#22bd22;color:#fff;font-weight:700;text-align:center}.decline{background-color:#d73535;color:#fff;text-align:center}.header{width:100%;display:flex;align-items:center;justify-content:center;padding:1rem;grid-gap:20px;gap:20px;background-color:rgba(240,248,255,.393)}.header a{color:#fff;background-color:#5a77e8;border-radius:10px;padding:5px 10px;cursor:pointer;text-decoration:none;font-weight:500}body{background:url(https://images.unsplash.com/photo-1618556450994-a6a128ef0d9d?auto=format&fit=crop&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-4.0.3&q=80&w=764);background-repeat:no-repeat;background-size:cover;position:relative}body::-webkit-scrollbar{display:none}*{margin:0;padding:0;font-family:"Rubik",sans-serif} 2 | /*# sourceMappingURL=main.b18b9ae0.chunk.css.map */ -------------------------------------------------------------------------------- /sms-chat-frontend/build/index.html: -------------------------------------------------------------------------------- 1 | Video Chat
-------------------------------------------------------------------------------- /sms-chat-frontend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es6: true, 5 | }, 6 | extends: [ 7 | 'plugin:react/recommended', 8 | 'airbnb', 9 | ], 10 | globals: { 11 | Atomics: 'readonly', 12 | SharedArrayBuffer: 'readonly', 13 | }, 14 | parserOptions: { 15 | ecmaFeatures: { 16 | jsx: true, 17 | }, 18 | ecmaVersion: 2018, 19 | sourceType: 'module', 20 | }, 21 | parser: 'babel-eslint', 22 | plugins: [ 23 | 'react', 24 | ], 25 | rules: { 26 | 'import/extensions': 0, 27 | 'react/prop-types': 0, 28 | 'linebreak-style': 0, 29 | 'react/state-in-constructor': 0, 30 | 'import/prefer-default-export': 0, 31 | 'max-len': [ 32 | 2, 33 | 250, 34 | ], 35 | 'no-multiple-empty-lines': [ 36 | 'error', 37 | { 38 | max: 1, 39 | maxEOF: 1, 40 | }, 41 | ], 42 | 'no-underscore-dangle': [ 43 | 'error', 44 | { 45 | allow: [ 46 | '_d', 47 | '_dh', 48 | '_h', 49 | '_id', 50 | '_m', 51 | '_n', 52 | '_t', 53 | '_text', 54 | ], 55 | }, 56 | ], 57 | 'object-curly-newline': 0, 58 | 'react/jsx-filename-extension': 0, 59 | 'react/jsx-one-expression-per-line': 0, 60 | 'jsx-a11y/click-events-have-key-events': 0, 61 | 'jsx-a11y/alt-text': 0, 62 | 'jsx-a11y/no-autofocus': 0, 63 | 'jsx-a11y/no-static-element-interactions': 0, 64 | 'react/no-array-index-key': 0, 65 | 'jsx-a11y/media-has-caption': 0, 66 | 'no-param-reassign': 0, 67 | 'jsx-a11y/anchor-is-valid': [ 68 | 'error', 69 | { 70 | components: [ 71 | 'Link', 72 | ], 73 | specialLink: [ 74 | 'to', 75 | 'hrefLeft', 76 | 'hrefRight', 77 | ], 78 | aspects: [ 79 | 'noHref', 80 | 'invalidHref', 81 | 'preferButton', 82 | ], 83 | }, 84 | ], 85 | }, 86 | }; 87 | -------------------------------------------------------------------------------- /sms-frontend/src/Routes/AllRoutes.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Route, Routes } from "react-router-dom"; 3 | import DLogin from "../Pages/Dashboard/Dashboard-Login/DLogin"; 4 | import AddNotice from "../Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddNotice"; 5 | import AddAdmin from "../Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddAdmin"; 6 | import AddTeacher from "../Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddTeacher"; 7 | import AddStudent from "../Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddStudent"; 8 | import AllDoubts from "../Pages/Dashboard/Main-Dashboard/AllPages/Admin/AllDoubts"; 9 | import CheckReports from "../Pages/Dashboard/Main-Dashboard/AllPages/Teacher/CheckReports"; 10 | import CreateReport from "../Pages/Dashboard/Main-Dashboard/AllPages/Teacher/CreateReport"; 11 | import TeacherProfile from "../Pages/Dashboard/Main-Dashboard/AllPages/Teacher/TeacherProfile"; 12 | import AddDoubt from "../Pages/Dashboard/Main-Dashboard/AllPages/Student/AddDoubt"; 13 | import StudentProfile from "../Pages/Dashboard/Main-Dashboard/AllPages/Student/StudentProfile"; 14 | import FrontPage from "../Pages/Dashboard/Main-Dashboard/GlobalFiles/FrontPage"; 15 | const AllRoutes = () => { 16 | return ( 17 | <> 18 | 19 | } /> 20 | } /> 21 | } /> 22 | } /> 23 | } /> 24 | } /> 25 | } /> 26 | } /> 27 | } /> 28 | } /> 29 | } /> 30 | } /> 31 | } /> 32 | 33 | 34 | ); 35 | }; 36 | 37 | export default AllRoutes; 38 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Student/CSS/Profiles.scss: -------------------------------------------------------------------------------- 1 | .firstBox { 2 | background-color: white; 3 | border-radius: 2rem; 4 | } 5 | 6 | .maindoctorProfile { 7 | display: flex; 8 | justify-content: space-between; 9 | gap: 1rem; 10 | } 11 | 12 | .singleitemdiv { 13 | display: flex; 14 | justify-content: left; 15 | gap: 20px; 16 | padding: 10px; 17 | font-size: 1.3rem; 18 | /* border: 1px solid red; */ 19 | align-items: center; 20 | margin: 0rem 1rem; 21 | } 22 | 23 | .singleitemdiv:nth-child(even) .singledivicons { 24 | color: #ff6f6f; 25 | } 26 | 27 | .singleitemdiv:nth-child(odd) .singledivicons { 28 | color: rgb(123 219 130); 29 | } 30 | 31 | .firstBox div { 32 | display: flex; 33 | padding: 1rem; 34 | } 35 | .firstBox div img { 36 | width: 50%; 37 | margin: auto; 38 | border-radius: 10rem; 39 | background-color: #efefef; 40 | } 41 | 42 | .subfirstbox { 43 | background-color: white; 44 | border-radius: 2rem; 45 | height: 45%; 46 | } 47 | .subSecondBox { 48 | background-color: white; 49 | border-radius: 2rem; 50 | height: 45%; 51 | } 52 | 53 | .singleitemdiv button { 54 | width: 50%; 55 | margin: auto; 56 | font-size: 1.5rem; 57 | padding: 10px; 58 | border-radius: 10px; 59 | border: none; 60 | cursor: pointer; 61 | display: flex; 62 | gap: 1rem; 63 | box-shadow: 0px 0px 3px -1px #4f33ea; 64 | background-color: #84adea; 65 | text-align: center; 66 | } 67 | 68 | .SecondBox { 69 | display: flex; 70 | flex-direction: column; 71 | justify-content: space-between; 72 | } 73 | 74 | @media only screen and (max-width: 1024px) { 75 | .maindoctorProfile { 76 | display: block; 77 | } 78 | .firstBox { 79 | width: 100%; 80 | margin-bottom: 4rem; 81 | } 82 | 83 | .SecondBox { 84 | gap: 3rem; 85 | } 86 | .firstBox div img { 87 | width: 40%; 88 | margin: auto; 89 | border-radius: 10rem; 90 | background-color: #efefef; 91 | } 92 | .singleitemdiv button { 93 | width: 50%; 94 | } 95 | } 96 | 97 | @media only screen and (max-width: 500px) { 98 | .singleitemdiv button { 99 | width: 70%; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Teacher/CSS/TeacherProfile.scss: -------------------------------------------------------------------------------- 1 | .firstBox { 2 | background-color: white; 3 | border-radius: 2rem; 4 | width: 40%; 5 | } 6 | 7 | .maindoctorProfile { 8 | display: flex; 9 | justify-content: space-between; 10 | gap: 1rem; 11 | } 12 | 13 | .singleitemdiv { 14 | display: flex; 15 | justify-content: left; 16 | gap: 20px; 17 | padding: 10px; 18 | font-size: 1.3rem; 19 | /* border: 1px solid red; */ 20 | align-items: center; 21 | margin: 0rem 1rem; 22 | } 23 | 24 | .singleitemdiv:nth-child(even) .singledivicons { 25 | color: #ff6f6f; 26 | } 27 | 28 | .singleitemdiv:nth-child(odd) .singledivicons { 29 | color: rgb(123 219 130); 30 | } 31 | 32 | .firstBox div { 33 | display: flex; 34 | padding: 1rem; 35 | } 36 | .firstBox div img { 37 | width: 50%; 38 | margin: auto; 39 | border-radius: 10rem; 40 | background-color: #efefef; 41 | } 42 | 43 | .subfirstbox { 44 | background-color: white; 45 | border-radius: 2rem; 46 | height: 45%; 47 | } 48 | .subSecondBox { 49 | background-color: white; 50 | border-radius: 2rem; 51 | height: 45%; 52 | } 53 | 54 | .singleitemdiv button { 55 | width: 50%; 56 | margin: auto; 57 | font-size: 1.5rem; 58 | padding: 10px; 59 | border-radius: 10px; 60 | border: none; 61 | cursor: pointer; 62 | display: flex; 63 | gap: 1rem; 64 | box-shadow: 0px 0px 3px -1px #4f33ea; 65 | background-color: #84adea; 66 | text-align: center; 67 | } 68 | 69 | .SecondBox { 70 | display: flex; 71 | flex-direction: column; 72 | justify-content: space-between; 73 | } 74 | 75 | @media only screen and (max-width: 1024px) { 76 | .maindoctorProfile { 77 | display: block; 78 | } 79 | .firstBox { 80 | width: 100%; 81 | margin-bottom: 4rem; 82 | } 83 | 84 | .SecondBox { 85 | gap: 3rem; 86 | } 87 | .firstBox div img { 88 | width: 40%; 89 | margin: auto; 90 | border-radius: 10rem; 91 | background-color: #efefef; 92 | } 93 | .singleitemdiv button { 94 | width: 50%; 95 | } 96 | } 97 | 98 | @media only screen and (max-width: 500px) { 99 | .singleitemdiv button { 100 | width: 70%; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/CSS/AddBed.scss: -------------------------------------------------------------------------------- 1 | .mainAmbupance { 2 | padding: 2rem; 3 | border-radius: 10px; 4 | box-shadow: 0px 1px 11px 2px #0000001f; 5 | } 6 | 7 | .mainAmbupance h1 { 8 | font-size: 2.5rem; 9 | } 10 | 11 | .imagesection { 12 | width: 100%; 13 | display: flex; 14 | justify-content: space-evenly; 15 | align-items: center; 16 | margin: 3rem 0rem; 17 | } 18 | 19 | .imagesection img { 20 | width: 20%; 21 | cursor: pointer; 22 | border: 1px solid; 23 | height: 10rem; 24 | padding: 13px; 25 | border-radius: 10px; 26 | background-color: #c3c7ff75; 27 | border: none; 28 | box-shadow: 0px 0px 7px -3px black; 29 | transition: 0.3s; 30 | } 31 | 32 | .imagesection img:hover { 33 | width: 22%; 34 | } 35 | 36 | .mainAmbupance h1 { 37 | text-align: center; 38 | margin: 2rem 0rem; 39 | } 40 | 41 | /* ***************************************************************** */ 42 | 43 | table { 44 | font-family: arial, sans-serif; 45 | border-collapse: collapse; 46 | width: 100%; 47 | } 48 | 49 | td, 50 | th { 51 | border: 1px solid #dddddd; 52 | text-align: left; 53 | padding: 8px; 54 | } 55 | 56 | tr:nth-child(even) { 57 | background-color: #dddddd92; 58 | } 59 | 60 | /* ***************************************************************** */ 61 | 62 | @media only screen and (max-width: 1024px) { 63 | .imagesection img { 64 | width: 30%; 65 | } 66 | } 67 | 68 | @media only screen and (max-width: 850px) { 69 | .imagesection { 70 | width: 100%; 71 | display: inline-block; 72 | gap: 10px; 73 | } 74 | 75 | .imagesection img { 76 | width: 30%; 77 | height: 6rem; 78 | margin: 5px; 79 | } 80 | } 81 | 82 | @media only screen and (max-width: 650px) { 83 | .mainAmbupance > h1 { 84 | font-size: 1.7rem; 85 | } 86 | } 87 | 88 | @media only screen and (max-width: 600px) { 89 | .mainAmbupance > h1 { 90 | font-size: 1.7rem; 91 | } 92 | .imagesection { 93 | width: 100%; 94 | display: block; 95 | gap: 10px; 96 | } 97 | 98 | .imagesection img { 99 | display: block; 100 | width: 60%; 101 | height: 6rem; 102 | margin-bottom: 1rem; 103 | margin: auto; 104 | margin-bottom: 1rem; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Dashboard-Login/DLogin.scss: -------------------------------------------------------------------------------- 1 | .mainLoginPage { 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | gap: 10rem; 6 | height: 100vh; 7 | background-color: rgba(236, 236, 236, 0.874); 8 | } 9 | 10 | .leftside { 11 | width: 50%; 12 | text-align: center; 13 | } 14 | .leftside h1 { 15 | margin: 1rem 0; 16 | } 17 | 18 | .leftside img { 19 | width: 100%; 20 | } 21 | 22 | /* ********************************************************************** */ 23 | 24 | .rightside { 25 | padding: 2rem; 26 | align-items: center; 27 | text-align: center; 28 | width: 35%; 29 | border-radius: 10px; 30 | background-color: white; 31 | } 32 | 33 | .Profileimg { 34 | margin: auto; 35 | width: 26%; 36 | margin-top: 2rem; 37 | } 38 | 39 | .Profileimg img { 40 | width: 5rem; 41 | border-radius: 5rem; 42 | /* border: 1px solid red; */ 43 | } 44 | 45 | .radiobutton { 46 | width: 33%; 47 | font-size: 1.2rem; 48 | font-weight: bold; 49 | } 50 | 51 | .rightside > h1 { 52 | margin: 2rem; 53 | } 54 | 55 | .rightside input { 56 | display: block; 57 | width: 100%; 58 | background-color: rgba(209, 236, 255, 0.874); 59 | height: 3rem; 60 | font-size: 1.2rem; 61 | margin: 10px 0px; 62 | border-radius: 5px; 63 | border: none; 64 | padding: 10px; 65 | } 66 | 67 | .rightside button { 68 | width: 100%; 69 | height: 2.5rem; 70 | border-radius: 2rem; 71 | cursor: pointer; 72 | font-size: 1.3rem; 73 | font-weight: bolder; 74 | background-color: rgba(187, 226, 255, 0.874); 75 | border: none; 76 | margin-top: 1.5rem; 77 | } 78 | 79 | form h3 { 80 | text-align: left; 81 | } 82 | 83 | @media only screen and (max-width: 1024px) { 84 | .mainLoginPage { 85 | gap: 5rem; 86 | } 87 | 88 | .leftside { 89 | width: 45%; 90 | } 91 | .rightside { 92 | width: 40%; 93 | } 94 | } 95 | 96 | @media only screen and (max-width: 770px) { 97 | .mainLoginPage { 98 | gap: 0rem; 99 | } 100 | 101 | .leftside { 102 | display: none; 103 | } 104 | .rightside { 105 | width: 60%; 106 | } 107 | } 108 | 109 | @media only screen and (max-width: 550px) { 110 | .rightside { 111 | width: 80%; 112 | } 113 | } 114 | 115 | @media only screen and (max-width: 400px) { 116 | .rightside { 117 | width: 95%; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/CSS/AddTeacher.scss: -------------------------------------------------------------------------------- 1 | .Main_Add_Doctor_div { 2 | margin: auto; 3 | margin-top: 2rem; 4 | padding: 3rem; 5 | border-radius: 10px; 6 | width: 95%; 7 | box-shadow: 0px 1px 11px 2px #0000001f; 8 | background-color: white; 9 | } 10 | 11 | .Main_Add_Doctor_div h1 { 12 | text-align: center; 13 | font-size: 2.5rem; 14 | margin: 0rem 0rem 1rem 0rem; 15 | } 16 | 17 | .Main_Add_Doctor_div img { 18 | width: 10%; 19 | display: block; 20 | margin: auto; 21 | margin-bottom: 2rem; 22 | border-radius: 6rem; 23 | } 24 | 25 | form div { 26 | display: flex; 27 | justify-content: space-between; 28 | gap: 2rem; 29 | padding-top: 5px; 30 | align-items: center; 31 | } 32 | 33 | form input, 34 | select, 35 | textarea { 36 | width: 100%; 37 | background-color: rgba(178, 219, 250, 0.874); 38 | height: 3rem; 39 | font-size: 1.2rem; 40 | margin: 10px 0px; 41 | border-radius: 5px; 42 | border: none; 43 | padding: 10px; 44 | } 45 | 46 | input::-webkit-outer-spin-button, 47 | input::-webkit-inner-spin-button { 48 | -webkit-appearance: none !important; 49 | margin: 0 !important; 50 | } 51 | 52 | .inputdiv { 53 | display: flex; 54 | justify-content: left; 55 | width: 60%; 56 | } 57 | 58 | .formsubmitbutton { 59 | text-align: center; 60 | width: 15%; 61 | height: 2.8rem; 62 | font-size: 1.3rem; 63 | border-radius: 5px; 64 | border: none; 65 | background: #ffb195; 66 | display: block; 67 | margin: auto; 68 | margin-top: 2rem; 69 | font-weight: bold; 70 | cursor: pointer; 71 | transition: 0.4s; 72 | } 73 | 74 | .formsubmitbutton:hover { 75 | background: #f98e67; 76 | } 77 | 78 | .inputdiv span div { 79 | display: block; 80 | } 81 | 82 | .mainAmbupance { 83 | background-color: white; 84 | } 85 | 86 | @media only screen and (max-width: 1024px) { 87 | .Main_Add_Doctor_div img { 88 | width: 30%; 89 | } 90 | .formsubmitbutton { 91 | width: 20%; 92 | } 93 | } 94 | 95 | @media only screen and (max-width: 850px) { 96 | .Main_Add_Doctor_div img { 97 | width: 30%; 98 | } 99 | form div { 100 | display: block; 101 | } 102 | .inputdiv { 103 | width: 100%; 104 | } 105 | .Main_Add_Doctor_div { 106 | padding: 1rem; 107 | } 108 | .adressdiv { 109 | display: block; 110 | } 111 | .formsubmitbutton { 112 | width: 40%; 113 | } 114 | } 115 | 116 | @media only screen and (max-width: 600px) { 117 | .Main_Add_Doctor_div h1 { 118 | font-size: 1.7rem; 119 | } 120 | .Main_Add_Doctor_div { 121 | width: 100%; 122 | } 123 | .formsubmitbutton { 124 | width: 70%; 125 | } 126 | } 127 | 128 | @media only screen and (max-width: 450px) { 129 | .formsubmitbutton { 130 | width: 70%; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /sms-backend/routes/student.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { StudentModel } = require("../models/student.model"); 3 | require("dotenv").config(); 4 | const jwt = require("jsonwebtoken"); 5 | 6 | const router = express.Router(); 7 | 8 | router.get("/", async (req, res) => { 9 | try { 10 | const students = await StudentModel.find(); 11 | res.status(200).send(students); 12 | } catch (error) { 13 | console.log(error); 14 | res.status(400).send({ error: "Something went wrong" }); 15 | } 16 | }); 17 | 18 | 19 | router.post("/register", async (req, res) => { 20 | const { email } = req.body; 21 | try { 22 | const student = await StudentModel.findOne({ email }); 23 | if (student) { 24 | return res.send({ 25 | message: "Student already exists", 26 | }); 27 | } 28 | let value = new StudentModel(req.body); 29 | await value.save(); 30 | const data = await StudentModel.findOne({ email }); 31 | return res.send({ data, message: "Registered" }); 32 | } catch (error) { 33 | res.send( {message : error} ); 34 | } 35 | }); 36 | 37 | 38 | router.post("/login", async (req, res) => { 39 | const { studentID, password } = req.body; 40 | try { 41 | const student = await StudentModel.findOne({ studentID, password }); 42 | 43 | if (student) { 44 | const token = jwt.sign({ foo: "bar" }, process.env.key, { 45 | expiresIn: "24h", 46 | }); 47 | res.send({ message: "Successful", user: student, token: token }); 48 | } else { 49 | res.send({ message: "Wrong credentials" }); 50 | } 51 | } catch (error) { 52 | console.log({ message: "Error" }); 53 | console.log(error); 54 | } 55 | }); 56 | 57 | router.patch("/:studentId", async (req, res) => { 58 | const id = req.params.studentId; 59 | const payload = req.body; 60 | try { 61 | await StudentModel.findByIdAndUpdate({ _id: id }, payload); 62 | const student = await StudentModel.findById(id); 63 | if (!student) { 64 | return res.status(404).send({ message: `Student with id ${id} not found` }); 65 | } 66 | res.status(200).send({ message: `Student Updated`, user: student }); 67 | } catch (error) { 68 | console.log(error); 69 | res.status(400).send({ error: "Something went wrong, unable to Update." }); 70 | } 71 | }); 72 | 73 | router.delete("/:studentId", async (req, res) => { 74 | const id = req.params.studentId; 75 | try { 76 | const student = await StudentModel.findByIdAndDelete({ _id: id }); 77 | if (!student) { 78 | res.status(404).send({ msg: `Student with id ${id} not found` }); 79 | } 80 | res.status(200).send(`tudent with id ${id} deleted`); 81 | } catch (error) { 82 | console.log(error); 83 | res.status(400).send({ error: "Something went wrong, unable to Delete." }); 84 | } 85 | }); 86 | 87 | module.exports = router; 88 | -------------------------------------------------------------------------------- /sms-backend/routes/teacher.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { TeacherModel } = require("../models/teacher.model"); 3 | require("dotenv").config(); 4 | const jwt = require("jsonwebtoken"); 5 | 6 | const router = express.Router(); 7 | 8 | router.get("/", async (req, res) => { 9 | try { 10 | const teachers = await TeacherModel.find(); 11 | res.status(200).send(teachers); 12 | } catch (error) { 13 | console.log(error); 14 | res.status(400).send({ error: "Something went wrong" }); 15 | } 16 | }); 17 | 18 | router.post("/register", async (req, res) => { 19 | const { email } = req.body; 20 | try { 21 | const teacher = await TeacherModel.findOne({ email }); 22 | if (teacher) { 23 | return res.send({ 24 | message: "Teacher already exists", 25 | }); 26 | } 27 | let value = new TeacherModel(req.body); 28 | await value.save(); 29 | const data = await TeacherModel.findOne({ email }); 30 | return res.send({ data, message: "Registered" }); 31 | } catch (error) { 32 | res.send({ message: "error" }); 33 | } 34 | }); 35 | 36 | router.post("/login", async (req, res) => { 37 | const { docID, password } = req.body; 38 | try { 39 | const teacher = await TeacherModel.findOne({ docID, password }); 40 | 41 | if (teacher) { 42 | const token = jwt.sign({ foo: "bar" }, process.env.key, { 43 | expiresIn: "24h", 44 | }); 45 | res.send({ message: "Successful", user: teacher, token: token }); 46 | } else { 47 | res.send({ message: "Wrong credentials" }); 48 | } 49 | } catch (error) { 50 | console.log({ message: "Error" }); 51 | console.log(error); 52 | } 53 | }); 54 | 55 | router.patch("/:teacherId", async (req, res) => { 56 | const id = req.params.teacherId; 57 | const payload = req.body; 58 | try { 59 | await TeacherModel.findByIdAndUpdate({ _id: id }, payload); 60 | const teacher = await TeacherModel.findById(id); 61 | if (!teacher) { 62 | return res 63 | .status(404) 64 | .send({ message: `Teacher with id ${id} not found` }); 65 | } 66 | res.status(200).send({ message: `Teacher Updated`, user: teacher }); 67 | } catch (error) { 68 | console.log(error); 69 | res.status(400).send({ error: "Something went wrong, unable to Update." }); 70 | } 71 | }); 72 | 73 | router.delete("/:teacherId", async (req, res) => { 74 | const id = req.params.teacherId; 75 | try { 76 | const teacher = await TeacherModel.findByIdAndDelete({ _id: id }); 77 | if (!teacher) { 78 | res.status(404).send({ msg: `Teacher with id ${id} not found` }); 79 | } 80 | res.status(200).send(`Teacher with id ${id} deleted`); 81 | } catch (error) { 82 | console.log(error); 83 | res.status(400).send({ error: "Something went wrong, unable to Delete." }); 84 | } 85 | }); 86 | 87 | module.exports = router; 88 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/AllDoubts.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useEffect } from "react"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { Navigate } from "react-router-dom"; 5 | import { deleteDoubt, GetDoubts } from "../../../../../Redux/Datas/action"; 6 | import Sidebar from "../../GlobalFiles/Sidebar"; 7 | 8 | const Beds_Rooms = () => { 9 | const { data } = useSelector((store) => store.auth); 10 | 11 | const dispatch = useDispatch(); 12 | 13 | const beds = useSelector((state) => state.data.doubts); 14 | 15 | const DeleteDoubt = (_id) => { 16 | dispatch(deleteDoubt(_id)); 17 | }; 18 | const { 19 | data: { user }, 20 | } = useSelector((state) => state.auth); 21 | 22 | useEffect(() => { 23 | if (user?.userType === "nurse") { 24 | dispatch(GetDoubts({ studentID: user?._id })); 25 | } else { 26 | dispatch(GetDoubts()); 27 | } 28 | }, [dispatch, user]); 29 | 30 | if (data?.isAuthenticated === false) { 31 | return ; 32 | } 33 | 34 | return ( 35 | <> 36 |
37 | 38 |
39 |
40 |

Doubts

41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {beds?.map((ele) => { 55 | return ( 56 | 57 | 58 | 59 | 68 | 69 | 70 | 76 | 77 | ); 78 | })} 79 | 80 |
ClassSubjectTeacherDetailsDateDelete
{ele.class}{ele.subject} 66 | {ele.teacher} 67 | {ele.details}{ele.date} DeleteDoubt(ele._id)} 73 | > 74 | Delete 75 |
81 |
82 |
83 |
84 |
85 | 86 | ); 87 | }; 88 | 89 | export default Beds_Rooms; 90 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Teacher/CheckReports.jsx: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | import React from "react"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { Navigate } from "react-router-dom"; 5 | import { DeleteReports, GetAllReport } from "../../../../../Redux/Datas/action"; 6 | import Sidebar from "../../GlobalFiles/Sidebar"; 7 | 8 | const Check_Appointment = () => { 9 | const { data } = useSelector((store) => store.auth); 10 | 11 | const dispatch = useDispatch(); 12 | 13 | const AllAppointment = useSelector((state) => state.data.reports); 14 | 15 | console.log(AllAppointment); 16 | 17 | const DeleteReport = (id) => { 18 | dispatch(DeleteReports(id)); 19 | }; 20 | useEffect(() => { 21 | if (data?.user.userType === "student") { 22 | dispatch(GetAllReport()); 23 | } else { 24 | dispatch(GetAllReport({ email: data?.user.email })); 25 | } 26 | }, [dispatch, data]); 27 | 28 | if (data?.isAuthenticated === false) { 29 | return ; 30 | } 31 | 32 | if (data?.user.userType === "admin") { 33 | return ; 34 | } 35 | 36 | return ( 37 | <> 38 |
39 | 40 |
41 |
42 |

Reports

43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {AllAppointment?.map((ele) => { 56 | return ( 57 | 58 | 59 | 60 | 61 | 62 | 76 | 77 | ); 78 | })} 79 | 80 |
Student NameClassEmailDateDelete
{ele.name}{ele.class}{ele.email}{ele.date} 63 | 75 |
81 |
82 |
83 |
84 |
85 | 86 | ); 87 | }; 88 | 89 | export default Check_Appointment; 90 | -------------------------------------------------------------------------------- /sms-chat-frontend/src/Context.js: -------------------------------------------------------------------------------- 1 | import React, { createContext, useState, useRef, useEffect } from 'react'; 2 | import { io } from 'socket.io-client'; 3 | import Peer from 'simple-peer'; 4 | 5 | const SocketContext = createContext(); 6 | const socket = io('https://video-chat-backend-v055.onrender.com'); 7 | 8 | const ContextProvider = ({ children }) => { 9 | const [callAccepted, setCallAccepted] = useState(false); 10 | const [callEnded, setCallEnded] = useState(false); 11 | const [stream, setStream] = useState(); 12 | const [name, setName] = useState(''); 13 | const [call, setCall] = useState({}); 14 | const [me, setMe] = useState(''); 15 | 16 | const myVideo = useRef(); 17 | const userVideo = useRef(); 18 | const connectionRef = useRef(); 19 | 20 | useEffect(() => { 21 | navigator.mediaDevices 22 | .getUserMedia({ video: true, audio: true }) 23 | .then((currentStream) => { 24 | setStream(currentStream); 25 | 26 | myVideo.current.srcObject = currentStream; 27 | }); 28 | 29 | socket.on('me', (id) => setMe(id)); 30 | 31 | socket.on('callUser', ({ from, name: callerName, signal }) => { 32 | setCall({ isReceivingCall: true, from, name: callerName, signal }); 33 | }); 34 | }, []); 35 | 36 | const answerCall = () => { 37 | setCallAccepted(true); 38 | 39 | const peer = new Peer({ initiator: false, trickle: false, stream }); 40 | 41 | peer.on('signal', (data) => { 42 | socket.emit('answerCall', { signal: data, to: call.from }); 43 | }); 44 | 45 | peer.on('stream', (currentStream) => { 46 | userVideo.current.srcObject = currentStream; 47 | }); 48 | 49 | peer.signal(call.signal); 50 | 51 | connectionRef.current = peer; 52 | }; 53 | 54 | const callUser = (id) => { 55 | const peer = new Peer({ initiator: true, trickle: false, stream }); 56 | 57 | peer.on('signal', (data) => { 58 | socket.emit('callUser', { 59 | userToCall: id, 60 | signalData: data, 61 | from: me, 62 | name, 63 | }); 64 | }); 65 | 66 | peer.on('stream', (currentStream) => { 67 | userVideo.current.srcObject = currentStream; 68 | }); 69 | 70 | socket.on('callAccepted', (signal) => { 71 | setCallAccepted(true); 72 | 73 | peer.signal(signal); 74 | }); 75 | 76 | connectionRef.current = peer; 77 | }; 78 | 79 | const leaveCall = () => { 80 | setCallEnded(true); 81 | 82 | connectionRef.current.destroy(); 83 | 84 | window.location.reload(); 85 | }; 86 | 87 | return ( 88 | 104 | {children} 105 | 106 | ); 107 | }; 108 | 109 | export { ContextProvider, SocketContext }; 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## To Run Locally 3 | 4 | Clone the project 5 | 6 | ```bash 7 | git clone https://github.com/piyush-agrawal6/-School-Management-System.git 8 | ``` 9 | 10 | Go to the project directory 11 | 12 | ```bash 13 | cd sms-main 14 | ``` 15 | 16 | Install dependencies 17 | 18 | ```bash 19 | npm install 20 | ``` 21 | 22 | Start the server 23 | 24 | ```bash 25 | npm run start 26 | ``` 27 | 28 | 29 | # School Management System 30 | 31 | School management system is a software to control all the management related to a school online, like asking doubts to teacher , one to one video call session 32 | with teacher, adding school notices , making reports of students , attending quiz online , solving doubts , maintaining profiles and many more. 33 | 34 | ## Tech Stack 35 | 36 | **Client:** 37 | 38 | - **React** 39 | - **Redux Thunk** 40 | - **Axios** 41 | - **Ant-Designs** 42 | - **SASS** 43 | - **Socket Io** 44 | 45 | **Server:** 46 | 47 | - **Node Js** 48 | - **Mongo DB** 49 | - **Express Js** 50 | - **JWT** 51 | - **Socket Io** 52 | 53 | **Deployment:** 54 | 55 | - **Render** (socket io) 56 | - **Netlify** (main dashboard) 57 | - **Cyclic** (main backend) 58 | 59 | **Login Credentials** 60 | 61 | - ID - 100 62 | - Pass - piyush 63 | 64 | 65 | ## 🔗 Links 66 | 67 | Client - https://sms-home.netlify.app/ 68 | 69 | Video call - https://sunny-duckanoo-9006ed.netlify.app/ 70 | 71 | quiz - https://sms-quiz.netlify.app/ 72 | 73 | Server - https://ill-blue-wildebeest-kilt.cyclic.app 74 | 75 | ## Features 76 | 77 | - Proper Authentication 78 | - Proper Authentication 79 | - Admin Controls 80 | - CRUD Operations 81 | - Add reports 82 | - Quiz 83 | - Video call 84 | - Create and resolve Doubts 85 | 86 | 87 | ## Screenshots 88 | 89 | 90 | 1. Login 91 | 92 | ![29 01 2023_22 21 14_REC](https://user-images.githubusercontent.com/100460788/215342251-f56c40e1-0eb9-4dad-a7f2-27509b32d883.png) 93 | 94 | 2. Dashboard 95 | 96 | ![29 01 2023_22 23 45_REC](https://user-images.githubusercontent.com/100460788/215342255-01abdbe5-5e2a-42a4-809a-ba3f25d64aa4.png) 97 | 98 | 3. Forms 99 | 100 | ![29 01 2023_22 25 01_REC](https://user-images.githubusercontent.com/100460788/215342257-b082472c-f74d-4e2a-a3b3-af5fb67363ee.png) 101 | 102 | 4. Profile 103 | 104 | ![29 01 2023_22 25 23_REC](https://user-images.githubusercontent.com/100460788/215342259-532d4808-e3ce-4a0a-8aac-6e7772b747f5.png) 105 | 106 | 5. Quiz 107 | 108 | ![29 01 2023_22 25 44_REC](https://user-images.githubusercontent.com/100460788/215342261-afd9d66a-302b-47c1-abde-9f11cace72fe.png) 109 | 110 | 6. Video call 111 | 112 | ![29 01 2023_22 26 44_REC](https://user-images.githubusercontent.com/100460788/215342262-85fcd7fc-17ae-44d7-a044-da6d3c0959e6.png) 113 | 114 | 7. Ask doubts online 115 | 116 | ![29 01 2023_22 37 14_REC](https://user-images.githubusercontent.com/100460788/215343294-0f401bf1-8ca8-422e-b862-c4daa84699e7.png) 117 | 118 | ## Blog / Presentation 119 | 120 | Presentation - https://drive.google.com/file/d/1Yb2xvW3b5Gdk2MKG3CZtSUze4Qz-slDY/view?usp=share_link 121 | 122 | ## Team Members / Contributors 123 | 124 | - [@Piyush Agrawal](https://github.com/piyush-agrawal6) 125 | - [@Santosh](https://github.com/Santoshdandin) 126 | - [@Ankit Yadav](https://github.com/ankit-yadav09) 127 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddNotice.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import Sidebar from "../../GlobalFiles/Sidebar"; 4 | import { AddNotice } from "../../../../../Redux/Datas/action"; 5 | import { ToastContainer, toast } from "react-toastify"; 6 | import "react-toastify/dist/ReactToastify.css"; 7 | import { Navigate } from "react-router-dom"; 8 | const notify = (text) => toast(text); 9 | 10 | const AddBeds = () => { 11 | const { data } = useSelector((store) => store.auth); 12 | 13 | const InitData = { 14 | title: "", 15 | details: "", 16 | date: "", 17 | }; 18 | const [NoticeData, setNoticeData] = useState(InitData); 19 | 20 | const [loading, setloading] = useState(false); 21 | 22 | const dispatch = useDispatch(); 23 | 24 | const HandleNoticeChange = (e) => { 25 | setNoticeData({ 26 | ...NoticeData, 27 | [e.target.name]: e.target.value, 28 | }); 29 | }; 30 | 31 | const HandleNoticeSubmit = (e) => { 32 | e.preventDefault(); 33 | console.log(NoticeData); 34 | setloading(true); 35 | dispatch(AddNotice(NoticeData)); 36 | setloading(false); 37 | setNoticeData(InitData); 38 | notify("Notice Added"); 39 | }; 40 | 41 | if (data?.isAuthenticated === false) { 42 | return ; 43 | } 44 | 45 | if (data?.user.userType !== "admin") { 46 | return ; 47 | } 48 | 49 | return ( 50 | <> 51 | 52 |
53 | 54 |
55 |
56 |

Add Notice

57 | 58 |
59 |
60 | 61 |
62 | 69 |
70 |
71 |
72 | 73 |
74 | 81 |
82 |
83 |
84 | 85 |
86 | 93 |
94 |
95 | 96 | 99 |
100 |
101 |
102 |
103 | 104 | ); 105 | }; 106 | 107 | export default AddBeds; 108 | -------------------------------------------------------------------------------- /sms-chat-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 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `yarn 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 | ### `yarn 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 | ### `yarn 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 | ### `yarn 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 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/Datas/action.js: -------------------------------------------------------------------------------- 1 | import * as types from "./types"; 2 | import axios from "axios"; 3 | 4 | // Create Report 5 | export const CreateReport = (data) => async (dispatch) => { 6 | try { 7 | const res = await axios.post( 8 | "https://ill-blue-wildebeest-kilt.cyclic.app/reports/create", 9 | data 10 | ); 11 | console.log(res); 12 | return res.data; 13 | } catch (error) { 14 | console.log(error); 15 | } 16 | }; 17 | 18 | // ADD doubts 19 | export const AddDoubts = (data) => async () => { 20 | try { 21 | const res = await axios.post( 22 | "https://ill-blue-wildebeest-kilt.cyclic.app/doubts/create", 23 | data 24 | ); 25 | return res.data; 26 | } catch (error) { 27 | console.log(error); 28 | } 29 | }; 30 | 31 | //GET doubts 32 | export const GetDoubts = (data) => async (dispatch) => { 33 | try { 34 | dispatch({ type: types.GET_DOUBT_REQUEST }); 35 | const res = await axios.post( 36 | "https://ill-blue-wildebeest-kilt.cyclic.app/doubts", 37 | data 38 | ); 39 | dispatch({ 40 | type: types.GET_DOUBT_SUCCESS, 41 | payload: res.data, 42 | }); 43 | } catch (error) { 44 | console.log(error); 45 | } 46 | }; 47 | 48 | //add notice 49 | export const AddNotice = (data) => async (dispatch) => { 50 | try { 51 | const res = await axios.post( 52 | "https://ill-blue-wildebeest-kilt.cyclic.app/notices/create", 53 | data 54 | ); 55 | return res.data; 56 | } catch (error) { 57 | console.log(error); 58 | } 59 | }; 60 | 61 | // delete doubt 62 | export const deleteDoubt = (id) => async (dispatch) => { 63 | try { 64 | dispatch({ type: types.DELETE_DOUBT_REQUEST }); 65 | await axios.delete( 66 | `https://ill-blue-wildebeest-kilt.cyclic.app/doubts/${id}` 67 | ); 68 | dispatch({ 69 | type: types.DELETE_DOUBT_SUCCESS, 70 | payload: id, 71 | }); 72 | } catch (error) { 73 | console.log(error); 74 | } 75 | }; 76 | 77 | // GET notice 78 | export const GetNotices = () => async (dispatch) => { 79 | try { 80 | dispatch({ type: types.GET_NOTICE_REQUEST }); 81 | const res = await axios.get( 82 | `https://ill-blue-wildebeest-kilt.cyclic.app/notices` 83 | ); 84 | console.log(res.data); 85 | dispatch({ 86 | type: types.GET_NOTICE_SUCCESS, 87 | payload: res.data, 88 | }); 89 | } catch (error) { 90 | console.log(error); 91 | } 92 | }; 93 | 94 | // GET ALL DATA 95 | export const GetAllData = () => async (dispatch) => { 96 | try { 97 | dispatch({ type: types.GET_ALLDATA_REQUEST }); 98 | const res = await axios.get( 99 | `https://ill-blue-wildebeest-kilt.cyclic.app/schools` 100 | ); 101 | dispatch({ 102 | type: types.GET_ALLDATA_SUCCESS, 103 | payload: res.data, 104 | }); 105 | } catch (error) { 106 | console.log(error); 107 | } 108 | }; 109 | 110 | // GET ALL report DETAILS 111 | export const GetAllReport = (data) => async (dispatch) => { 112 | try { 113 | const res = await axios.post( 114 | `https://ill-blue-wildebeest-kilt.cyclic.app/reports`, 115 | data 116 | ); 117 | dispatch({ 118 | type: types.GET_REPORT_DETAILS_SUCCESS, 119 | payload: res.data, 120 | }); 121 | } catch (error) { 122 | console.log(error); 123 | } 124 | }; 125 | 126 | // DELETE Reports 127 | export const DeleteReports = (id) => async (dispatch) => { 128 | try { 129 | const res = await axios.delete( 130 | `https://ill-blue-wildebeest-kilt.cyclic.app/reports/${id}` 131 | ); 132 | console.log(res.data); 133 | dispatch({ 134 | type: types.DELETE_REPORT_SUCCESS, 135 | payload: id, 136 | }); 137 | } catch (error) { 138 | console.log(error); 139 | } 140 | }; 141 | 142 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/auth/reducer.js: -------------------------------------------------------------------------------- 1 | import * as types from "./types"; 2 | const TOKEN = localStorage.getItem("token"); 3 | const initialState = { 4 | userLogin: { loading: false, error: false, message: "" }, 5 | userLogout: { message: "" }, 6 | data: { 7 | isAuthenticated: !!TOKEN, 8 | token: TOKEN, 9 | user: null, 10 | }, 11 | }; 12 | export default function authReducer(state = initialState, { type, payload }) { 13 | switch (type) { 14 | case types.LOGIN_STUDENT_REQUEST: 15 | return { 16 | ...state, 17 | userLogin: { loading: true, error: false }, 18 | }; 19 | case types.LOGIN_TEACHER_REQUEST: 20 | return { 21 | ...state, 22 | userLogin: { loading: true, error: false }, 23 | }; 24 | case types.LOGIN_ADMIN_REQUEST: 25 | return { 26 | ...state, 27 | userLogin: { loading: true, error: false }, 28 | }; 29 | 30 | case types.LOGIN_STUDENT_SUCCESS: 31 | localStorage.setItem("token", payload.token); 32 | return { 33 | ...state, 34 | userLogin: { loading: false, error: false, message: payload.message }, 35 | data: { 36 | isAuthenticated: payload.token ? true : false, 37 | token: payload.token, 38 | user: payload.user, 39 | }, 40 | }; 41 | 42 | case types.LOGIN_ADMIN_SUCCESS: 43 | localStorage.setItem("token", payload.token); 44 | return { 45 | ...state, 46 | userLogin: { loading: false, error: false, message: payload.message }, 47 | data: { 48 | isAuthenticated: payload.token ? true : false, 49 | token: payload.token, 50 | user: payload.user, 51 | }, 52 | }; 53 | case types.LOGIN_TEACHER_SUCCESS: 54 | localStorage.setItem("token", payload.token); 55 | return { 56 | ...state, 57 | userLogin: { loading: false, error: false, message: payload.message }, 58 | data: { 59 | isAuthenticated: payload.token ? true : false, 60 | token: payload.token, 61 | user: payload.user, 62 | }, 63 | }; 64 | 65 | case types.LOGIN_STUDENT_ERROR: 66 | return { 67 | ...state, 68 | userLogin: { loading: false, error: true, message: payload.message }, 69 | }; 70 | case types.LOGIN_ADMIN_ERROR: 71 | return { 72 | ...state, 73 | userLogin: { loading: false, error: true, message: payload.message }, 74 | }; 75 | case types.LOGIN_TEACHER_ERROR: 76 | return { 77 | ...state, 78 | userLogin: { loading: false, error: true, message: payload.message }, 79 | }; 80 | case types.EDIT_STUDENT_SUCCESS: 81 | return { 82 | ...state, 83 | data: { 84 | user: payload, 85 | }, 86 | }; 87 | case types.EDIT_TEACHER_SUCCESS: 88 | return { 89 | ...state, 90 | data: { 91 | user: payload, 92 | }, 93 | }; 94 | case types.LOGIN_ADMIN_ERROR: 95 | return { 96 | ...state, 97 | userLogin: { loading: false, error: true, message: payload.message }, 98 | }; 99 | 100 | case "AUTH_LOGIN_RESET": 101 | return { 102 | ...state, 103 | userLogin: { loading: false, error: false, message: "" }, 104 | }; 105 | case types.AUTH_LOGOUT: 106 | localStorage.removeItem("token"); 107 | return { 108 | ...state, 109 | userLogin: { loading: false, error: false, message: "" }, 110 | userLogout: { message: "Logout Successfully" }, 111 | data: { 112 | isAuthenticated: false, 113 | token: null, 114 | user: null, 115 | }, 116 | }; 117 | default: 118 | return state; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/GlobalFiles/FrontPage.jsx: -------------------------------------------------------------------------------- 1 | import { Table } from "antd"; 2 | import React from "react"; 3 | import { RiEmpathizeLine } from "react-icons/ri"; 4 | import { BiNotepad, BiBus } from "react-icons/bi"; 5 | import { FaChalkboardTeacher, FaUserAlt } from "react-icons/fa"; 6 | import { SiGoogleclassroom } from "react-icons/si"; 7 | import { MdPayment } from "react-icons/md"; 8 | import { RiAdminLine } from "react-icons/ri"; 9 | import Sidebar from "./Sidebar"; 10 | import { useEffect } from "react"; 11 | import { useDispatch, useSelector } from "react-redux"; 12 | import { 13 | GetAllData, 14 | GetNotices, 15 | } from "../../../../Redux/Datas/action"; 16 | 17 | const FrontPage = () => { 18 | const columns = [ 19 | { title: "Title", dataIndex: "title", key: "title" }, 20 | { title: "Details", dataIndex: "details", key: "details" }, 21 | { title: "Date", dataIndex: "date", key: "date" }, 22 | ]; 23 | 24 | const notices = useSelector((store) => store.data.notices); 25 | const { 26 | dashboard: { data }, 27 | } = useSelector((store) => store.data); 28 | 29 | console.log(data); 30 | 31 | const dispatch = useDispatch(); 32 | 33 | useEffect(() => { 34 | dispatch(GetNotices()); 35 | dispatch(GetAllData()); 36 | }, [dispatch]); 37 | 38 | return ( 39 |
40 | 41 |
42 |

Overview

43 |
44 |
45 |
46 |

{data?.teacher}

47 |

Teachers

48 |
49 | 50 |
51 |
52 | {" "} 53 |
54 |

{data?.student}

55 |

Students

56 |
57 | 58 |
59 |
60 |
61 |

50

62 |

Staffs

63 |
64 | 65 |
66 |
67 | {" "} 68 |
69 |

{data?.admin}

70 |

Admins

71 |
72 | 73 |
74 |
75 | {" "} 76 |
77 |

25

78 |

Class rooms

79 |
80 | 81 |
82 | 83 |
84 | {" "} 85 |
86 |

10

87 |

School bus

88 |
89 | 90 |
91 |
92 | {" "} 93 |
94 |

{data?.notice}

95 |

Notices

96 |
97 | 98 |
99 |
100 | {" "} 101 |
102 |

{data?.report}

103 |

Reports

104 |
105 | 106 |
107 |
108 | {/* ************************************* */} 109 |
110 |

School notices

111 |
112 | {notices ? : null} 113 | 114 | 115 | 116 | 117 | ); 118 | }; 119 | 120 | export default FrontPage; 121 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/static/js/main.069092f1.chunk.js: -------------------------------------------------------------------------------- 1 | (this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{103:function(e,t,c){},104:function(e,t,c){},105:function(e,t,c){},106:function(e,t,c){},107:function(e,t,c){"use strict";c.r(t);var n=c(1),a=c(49),i=c.n(a),l=c(7),s=c(50),r=c(24),j=c.n(r),o=c(0),d=Object(n.createContext)(),u=Object(s.io)("https://video-chat-backend-v055.onrender.com"),b=function(e){var t=e.children,c=Object(n.useState)(!1),a=Object(l.a)(c,2),i=a[0],s=a[1],r=Object(n.useState)(!1),b=Object(l.a)(r,2),O=b[0],m=b[1],h=Object(n.useState)(),f=Object(l.a)(h,2),v=f[0],x=f[1],p=Object(n.useState)(""),C=Object(l.a)(p,2),g=C[0],N=C[1],y=Object(n.useState)({}),w=Object(l.a)(y,2),k=w[0],S=w[1],A=Object(n.useState)(""),E=Object(l.a)(A,2),U=E[0],D=E[1],I=Object(n.useRef)(),R=Object(n.useRef)(),V=Object(n.useRef)();Object(n.useEffect)((function(){navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then((function(e){x(e),I.current.srcObject=e})),u.on("me",(function(e){return D(e)})),u.on("callUser",(function(e){var t=e.from,c=e.name,n=e.signal;S({isReceivingCall:!0,from:t,name:c,signal:n})}))}),[]);return Object(o.jsx)(d.Provider,{value:{call:k,callAccepted:i,myVideo:I,userVideo:R,stream:v,name:g,setName:N,callEnded:O,me:U,callUser:function(e){var t=new j.a({initiator:!0,trickle:!1,stream:v});t.on("signal",(function(t){u.emit("callUser",{userToCall:e,signalData:t,from:U,name:g})})),t.on("stream",(function(e){R.current.srcObject=e})),u.on("callAccepted",(function(e){s(!0),t.signal(e)})),V.current=t},leaveCall:function(){m(!0),V.current.destroy(),window.location.reload()},answerCall:function(){s(!0);var e=new j.a({initiator:!1,trickle:!1,stream:v});e.on("signal",(function(e){u.emit("answerCall",{signal:e,to:k.from})})),e.on("stream",(function(e){R.current.srcObject=e})),e.signal(k.signal),V.current=e}},children:t})},O=(c(99),function(){var e=Object(n.useContext)(d),t=e.callAccepted,c=e.myVideo,a=e.userVideo,i=e.callEnded,l=e.stream;return Object(o.jsxs)("div",{className:"video",children:[l&&Object(o.jsx)("div",{children:Object(o.jsx)("div",{item:!0,xs:12,md:6,children:Object(o.jsx)("video",{className:"player",playsInline:!0,muted:!0,ref:c,autoPlay:!0})})}),t&&!i&&Object(o.jsx)("div",{children:Object(o.jsx)("div",{children:Object(o.jsx)("video",{className:"player",playsInline:!0,ref:a,autoPlay:!0})})})]})}),m=c(51),h=(c(103),function(e){var t=e.children,c=Object(n.useContext)(d),a=c.me,i=c.callAccepted,s=c.name,r=c.setName,j=c.callEnded,u=c.leaveCall,b=c.callUser,O=Object(n.useState)(""),h=Object(l.a)(O,2),f=h[0],v=h[1];return Object(o.jsx)("div",{children:Object(o.jsxs)("div",{children:[Object(o.jsx)("form",{autoComplete:"off",children:Object(o.jsxs)("div",{className:"form",children:[Object(o.jsxs)("div",{children:[Object(o.jsx)("h3",{children:"Enter Name"}),Object(o.jsx)("input",{value:s,onChange:function(e){return r(e.target.value)}}),Object(o.jsx)(m.CopyToClipboard,{text:a,children:Object(o.jsx)("div",{className:"button",children:"Copy ID"})})]}),Object(o.jsxs)("div",{children:[Object(o.jsx)("h3",{children:"Meeting ID"}),Object(o.jsx)("input",{value:f,onChange:function(e){return v(e.target.value)}}),i&&!j?Object(o.jsx)("div",{className:"button decline",onClick:u,children:"Hang Up"}):Object(o.jsx)("div",{className:"button",onClick:function(){return b(f)},children:"Call"})]})]})}),t]})})}),f=(c(104),function(){var e=Object(n.useContext)(d),t=e.answerCall,c=e.call,a=e.callAccepted,i=e.leaveCall;return Object(o.jsx)(o.Fragment,{children:c.isReceivingCall&&!a&&Object(o.jsxs)("div",{className:"call",children:[Object(o.jsxs)("h3",{children:["Call from ",c.name?c.name:"unknown"]}),Object(o.jsx)("div",{className:"button",onClick:t,children:"Answer"}),Object(o.jsx)("div",{className:"button decline",onClick:i,children:"Decline"})]})})});c(105);function v(){return Object(o.jsxs)("div",{className:"header",children:[Object(o.jsx)("h1",{children:"Lets Meet"}),Object(o.jsx)("a",{href:"https://sms-home.netlify.app/dashboard",children:Object(o.jsx)("h1",{children:"Home"})})]})}function x(){return Object(o.jsxs)("div",{children:[Object(o.jsx)(v,{}),Object(o.jsx)(h,{children:Object(o.jsx)(f,{})}),Object(o.jsx)(O,{})]})}c(106);i.a.render(Object(o.jsx)(b,{children:Object(o.jsx)(x,{})}),document.getElementById("root"))},87:function(e,t){},89:function(e,t){},99:function(e,t,c){}},[[107,1,2]]]); 2 | //# sourceMappingURL=main.069092f1.chunk.js.map -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/GlobalFiles/CommonCSS.scss: -------------------------------------------------------------------------------- 1 | /* ********************************* TOP BAR STYLE PART ****************************************/ 2 | 3 | .MainDiv { 4 | display: flex; 5 | width: 100%; 6 | justify-content: space-evenly; 7 | padding: 10px 40px; 8 | align-items: center; 9 | gap: 1rem; 10 | background-color: white; 11 | margin-bottom: 2rem; 12 | border-radius: 10px; 13 | box-shadow: 0px 0px 7px -3px rgb(101, 101, 101); 14 | } 15 | 16 | .IconsDiv { 17 | display: flex; 18 | gap: 30px; 19 | justify-content: center; 20 | align-items: center; 21 | } 22 | 23 | .SearchDiv { 24 | width: 60%; 25 | } 26 | 27 | .Icons { 28 | font-size: 2rem; 29 | cursor: pointer; 30 | color: rgb(74, 70, 70); 31 | } 32 | 33 | .SearchDiv input { 34 | width: 100%; 35 | height: 2.5rem; 36 | border-radius: 5px; 37 | border: none; 38 | font-size: 1.2rem; 39 | padding-left: 10px; 40 | background-color: rgb(253 176 149); 41 | } 42 | 43 | .Hideshow { 44 | display: flex; 45 | justify-content: center; 46 | align-items: center; 47 | gap: 2rem; 48 | } 49 | 50 | .Hideshowicon { 51 | font-size: 2rem; 52 | color: white; 53 | cursor: pointer; 54 | } 55 | 56 | /* ********************** SIDEBAR STYLE PART ************************* */ 57 | .container { 58 | display: flex; 59 | gap: 2rem; 60 | background-color: rgba(131, 220, 255, 0.29); 61 | width: 100%; 62 | /* border: 2px solid green; */ 63 | width: 100%; 64 | } 65 | main { 66 | width: 100%; 67 | padding: 20px; 68 | } 69 | 70 | .mainIcon { 71 | color: white; 72 | font-size: 2rem; 73 | } 74 | 75 | .sidebar { 76 | background: rgba(255, 166, 134, 0.874); 77 | color: #fff; 78 | height: 100vh; 79 | transition: all 0.5s; 80 | position: sticky; 81 | top: 0; 82 | } 83 | .top_section { 84 | display: flex; 85 | align-items: center; 86 | padding: 20px 15px; 87 | justify-content: center; 88 | } 89 | 90 | .logo { 91 | font-size: 30px; 92 | } 93 | .bars { 94 | display: flex; 95 | font-size: 25px; 96 | margin-left: 50px; 97 | } 98 | .link { 99 | display: flex; 100 | color: #fff; 101 | padding: 10px 15px; 102 | gap: 15px; 103 | text-decoration: none; 104 | list-style: none; 105 | align-items: center; 106 | transition: all 0.5s; 107 | } 108 | .link:hover { 109 | background: rgba(253, 147, 108, 0.874); 110 | color: #000; 111 | transition: all 0.5s; 112 | } 113 | .active { 114 | background: rgba(253, 147, 108, 0.874); 115 | color: #000; 116 | } 117 | .icon, 118 | .link_text { 119 | font-size: 15px; 120 | } 121 | 122 | .LogOutPath .icon { 123 | font-size: 2rem; 124 | } 125 | 126 | .AfterSideBar { 127 | width: 90%; 128 | margin: 2rem; 129 | } 130 | 131 | /**************************************** FRONT PAGE STYLE *****************************************/ 132 | 133 | .maindiv { 134 | display: grid; 135 | grid-template-columns: repeat(4, 1fr); 136 | gap: 2rem; 137 | margin-top: 2rem; 138 | } 139 | 140 | .commondiv { 141 | border: 2px solid; 142 | height: 8rem; 143 | border-radius: 1rem; 144 | text-align: center; 145 | } 146 | 147 | .patientDetails { 148 | margin-top: 5rem; 149 | } 150 | .patientDetails h1 { 151 | margin-bottom: 1rem; 152 | color: rgb(184 191 234); 153 | } 154 | 155 | .patientBox { 156 | overflow-x: auto; 157 | overflow-y: hidden; 158 | white-space: nowrap; 159 | width: 100%; 160 | background-color: white; 161 | border-radius: 1rem; 162 | border: none; 163 | box-shadow: 0px 0px 36px -3px #00000026; 164 | } 165 | 166 | .commondiv { 167 | display: flex; 168 | justify-content: center; 169 | align-items: center; 170 | gap: 4rem; 171 | box-shadow: 0px 0px 36px -3px #00000026; 172 | border: none; 173 | background-color: white; 174 | } 175 | 176 | .overviewIcon { 177 | font-size: 4rem; 178 | color: rgb(184 191 234); 179 | } 180 | 181 | /* ******************************************************** */ 182 | 183 | @media only screen and (max-width: 1200px) { 184 | .maindiv { 185 | grid-template-columns: repeat(3, 1fr); 186 | } 187 | .commondiv { 188 | gap: 2.5rem; 189 | } 190 | } 191 | 192 | @media only screen and (max-width: 850px) { 193 | .maindiv { 194 | grid-template-columns: repeat(2, 1fr); 195 | } 196 | .commondiv { 197 | gap: 4rem; 198 | } 199 | .container { 200 | width: 100%; 201 | } 202 | } 203 | 204 | @media only screen and (max-width: 550px) { 205 | .maindiv { 206 | grid-template-columns: repeat(1, 1fr); 207 | } 208 | } 209 | 210 | @media only screen and (max-width: 600px) { 211 | .container { 212 | gap: 10px; 213 | } 214 | } 215 | 216 | @media only screen and (max-width: 450px) { 217 | .hidesidebar { 218 | display: none; 219 | } 220 | .showsidebar { 221 | display: block; 222 | } 223 | .Icons { 224 | font-size: 1.3rem; 225 | } 226 | .IconsDiv { 227 | gap: 15px; 228 | border: 1px solid; 229 | } 230 | .MainDiv { 231 | border: 1px solid; 232 | } 233 | } 234 | -------------------------------------------------------------------------------- /sms-backend/routes/admin.route.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const { AdminModel } = require("../models/admin.model") 3 | require("dotenv").config(); 4 | const jwt = require("jsonwebtoken"); 5 | const nodemailer = require("nodemailer"); 6 | const { StudentModel } = require("../models/student.model"); 7 | const { TeacherModel } = require("../models/teacher.model"); 8 | 9 | 10 | const router = express.Router(); 11 | 12 | router.get("/", async (req, res) => { 13 | try { 14 | const admins = await AdminModel.find(); 15 | res.status(200).send(admins); 16 | } catch (error) { 17 | console.log(error); 18 | res.status(400).send({ error: "Something went wrong" }); 19 | } 20 | }); 21 | 22 | router.post("/register", async (req, res) => { 23 | const { email } = req.body; 24 | try { 25 | const admin = await AdminModel.findOne({ email }); 26 | if (admin) { 27 | return res.send({ 28 | message: "Admin already exists", 29 | }); 30 | } 31 | let value = new AdminModel(req.body); 32 | await value.save(); 33 | const data = await AdminModel.findOne({ email }); 34 | return res.send({ data, message: "Registered" }); 35 | } catch (error) { 36 | res.send({ message: "error" }); 37 | } 38 | }); 39 | 40 | router.post("/login", async (req, res) => { 41 | const { adminID, password } = req.body; 42 | try { 43 | const admin = await AdminModel.findOne({ adminID, password }); 44 | 45 | if (admin) { 46 | const token = jwt.sign({ foo: "bar" }, process.env.key, { 47 | expiresIn: "24h", 48 | }); 49 | res.send({ message: "Successful", user: admin, token: token }); 50 | } else { 51 | res.send({ message: "Wrong credentials" }); 52 | } 53 | } catch (error) { 54 | console.log({ message: "Error" }); 55 | console.log(error); 56 | } 57 | }); 58 | 59 | router.patch("/:adminId", async (req, res) => { 60 | const id = req.params.adminId; 61 | const payload = req.body; 62 | try { 63 | const admin = await AdminModel.findByIdAndUpdate({ _id: id }, payload); 64 | if (!admin) { 65 | res.status(404).send({ msg: `Admin with id ${id} not found` }); 66 | } 67 | res.status(200).send(`Admin with id ${id} updated`); 68 | } catch (error) { 69 | console.log(error); 70 | res.status(400).send({ error: "Something went wrong, unable to Update." }); 71 | } 72 | }); 73 | 74 | router.delete("/:adminId", async (req, res) => { 75 | const id = req.params.adminId; 76 | try { 77 | const admin = await AdminModel.findByIdAndDelete({ _id: id }); 78 | if (!admin) { 79 | res.status(404).send({ msg: `Admin with id ${id} not found` }); 80 | } 81 | res.status(200).send(`Admin with id ${id} deleted`); 82 | } catch (error) { 83 | console.log(error); 84 | res.status(400).send({ error: "Something went wrong, unable to Delete." }); 85 | } 86 | }); 87 | 88 | router.post("/password", (req, res) => { 89 | const { email, userId, password } = req.body; 90 | 91 | const transporter = nodemailer.createTransport({ 92 | service: "gmail", 93 | auth: { 94 | user: "agrawaljoy1@gmail.com", 95 | pass: "zxkyjqfuhiizmxrg", 96 | }, 97 | }); 98 | 99 | const mailOptions = { 100 | from: "agrawaljoy1@gmail.com", 101 | to: email, 102 | subject: "Account ID and Password", 103 | text: `This is your User Id : ${userId} and Password : ${password} .`, 104 | }; 105 | 106 | transporter.sendMail(mailOptions, (error, info) => { 107 | if (error) { 108 | return res.send(error); 109 | } 110 | return res.send("Password reset email sent"); 111 | }); 112 | }); 113 | 114 | router.post("/forgot", async (req, res) => { 115 | const { email, type } = req.body; 116 | let user; 117 | let userId; 118 | let password; 119 | 120 | if (type == "student") { 121 | user = await StudentModel.find({ email }); 122 | userId = user[0]?.studentID; 123 | password = user[0]?.password; 124 | } 125 | 126 | 127 | if (type == "admin") { 128 | user = await AdminModel.find({ email }); 129 | userId = user[0]?.adminID; 130 | password = user[0]?.password; 131 | } 132 | 133 | if (type == "teacher") { 134 | user = await TeacherModel.find({ email }); 135 | userId = user[0]?.teacherID; 136 | password = user[0]?.password; 137 | } 138 | 139 | if (!user) { 140 | return res.send({ message: "User not found" }); 141 | } 142 | 143 | const transporter = nodemailer.createTransport({ 144 | service: "gmail", 145 | auth: { 146 | user: "agrawaljoy1@gmail.com", 147 | pass: "zxkyjqfuhiizmxrg", 148 | }, 149 | }); 150 | 151 | const mailOptions = { 152 | from: "agrawaljoy1@gmail.com", 153 | to: email, 154 | subject: "Account ID and Password", 155 | text: `This is your User Id : ${userId} and Password : ${password} .`, 156 | }; 157 | 158 | transporter.sendMail(mailOptions, (error, info) => { 159 | if (error) { 160 | return res.send(error); 161 | } 162 | return res.send("Password reset email sent"); 163 | }); 164 | }); 165 | 166 | module.exports = router; 167 | -------------------------------------------------------------------------------- /sms-frontend/src/Redux/auth/action.js: -------------------------------------------------------------------------------- 1 | import * as types from "./types"; 2 | import axios from "axios"; 3 | 4 | //login student 5 | export const StudentLogin = (data) => async (dispatch) => { 6 | try { 7 | dispatch({ type: types.LOGIN_STUDENT_REQUEST }); 8 | const res = await axios.post( 9 | "https://ill-blue-wildebeest-kilt.cyclic.app/students/login", 10 | data 11 | ); 12 | dispatch({ 13 | type: types.LOGIN_STUDENT_SUCCESS, 14 | payload: { 15 | message: res.data.message, 16 | user: res.data.user, 17 | token: res.data.token, 18 | }, 19 | }); 20 | return res.data; 21 | } catch (error) { 22 | dispatch({ 23 | type: types.LOGIN_STUDENT_ERROR, 24 | payload: { 25 | message: error, 26 | }, 27 | }); 28 | } 29 | }; 30 | 31 | //login teacher 32 | export const TeacherLogin = (data) => async (dispatch) => { 33 | try { 34 | dispatch({ type: types.LOGIN_TEACHER_REQUEST }); 35 | const res = await axios.post( 36 | "https://ill-blue-wildebeest-kilt.cyclic.app/teachers/login", 37 | data 38 | ); 39 | dispatch({ 40 | type: types.LOGIN_TEACHER_SUCCESS, 41 | payload: { 42 | message: res.data.message, 43 | user: res.data.user, 44 | token: res.data.token, 45 | }, 46 | }); 47 | return res.data; 48 | } catch (error) { 49 | dispatch({ 50 | type: types.LOGIN_TEACHER_ERROR, 51 | payload: { 52 | message: error, 53 | }, 54 | }); 55 | } 56 | }; 57 | 58 | //login admin 59 | export const AdminLogin = (data) => async (dispatch) => { 60 | try { 61 | dispatch({ type: types.LOGIN_ADMIN_REQUEST }); 62 | const res = await axios.post( 63 | "https://ill-blue-wildebeest-kilt.cyclic.app/admin/login", 64 | data 65 | ); 66 | dispatch({ 67 | type: types.LOGIN_ADMIN_SUCCESS, 68 | payload: { 69 | message: res.data.message, 70 | user: res.data.user, 71 | token: res.data.token, 72 | }, 73 | }); 74 | return res.data; 75 | } catch (error) { 76 | dispatch({ 77 | type: types.LOGIN_ADMIN_ERROR, 78 | payload: { 79 | message: error, 80 | }, 81 | }); 82 | } 83 | }; 84 | 85 | // register Teacher 86 | export const TeacherRegister = (data) => async () => { 87 | try { 88 | const res = await axios.post( 89 | "https://ill-blue-wildebeest-kilt.cyclic.app/teachers/register", 90 | data 91 | ); 92 | return res.data; 93 | } catch (error) { 94 | console.log(error); 95 | } 96 | }; 97 | 98 | // register student 99 | export const StudentRegister = (data) => async () => { 100 | try { 101 | const res = await axios.post( 102 | "https://ill-blue-wildebeest-kilt.cyclic.app/students/register", 103 | data 104 | ); 105 | return res.data; 106 | } catch (error) { 107 | console.log(error); 108 | } 109 | }; 110 | 111 | // REGISTER ADMIN 112 | export const AdminRegister = (data) => async () => { 113 | try { 114 | const res = await axios.post( 115 | "https://ill-blue-wildebeest-kilt.cyclic.app/admin/register", 116 | data 117 | ); 118 | return res.data; 119 | } catch (error) { 120 | console.log(error); 121 | } 122 | }; 123 | 124 | // REGISTER bus 125 | export const BusRegister = (data) => async (dispatch) => { 126 | try { 127 | await axios.post( 128 | "https://ill-blue-wildebeest-kilt.cyclic.app/bus/add", 129 | data 130 | ); 131 | } catch (error) { 132 | console.log(error); 133 | } 134 | }; 135 | 136 | // logout user 137 | export const authLogout = () => async (dispatch) => { 138 | try { 139 | dispatch({ 140 | type: types.AUTH_LOGOUT, 141 | }); 142 | } catch (error) { 143 | console.log(error); 144 | } 145 | }; 146 | 147 | //update student 148 | export const UpdateStudent = (data, id) => async (dispatch) => { 149 | try { 150 | dispatch({ type: types.EDIT_STUDENT_REQUEST }); 151 | const res = await axios.patch( 152 | `https://ill-blue-wildebeest-kilt.cyclic.app/students/${id}`, 153 | data 154 | ); 155 | dispatch({ type: types.EDIT_STUDENT_SUCCESS, payload: res.data.user }); 156 | } catch (error) { 157 | console.log(error); 158 | } 159 | }; 160 | 161 | //update teacher 162 | export const UpdateTeacher = (data, id) => async (dispatch) => { 163 | try { 164 | dispatch({ type: types.EDIT_TEACHER_REQUEST }); 165 | const res = await axios.patch( 166 | `https://ill-blue-wildebeest-kilt.cyclic.app/teachers/${id}`, 167 | data 168 | ); 169 | dispatch({ type: types.EDIT_TEACHER_SUCCESS, payload: res.data.user }); 170 | } catch (error) { 171 | console.log(error); 172 | } 173 | }; 174 | 175 | //send password 176 | export const SendPassword = (data) => async () => { 177 | try { 178 | const res = await axios.post( 179 | `https://ill-blue-wildebeest-kilt.cyclic.app/admin/password`, 180 | data 181 | ); 182 | return res.data; 183 | } catch (error) { 184 | console.log(error); 185 | } 186 | }; 187 | 188 | //forgot password 189 | export const forgetPassword = (data) => async () => { 190 | try { 191 | const res = await axios.post( 192 | `https://ill-blue-wildebeest-kilt.cyclic.app/admin/forgot`, 193 | data 194 | ); 195 | return res.data; 196 | } catch (error) { 197 | console.log(error); 198 | } 199 | }; 200 | -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Student/AddDoubt.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { ToastContainer, toast } from "react-toastify"; 4 | import "react-toastify/dist/ReactToastify.css"; 5 | 6 | import { 7 | AddDoubts, 8 | } from "../../../../../Redux/Datas/action"; 9 | import Sidebar from "../../GlobalFiles/Sidebar"; 10 | import { Navigate } from "react-router-dom"; 11 | 12 | const notify = (text) => toast(text); 13 | 14 | const AddDoubt = () => { 15 | const [loading, setLoading] = useState(false); 16 | 17 | const dispatch = useDispatch(); 18 | 19 | const { data } = useSelector((store) => store.auth); 20 | 21 | const InitData = { 22 | studentID: data?.user._id, 23 | class: "", 24 | subject: "", 25 | teacher: "", 26 | date: "", 27 | details: "", 28 | image: "", 29 | }; 30 | const [AddDoubt, setAddDoubt] = useState(InitData); 31 | 32 | const HandleAppointment = (e) => { 33 | setAddDoubt({ ...AddDoubt, [e.target.name]: e.target.value }); 34 | }; 35 | 36 | const HandleOnsubmitAppointment = (e) => { 37 | e.preventDefault(); 38 | if ( 39 | AddDoubt.class === "" || 40 | AddDoubt.teacher === "" || 41 | AddDoubt.subject === "" || 42 | AddDoubt.studentID === "" || 43 | AddDoubt.details === "" 44 | ) { 45 | return notify("Please Enter All the Requried Feilds"); 46 | } 47 | setLoading(true); 48 | console.log(AddDoubt); 49 | dispatch(AddDoubts(AddDoubt)); 50 | notify("Doubt Asked"); 51 | setLoading(false); 52 | setAddDoubt(InitData); 53 | }; 54 | 55 | if (data?.isAuthenticated === false) { 56 | return ; 57 | } 58 | 59 | if (data?.user.userType !== "student") { 60 | return ; 61 | } 62 | 63 | return ( 64 | <> 65 | 66 |
67 | 68 |
69 |
70 |

Ask Doubt

71 | 72 |
73 |
74 | 75 |
76 | 84 |
85 |
86 |
87 | 88 |
89 | 97 |
98 |
99 | 100 |
101 | 102 |
103 | 118 |
119 |
120 |
121 | 122 |
123 | 136 |
137 |
138 |
139 | 140 |
141 | 152 |
153 |
154 | 161 | 162 |
163 |
164 |
165 | 166 | ); 167 | }; 168 | 169 | export default AddDoubt; 170 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/static/css/main.b18b9ae0.chunk.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["main.b18b9ae0.chunk.css","webpack://src/components/Video/Video.css","webpack://src/components/ID/ID.css","webpack://src/components/Call/call.css","webpack://src/components/Header/Header.css","webpack://src/App.css"],"names":[],"mappings":"AAAA,iGAAiG,CCAjG,OACE,WAAY,CACZ,YAAa,CACb,eAAgB,CAChB,YACF,CACA,WACE,WAAY,CACZ,sBAAuB,CACvB,kBAAmB,CACnB,aACF,CACA,MACE,UACF,CACA,qCACE,WACE,WACF,CACF,CACA,oCACE,OACE,YAAa,CACb,qBAAsB,CACtB,aAAS,CAAT,QACF,CACF,CACA,mCACE,WACE,WACF,CACF,CC/BA,MACE,UAAW,CACX,YAAa,CAEb,qBAAsB,CACtB,sBAAuB,CAEvB,sCAA2C,CAC3C,aAAS,CAAT,QAAS,CACT,iBACF,CACA,gBARE,YAAa,CAGb,kBASF,CAJA,UAGE,aAAS,CAAT,QACF,CACA,gBACE,WAAY,CACZ,YAAa,CACb,WAAY,CACZ,iBACF,CACA,QACE,UAAY,CACZ,wBAAyB,CACzB,iBAAkB,CAClB,gBAAiB,CACjB,cAAe,CACf,oBAAqB,CACrB,eAAgB,CAChB,YACF,CC/BA,MACE,iBAAkB,CAClB,KAAM,CACN,OAAQ,CACR,gBAAiB,CACjB,YAAa,CACb,wBAA2B,CAC3B,kBACF,CACA,uBACE,eAAgB,CAChB,wBAAkC,CAClC,UAAY,CACZ,eAAgB,CAChB,iBACF,CACA,SACE,wBAAkC,CAClC,UAAY,CACZ,iBACF,CCpBA,QACE,UAAW,CACX,YAAa,CACb,kBAAmB,CACnB,sBAAuB,CACvB,YAAa,CACb,aAAS,CAAT,QAAS,CACT,uCAEF,CACA,UACE,UAAY,CACZ,wBAAyB,CACzB,kBAAmB,CACnB,gBAAiB,CACjB,cAAe,CACf,oBAAqB,CACrB,eACF,CChBA,KACE,6KAA8K,CAC9K,2BAA4B,CAC5B,qBAAsB,CACtB,iBACF,CACA,wBACE,YACF,CACA,EACE,QAAS,CACT,SAAU,CACV,8BACF","file":"main.b18b9ae0.chunk.css","sourcesContent":["@import url(https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap);\n.video {\r\n width: 100vw;\r\n display: flex;\r\n margin-top: 25px;\r\n height: 100vh;\r\n}\r\n.video > div {\r\n width: 600px;\r\n justify-content: center;\r\n align-items: center;\r\n margin: 0 auto;\r\n}\r\nvideo {\r\n width: 100%;\r\n}\r\n@media screen and (max-width: 1100px) {\r\n .video > div {\r\n width: 400px;\r\n }\r\n}\r\n@media screen and (max-width: 900px) {\r\n .video {\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 1rem;\r\n gap: 1rem;\r\n }\r\n}\r\n@media screen and (max-width: 50px) {\r\n .video > div {\r\n width: 300px;\r\n }\r\n}\r\n\n.form {\r\n width: 100%;\r\n padding: 1rem;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n background-color: rgba(158, 210, 255, 0.54);\r\n grid-gap: 1rem;\r\n gap: 1rem;\r\n position: relative;\r\n}\r\n.form > div {\r\n display: flex;\r\n align-items: center;\r\n grid-gap: 20px;\r\n gap: 20px;\r\n}\r\n.form > div input {\r\n padding: 5px;\r\n outline: none;\r\n border: none;\r\n border-radius: 5px;\r\n}\r\n.button {\r\n color: white;\r\n background-color: #5a77e8;\r\n border-radius: 5px;\r\n padding: 5px 10px;\r\n cursor: pointer;\r\n text-decoration: none;\r\n font-weight: 400;\r\n margin: 5px 0;\r\n}\r\n\n.call {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n margin: 1rem 2rem;\r\n padding: 1rem;\r\n background-color: aliceblue;\r\n border-radius: 10px;\r\n}\r\n.call > div:nth-child(2) {\r\n margin-top: 10px;\r\n background-color: rgb(34, 189, 34);\r\n color: white;\r\n font-weight: 700;\r\n text-align: center;\r\n}\r\n.decline {\r\n background-color: rgb(215, 53, 53);\r\n color: white;\r\n text-align: center;\r\n}\r\n\n.header {\r\n width: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 1rem;\r\n grid-gap: 20px;\r\n gap: 20px;\r\n background-color: rgba(240, 248, 255, 0.393);\r\n\r\n}\r\n.header a {\r\n color: white;\r\n background-color: #5a77e8;\r\n border-radius: 10px;\r\n padding: 5px 10px;\r\n cursor: pointer;\r\n text-decoration: none;\r\n font-weight: 500;\r\n}\r\n\nbody {\n background: url(https://images.unsplash.com/photo-1618556450994-a6a128ef0d9d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=764&q=80);\n background-repeat: no-repeat;\n background-size: cover;\n position: relative;\n}\nbody::-webkit-scrollbar {\n display: none;\n}\n* {\n margin: 0;\n padding: 0;\n font-family: \"Rubik\", sans-serif;\n}\n\n",".video {\r\n width: 100vw;\r\n display: flex;\r\n margin-top: 25px;\r\n height: 100vh;\r\n}\r\n.video > div {\r\n width: 600px;\r\n justify-content: center;\r\n align-items: center;\r\n margin: 0 auto;\r\n}\r\nvideo {\r\n width: 100%;\r\n}\r\n@media screen and (max-width: 1100px) {\r\n .video > div {\r\n width: 400px;\r\n }\r\n}\r\n@media screen and (max-width: 900px) {\r\n .video {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 1rem;\r\n }\r\n}\r\n@media screen and (max-width: 50px) {\r\n .video > div {\r\n width: 300px;\r\n }\r\n}\r\n",".form {\r\n width: 100%;\r\n padding: 1rem;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n background-color: rgba(158, 210, 255, 0.54);\r\n gap: 1rem;\r\n position: relative;\r\n}\r\n.form > div {\r\n display: flex;\r\n align-items: center;\r\n gap: 20px;\r\n}\r\n.form > div input {\r\n padding: 5px;\r\n outline: none;\r\n border: none;\r\n border-radius: 5px;\r\n}\r\n.button {\r\n color: white;\r\n background-color: #5a77e8;\r\n border-radius: 5px;\r\n padding: 5px 10px;\r\n cursor: pointer;\r\n text-decoration: none;\r\n font-weight: 400;\r\n margin: 5px 0;\r\n}\r\n",".call {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n margin: 1rem 2rem;\r\n padding: 1rem;\r\n background-color: aliceblue;\r\n border-radius: 10px;\r\n}\r\n.call > div:nth-child(2) {\r\n margin-top: 10px;\r\n background-color: rgb(34, 189, 34);\r\n color: white;\r\n font-weight: 700;\r\n text-align: center;\r\n}\r\n.decline {\r\n background-color: rgb(215, 53, 53);\r\n color: white;\r\n text-align: center;\r\n}\r\n",".header {\r\n width: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 1rem;\r\n gap: 20px;\r\n background-color: rgba(240, 248, 255, 0.393);\r\n\r\n}\r\n.header a {\r\n color: white;\r\n background-color: #5a77e8;\r\n border-radius: 10px;\r\n padding: 5px 10px;\r\n cursor: pointer;\r\n text-decoration: none;\r\n font-weight: 500;\r\n}\r\n","@import url(\"https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap\");\n\nbody {\n background: url(https://images.unsplash.com/photo-1618556450994-a6a128ef0d9d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=764&q=80);\n background-repeat: no-repeat;\n background-size: cover;\n position: relative;\n}\nbody::-webkit-scrollbar {\n display: none;\n}\n* {\n margin: 0;\n padding: 0;\n font-family: \"Rubik\", sans-serif;\n}\n"]} -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddAdmin.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { AdminRegister, SendPassword } from "../../../../../Redux/auth/action"; 4 | import Sidebar from "../../GlobalFiles/Sidebar"; 5 | import { ToastContainer, toast } from "react-toastify"; 6 | import "react-toastify/dist/ReactToastify.css"; 7 | import { Navigate } from "react-router-dom"; 8 | const notify = (text) => toast(text); 9 | 10 | const Add_Admin = () => { 11 | const { data } = useSelector((store) => store.auth); 12 | 13 | const [loading, setloading] = useState(false); 14 | 15 | const InitData = { 16 | adminName: "", 17 | age: "", 18 | mobile: "", 19 | email: "", 20 | gender: "", 21 | DOB: "", 22 | address: "", 23 | education: "", 24 | adminID: Date.now(), 25 | password: "", 26 | }; 27 | const [AdminValue, setAdminValue] = useState(InitData); 28 | 29 | const HandleAdminChange = (e) => { 30 | setAdminValue({ ...AdminValue, [e.target.name]: e.target.value }); 31 | }; 32 | const dispatch = useDispatch(); 33 | 34 | const HandleDoctorSubmit = (e) => { 35 | e.preventDefault(); 36 | setloading(true); 37 | dispatch(AdminRegister(AdminValue)).then((res) => { 38 | if (res.message === "Admin already exists") { 39 | setloading(false); 40 | return notify("Admin Already Exist"); 41 | } 42 | if (res.message === "error") { 43 | setloading(false); 44 | return notify("Something went wrong, Please try Again"); 45 | } 46 | notify("Admin Added"); 47 | 48 | let data = { 49 | email: res.data.email, 50 | password: res.data.password, 51 | userId: res.data.adminID, 52 | }; 53 | dispatch(SendPassword(data)).then((res) => notify("Account Detais Sent")); 54 | setloading(false); 55 | setAdminValue(InitData); 56 | }); 57 | }; 58 | 59 | if (data?.isAuthenticated === false) { 60 | return ; 61 | } 62 | 63 | if (data?.user.userType !== "admin") { 64 | return ; 65 | } 66 | 67 | return ( 68 | <> 69 | 70 |
71 | 72 |
73 |
74 |

Add Admin

75 |
76 |
77 | 78 |
79 | 87 |
88 |
89 |
90 | 91 |
92 | 100 |
101 |
102 |
103 | 104 |
105 | 113 |
114 |
115 |
116 | 117 |
118 | 126 |
127 |
128 |
129 | 130 |
131 | 142 |
143 |
144 |
145 | 146 |
147 | 155 |
156 |
157 |
158 | 159 |
160 | 168 |
169 |
170 |
171 | 172 |
173 | 181 |
182 |
183 |
184 | 185 |
186 | 194 |
195 |
196 | 197 | 200 | 201 |
202 |
203 |
204 | 205 | ); 206 | }; 207 | 208 | export default Add_Admin; 209 | -------------------------------------------------------------------------------- /sms-chat-frontend/build/static/js/runtime-main.03887cff.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","this","oldJsonpFunction","slice"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,GAGAZ,EAAkB,GAGtB,SAASS,EAAoB1B,GAG5B,GAAG4B,EAAiB5B,GACnB,OAAO4B,EAAiB5B,GAAU8B,QAGnC,IAAIC,EAASH,EAAiB5B,GAAY,CACzCK,EAAGL,EACHgC,GAAG,EACHF,QAAS,IAUV,OANAhB,EAAQd,GAAUW,KAAKoB,EAAOD,QAASC,EAAQA,EAAOD,QAASJ,GAG/DK,EAAOC,GAAI,EAGJD,EAAOD,QAKfJ,EAAoBO,EAAInB,EAGxBY,EAAoBQ,EAAIN,EAGxBF,EAAoBS,EAAI,SAASL,EAASM,EAAMC,GAC3CX,EAAoBY,EAAER,EAASM,IAClC5B,OAAO+B,eAAeT,EAASM,EAAM,CAAEI,YAAY,EAAMC,IAAKJ,KAKhEX,EAAoBgB,EAAI,SAASZ,GACX,qBAAXa,QAA0BA,OAAOC,aAC1CpC,OAAO+B,eAAeT,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DrC,OAAO+B,eAAeT,EAAS,aAAc,CAAEe,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKzC,OAAO0C,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBzC,OAAO+B,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOnB,EAAoBS,EAAEc,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRvB,EAAoB2B,EAAI,SAAStB,GAChC,IAAIM,EAASN,GAAUA,EAAOiB,WAC7B,WAAwB,OAAOjB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAL,EAAoBS,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRX,EAAoBY,EAAI,SAASgB,EAAQC,GAAY,OAAO/C,OAAOC,UAAUC,eAAeC,KAAK2C,EAAQC,IAGzG7B,EAAoB8B,EAAI,IAExB,IAAIC,EAAaC,KAAyB,mBAAIA,KAAyB,oBAAK,GACxEC,EAAmBF,EAAW5C,KAAKuC,KAAKK,GAC5CA,EAAW5C,KAAOf,EAClB2D,EAAaA,EAAWG,QACxB,IAAI,IAAIvD,EAAI,EAAGA,EAAIoD,EAAWlD,OAAQF,IAAKP,EAAqB2D,EAAWpD,IAC3E,IAAIU,EAAsB4C,EAI1BxC,I","file":"static/js/runtime-main.03887cff.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \tvar jsonpArray = this[\"webpackJsonpclient\"] = this[\"webpackJsonpclient\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /sms-frontend/src/Pages/Dashboard/Main-Dashboard/AllPages/Admin/AddStudent.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import "./CSS/AddTeacher.scss"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { 5 | SendPassword, 6 | StudentRegister, 7 | } from "../../../../../Redux/auth/action"; 8 | import Sidebar from "../../GlobalFiles/Sidebar"; 9 | import { ToastContainer, toast } from "react-toastify"; 10 | import "react-toastify/dist/ReactToastify.css"; 11 | import { Navigate } from "react-router-dom"; 12 | const notify = (text) => toast(text); 13 | 14 | const Add_Nurse = () => { 15 | const { data } = useSelector((store) => store.auth); 16 | 17 | const dispatch = useDispatch(); 18 | 19 | const [loading, setLoading] = useState(false); 20 | 21 | const InitData = { 22 | studentName: "", 23 | age: "", 24 | mobile: "", 25 | email: "", 26 | gender: "", 27 | DOB: "", 28 | address: "", 29 | class: "", 30 | studentID: Date.now(), 31 | password: "", 32 | details: "", 33 | }; 34 | const [StudentValue, setStudentValue] = useState(InitData); 35 | 36 | const HandleDoctorChange = (e) => { 37 | setStudentValue({ ...StudentValue, [e.target.name]: e.target.value }); 38 | }; 39 | 40 | const HandleDoctorSubmit = (e) => { 41 | e.preventDefault(); 42 | setLoading(true); 43 | console.log(StudentValue); 44 | dispatch(StudentRegister(StudentValue)).then((res) => { 45 | console.log(res); 46 | if (res.message === "Student already exists") { 47 | setLoading(false); 48 | return notify("Student Already Exist"); 49 | } 50 | if (res.message === "error") { 51 | setLoading(false); 52 | return notify("error"); 53 | } 54 | notify("Student Added"); 55 | let data = { 56 | email: res.data.email, 57 | password: res.data.password, 58 | userId: res.data.studentID, 59 | }; 60 | dispatch(SendPassword(data)).then((res) => 61 | notify("Account Details Sent") 62 | ); 63 | setLoading(false); 64 | setStudentValue(InitData); 65 | }); 66 | }; 67 | 68 | if (data?.isAuthenticated === false) { 69 | return ; 70 | } 71 | 72 | if (data?.user.userType !== "admin") { 73 | return ; 74 | } 75 | 76 | return ( 77 | <> 78 | 79 |
80 | 81 |
82 |
83 |

Add student

84 |
85 |
86 | 87 |
88 | 96 |
97 |
98 |
99 | 100 |
101 | 109 |
110 |
111 |
112 | 113 |
114 | 122 |
123 |
124 |
125 | 126 |
127 | 135 |
136 |
137 |
138 | 139 |
140 | 151 |
152 |
153 |
154 | 155 |
156 | 164 |
165 |
166 |
167 | 168 |
169 | 177 |
178 |
179 |
180 | 181 |
182 | 197 |
198 |
199 | 200 |
201 | 202 |
203 | 211 |
212 |
213 |
214 | 215 |
216 |