├── .env.example ├── frontend ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── prenotebook192.png │ ├── prenotebook512.png │ ├── prenotebook64.png │ ├── sitemap.xml │ ├── manifest.json │ └── index.html ├── src │ ├── Component │ │ ├── homepage.css │ │ ├── notebookDark.png │ │ ├── notebookLight.png │ │ ├── Home.js │ │ ├── Alert.js │ │ ├── NoteItem.js │ │ ├── HomePage.js │ │ ├── Mynote.js │ │ ├── Notes.js │ │ ├── About.js │ │ ├── SearchNote.js │ │ ├── AddNote.js │ │ ├── Login.js │ │ ├── Navbar.js │ │ ├── EditNote.js │ │ ├── SignUp.js │ │ ├── PrivacyPolicy.js │ │ ├── TermsCondition.js │ │ └── notebook1.svg │ ├── index.js │ ├── Context │ │ └── notes │ │ │ ├── AlertState.js │ │ │ ├── BackState.js │ │ │ └── NoteState.js │ ├── App.js │ └── App.css ├── .prettierignore ├── .gitignore └── package.json ├── vercel.json ├── db.js ├── .gitignore ├── models ├── User.js └── Notes.js ├── middleware └── fetchUserDetails.js ├── package.json ├── index.js ├── README.md └── routes ├── notes.js └── auth.js /.env.example: -------------------------------------------------------------------------------- 1 | JWT_TOKEN= 2 | MONGO_API= -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /frontend/src/Component/homepage.css: -------------------------------------------------------------------------------- 1 | .imgsvg { 2 | max-width: 600px; 3 | max-height: inherit; 4 | } 5 | -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/innovatorved/Prenotebook/HEAD/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/prenotebook192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/innovatorved/Prenotebook/HEAD/frontend/public/prenotebook192.png -------------------------------------------------------------------------------- /frontend/public/prenotebook512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/innovatorved/Prenotebook/HEAD/frontend/public/prenotebook512.png -------------------------------------------------------------------------------- /frontend/public/prenotebook64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/innovatorved/Prenotebook/HEAD/frontend/public/prenotebook64.png -------------------------------------------------------------------------------- /frontend/src/Component/notebookDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/innovatorved/Prenotebook/HEAD/frontend/src/Component/notebookDark.png -------------------------------------------------------------------------------- /frontend/src/Component/notebookLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/innovatorved/Prenotebook/HEAD/frontend/src/Component/notebookLight.png -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { 5 | "src": "index.js", 6 | "use": "@vercel/node" 7 | } 8 | ], 9 | "routes": [ 10 | { 11 | "src": "/(.*)", 12 | "dest": "/index.js" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import App from "./App"; 4 | 5 | ReactDOM.render( 6 | 7 | 8 | , 9 | document.getElementById("root"), 10 | ); 11 | -------------------------------------------------------------------------------- /db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const mongoURI = process.env.MONGO_API; 4 | 5 | const connectToMongo = () => { 6 | mongoose.connect(mongoURI, () => { 7 | console.log("Connected to Mongo Successfully"); 8 | }); 9 | }; 10 | 11 | module.exports = connectToMongo; 12 | -------------------------------------------------------------------------------- /frontend/.prettierignore: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /backend/node_modules 5 | /node_modules 6 | /.pnp 7 | .pnp.js 8 | 9 | # testing 10 | /coverage 11 | 12 | # production 13 | /build 14 | 15 | # misc 16 | .DS_Store 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | .env 26 | /.env 27 | .env/ 28 | /.env/ -------------------------------------------------------------------------------- /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 | # yarn.locak 15 | yarn.lock 16 | 17 | # misc 18 | .DS_Store 19 | .env.local 20 | .env.development.local 21 | .env.test.local 22 | .env.production.local 23 | .env.production 24 | */.env.production 25 | */.env 26 | 27 | npm-debug.log* 28 | yarn-debug.log* 29 | yarn-error.log* 30 | 31 | # firebase 32 | .firebase/ 33 | .firebaserc 34 | firebase.json -------------------------------------------------------------------------------- /frontend/src/Component/Home.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | // import {useEffect , useState} from 'react'; 3 | // import HomePage from './HomePage'; 4 | import Notes from "./Notes"; 5 | 6 | export default function Home() { 7 | // const [token, settoken] = useState(null); 8 | 9 | // useEffect(() => { 10 | // const tok = localStorage.getItem('token'); 11 | // settoken(tok); 12 | // }, []); 13 | 14 | return ( 15 |
16 | { 17 | // token ? 18 | 19 | // : 20 | // 21 | } 22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /models/User.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const { Schema } = mongoose; 3 | 4 | const UserSchema = new Schema({ 5 | name: { 6 | type: String, 7 | required: true, 8 | }, 9 | username: { 10 | type: String, 11 | required: true, 12 | unique: true, 13 | }, 14 | email: { 15 | type: String, 16 | required: true, 17 | unique: true, 18 | }, 19 | password: { 20 | type: String, 21 | required: true, 22 | }, 23 | date: { 24 | type: Date, 25 | default: Date.now, 26 | }, 27 | }); 28 | const user = mongoose.model("user", UserSchema); 29 | module.exports = user; 30 | -------------------------------------------------------------------------------- /models/Notes.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const { Schema } = mongoose; 3 | 4 | const NotesSchema = new Schema({ 5 | user: { 6 | type: mongoose.Schema.Types.ObjectId, 7 | ref: "notes", 8 | }, 9 | title: { 10 | type: String, 11 | required: true, 12 | }, 13 | description: { 14 | type: String, 15 | required: true, 16 | }, 17 | share: { 18 | type: Boolean, 19 | default: false, 20 | }, 21 | tag: { 22 | type: String, 23 | default: "Genral", 24 | }, 25 | date: { 26 | type: Date, 27 | default: Date.now, 28 | }, 29 | }); 30 | 31 | module.exports = mongoose.model("notes", NotesSchema); 32 | -------------------------------------------------------------------------------- /frontend/src/Context/notes/AlertState.js: -------------------------------------------------------------------------------- 1 | import React, { createContext, useState } from "react"; 2 | 3 | // Createcontext 4 | const AlertContext = createContext(); 5 | 6 | const AlertState = (props) => { 7 | // Alert Setup 8 | const [alertVar, setAlert] = useState(null); 9 | const showAlert = (msg, type) => { 10 | setAlert({ 11 | msg: msg, 12 | type: type, 13 | }); 14 | setTimeout(() => { 15 | setAlert(null); 16 | }, 2000); 17 | }; 18 | return ( 19 | 20 | {props.children} 21 | 22 | ); 23 | }; 24 | 25 | export default AlertState; 26 | export { AlertContext }; 27 | -------------------------------------------------------------------------------- /middleware/fetchUserDetails.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | const JWT_KEY = process.env.JWT_TOKEN; 3 | 4 | const fetchUser = (req, res, next) => { 5 | // Get a JWT Token and decode this token and genrate id 6 | // we send JWT_key in the header "auth-token" 7 | const token = req.header("auth-token"); 8 | 9 | if (!token) { 10 | res.status(401).send({ error: "Authenticate a valid token" }); 11 | } 12 | try { 13 | const userDetail = jwt.verify(token, JWT_KEY); 14 | req.user = userDetail.user; 15 | next(); 16 | } catch (err) { 17 | // Run if any error occurs in last 18 | res.status(500).send("Internal Server try after some time2"); 19 | console.error(err.message); 20 | } 21 | }; 22 | 23 | module.exports = fetchUser; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prenotebook", 3 | "version": "1.0.0", 4 | "description": "Notebook on the Cloud", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "dev": "node index.js --watch", 9 | "build": "cd frontend && npm run build", 10 | "install:all": "npm install && cd frontend && npm install && cd ..", 11 | "fix": "prettier --write ." 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "dependencies": { 16 | "bcryptjs": "^2.4.3", 17 | "dotenv": "^10.0.0", 18 | "express": "^4.17.1", 19 | "express-validator": "^6.12.1", 20 | "jsonwebtoken": "^8.5.1", 21 | "mongoose": "^6.0.6", 22 | "morgan": "^1.10.0" 23 | }, 24 | "devDependencies": { 25 | "prettier": "^3.3.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /frontend/public/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | https://prenotebook.ml/ 11 | 2021-12-07T08:20:25+00:00 12 | 13 | 14 | https://prenotebook.ml/about 15 | 2020-12-07T08:20:25+00:00 16 | 17 | 18 | https://prenotebook.ml/signup 19 | 2020-12-07T08:20:25+00:00 20 | 21 | 22 | https://prenotebook.ml/login 23 | 2020-12-07T08:20:25+00:00 24 | 25 | 26 | -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Prenotebook", 3 | "name": "Prenotebook | Notebook is a note-taking service included as part of the free, web-based Notebook and you can easily sjhare your notes with anyone", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "prenotebook64.png", 12 | "type": "image/png", 13 | "sizes": "64x64" 14 | }, 15 | { 16 | "src": "prenotebook192.png", 17 | "type": "image/png", 18 | "sizes": "192x192" 19 | }, 20 | { 21 | "src": "prenotebook512.png", 22 | "type": "image/png", 23 | "sizes": "512x512" 24 | } 25 | ], 26 | "start_url": ".", 27 | "display": "standalone", 28 | "theme_color": "#212529", 29 | "background_color": "#eef2e" 30 | } 31 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | 3 | const connectToMongo = require("./db"); 4 | const express = require("express"); 5 | const path = require("path"); 6 | const morgan = require("morgan"); 7 | 8 | connectToMongo(); 9 | 10 | const app = express(); 11 | const reactRouter = express.Router(); 12 | const buildPath = path.normalize(path.join(__dirname, "./frontend/build")) 13 | const port = process.env.PORT || 3000; 14 | 15 | app.use(morgan("combined")); 16 | app.use(express.json()); 17 | 18 | app.use("/api/auth", require("./routes/auth")); 19 | app.use("/api/notes", require("./routes/notes")); 20 | 21 | reactRouter.get('(/*)?', async (req, res, next) => { 22 | res.sendFile(path.join(buildPath, 'index.html')); 23 | }) 24 | app.use(reactRouter) 25 | 26 | 27 | app.listen(port, () => { 28 | console.log(`PreNotebook app listening at https://localhost:${port}/`); 29 | }); 30 | -------------------------------------------------------------------------------- /frontend/src/Component/Alert.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import PropTypes from "prop-types"; 3 | 4 | import { AlertContext } from "../Context/notes/AlertState"; 5 | 6 | export default function Alert() { 7 | const { alertVar } = useContext(AlertContext); 8 | 9 | return ( 10 |
11 | {alertVar && ( 12 |
13 |
17 | {alertVar.msg} 18 | 24 |
25 |
26 | )} 27 |
28 | ); 29 | } 30 | 31 | Alert.propTypes = { 32 | alertMsg: PropTypes.object, 33 | }; 34 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "audit": "^0.0.6", 7 | "html-react-parser": "^5.1.16", 8 | "prop-types": "^15.8.1", 9 | "react": "^18.3.1", 10 | "react-dom": "^18.3.1", 11 | "react-router-dom": "^6.26.2", 12 | "react-scripts": "^5.0.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "CI=false react-scripts build" 17 | }, 18 | "eslintConfig": { 19 | "extends": [ 20 | "react-app" 21 | ] 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | }, 35 | "devDependencies": { 36 | "@babel/plugin-transform-private-property-in-object": "^7.24.7" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Logo](https://i.ibb.co/FKv7Pmr/notebook-Light.png) 2 | 3 | # Prenotebook 4 | 5 | Notebook is a note-taking service included as part of the free, web-based Notebook 6 | 7 | ## Demo 8 | 9 | http://prenotebook.ml/ 10 | 11 | ## Deployment 12 | 13 | To deploy this project run 14 | 15 | ### Clone the Repo 16 | 17 | ```bash 18 | git clone git@github.com:innovatorved/PreNotebook.git 19 | ``` 20 | 21 | ### Install Dependencies 22 | 23 | ```bash 24 | cd PreNotebook 25 | npm install:all 26 | ``` 27 | 28 | ### Build the Client 29 | 30 | ```bash 31 | npm build 32 | ``` 33 | 34 | ### Start the Server 35 | 36 | ```bash 37 | npm start 38 | ``` 39 | 40 | ## Tech Stack 41 | 42 | **Client:** React, react-router-dom , Bootstrap , 43 | 44 | **Server:** bcryptjs ,express , express-validator , jsonwebtoken ,mongoose 45 | 46 | **Database:** MongoDB 47 | 48 | ## Screenshots 49 | 50 | ![Prenotebook Dashboard](https://i.ibb.co/GsXjpy7/mainpage1.png) 51 | 52 | ![Edit Note](https://i.ibb.co/Y3nXLh5/edit2.png) 53 | 54 | ![Note](https://i.ibb.co/hHjpvnW/note3.png) 55 | 56 | ## License 57 | 58 | [MIT](https://choosealicense.com/licenses/mit/) 59 | 60 | ## Authors 61 | 62 | - [Ved Gupta](https://www.github.com/innovatorved) 63 | 64 | ## 🚀 About Me 65 | 66 | I'm a Developer i will feel the code then write . 67 | 68 | ## Support 69 | 70 | For support, email vedgupta@protonmail.com 71 | -------------------------------------------------------------------------------- /frontend/src/Context/notes/BackState.js: -------------------------------------------------------------------------------- 1 | import React, { createContext, useState, useEffect } from "react"; 2 | 3 | // Createcontext 4 | const BackContext = createContext(); 5 | 6 | const BackState = (props) => { 7 | const [mode, setmode] = useState("light"); 8 | 9 | useEffect(() => { 10 | if (localStorage.getItem("mode")) { 11 | if (localStorage.getItem("mode") !== "light") { 12 | setmode("dark"); 13 | localStorage.setItem("mode", "dark"); 14 | document.body.style.backgroundColor = "#32383e"; 15 | } else { 16 | setmode("light"); 17 | localStorage.setItem("mode", "light"); 18 | document.body.style.backgroundColor = "#eef2e4"; 19 | } 20 | } 21 | }, [1]); 22 | 23 | const [search, setsearch] = useState(""); 24 | const ChangeSearch = (value) => { 25 | setsearch(value); 26 | }; 27 | 28 | const ChangeMode = () => { 29 | if (mode === "light") { 30 | setmode("dark"); 31 | localStorage.setItem("mode", "dark"); 32 | document.body.style.backgroundColor = "#32383e"; 33 | } else { 34 | setmode("light"); 35 | localStorage.setItem("mode", "light"); 36 | document.body.style.backgroundColor = "#eef2e4"; 37 | } 38 | }; 39 | 40 | return ( 41 | 42 | {props.children} 43 | 44 | ); 45 | }; 46 | 47 | export default BackState; 48 | export { BackContext }; 49 | -------------------------------------------------------------------------------- /frontend/src/Component/NoteItem.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import { NoteContext } from "../Context/notes/NoteState"; 3 | import { BackContext } from "../Context/notes/BackState"; 4 | 5 | export default function NoteItem(props) { 6 | const { DeleteNote } = useContext(NoteContext); 7 | const { mode } = useContext(BackContext); 8 | 9 | const { note, UpdateNote } = props; 10 | 11 | const delNote = () => { 12 | DeleteNote(note._id); 13 | }; 14 | 15 | const TriggerUpdateNote = () => { 16 | UpdateNote(note); 17 | }; 18 | 19 | return ( 20 |
21 |
28 |
29 |
33 |
{note.title}
34 | 35 | 36 |
37 |

42 | {note.description} 43 |

44 |
45 |
46 |
47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /frontend/src/Component/HomePage.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | 3 | import "./homepage.css"; 4 | 5 | import notebook1 from "./notebook1.svg"; 6 | 7 | import { BackContext } from "../Context/notes/BackState"; 8 | 9 | export default function HomePage() { 10 | const { mode } = useContext(BackContext); 11 | 12 | const note = { 13 | id: 1412, 14 | title: "Hello Users !", 15 | description: 16 | "This is a simple note that demonstrate the usage of prenotebook.Notebook is a note-taking service included as part of the free, web-based Notebook Editors . Notebook is available as a web application for desktop and mobile versions.", 17 | }; 18 | return ( 19 |
20 |
21 |
22 | ... 23 |
24 | 25 |
26 |
33 |
34 |
38 |
{note.title}
39 | 40 | 41 |
42 |

46 | {note.description} 47 |

48 |
49 |
50 |
51 |
52 |
53 | ); 54 | } 55 | -------------------------------------------------------------------------------- /frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./App.css"; 3 | import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; 4 | 5 | import Navbar from "./Component/Navbar"; 6 | import Home from "./Component/Home"; 7 | import About from "./Component/About"; 8 | import Login from "./Component/Login"; 9 | import SignUp from "./Component/SignUp"; 10 | import Alert from "./Component/Alert"; 11 | import Mynote from "./Component/Mynote"; 12 | import SearchNote from "./Component/SearchNote"; 13 | import NoteState from "./Context/notes/NoteState"; 14 | import AlertState from "./Context/notes/AlertState"; 15 | import BackState from "./Context/notes/BackState"; 16 | import TermsCondition from "./Component/TermsCondition"; 17 | import PrivacyPolicy from "./Component/PrivacyPolicy"; 18 | 19 | function App() { 20 | return ( 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 |
31 | 32 | } /> 33 | } /> 34 | } /> 35 | } /> 36 | } /> 37 | } /> 38 | } 41 | /> 42 | } /> 43 | 44 |
45 |
46 |
47 |
48 |
49 |
50 | ); 51 | } 52 | 53 | export default App; 54 | -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | Prenotebook | Cloud Notebook | Save your Note | create , update , delete 24 | notes 25 | 26 | 27 | 28 | 32 | 41 | 42 | 43 | 44 | 49 | 50 | 55 | 60 | 61 | 65 | 66 | 67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /frontend/src/Component/Mynote.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useContext, useState } from "react"; 2 | import { useParams } from "react-router-dom"; 3 | 4 | import { NoteContext } from "../Context/notes/NoteState"; 5 | import { BackContext } from "../Context/notes/BackState"; 6 | 7 | export default function () { 8 | const { id } = useParams(); 9 | const { notes, playing, speak, fetchNotes } = useContext(NoteContext); 10 | const { mode } = useContext(BackContext); 11 | 12 | const [mynote, setmynote] = useState({ 13 | title: "", 14 | description: "", 15 | }); 16 | 17 | useEffect(() => { 18 | if (localStorage.getItem("token") && notes[0]._id === "1") { 19 | fetchNotes(); 20 | } 21 | const n = notes.filter((note) => { 22 | return note._id === id; 23 | }); 24 | if (n.length > 0) { 25 | setmynote(n[0]); 26 | } 27 | }, [id, fetchNotes, notes]); 28 | 29 | return ( 30 |
31 |
38 |
39 |
40 |
41 |
45 | {mynote.title} 46 |
47 | 57 |
58 |
59 |
60 |
61 |
69 |             {mynote.description}
70 |           
71 |
72 |
73 |
74 |
75 | ); 76 | } 77 | -------------------------------------------------------------------------------- /frontend/src/Component/Notes.js: -------------------------------------------------------------------------------- 1 | import React, { useContext, useEffect, useRef, useState } from "react"; 2 | import { NoteContext } from "../Context/notes/NoteState"; 3 | import NoteItem from "./NoteItem"; 4 | import AddNote from "./AddNote"; 5 | import EditNote from "./EditNote"; 6 | import { useNavigate } from "react-router-dom"; 7 | 8 | import { BackContext } from "../Context/notes/BackState"; 9 | 10 | export default function Notes() { 11 | const { notes, fetchNotes } = useContext(NoteContext); 12 | const { mode, search } = useContext(BackContext); 13 | 14 | const navigate = useNavigate(); 15 | 16 | useEffect(() => { 17 | if (localStorage.getItem("token")) { 18 | fetchNotes(); 19 | } else { 20 | navigate("/login"); 21 | } 22 | // eslint-disable-next-line 23 | }, []); 24 | 25 | const ref = useRef(null); 26 | const [note, setnote] = useState({ 27 | title: "", 28 | description: "", 29 | tag: "", 30 | }); 31 | const UpdateNote = async (EditNote) => { 32 | await setnote(EditNote); 33 | await ref.current.click(); 34 | }; 35 | 36 | return ( 37 | <> 38 | 39 | 47 | 48 |
49 |

53 | Notes 54 |

55 | {search === "" 56 | ? notes 57 | .map((item) => item) 58 | .reverse() 59 | .map((note) => { 60 | return ( 61 | 66 | ); 67 | }) 68 | : notes 69 | .map((item) => item) 70 | .reverse() 71 | .filter((note) => { 72 | return ( 73 | note.title.includes(search) || 74 | note.description.includes(search) || 75 | note.tag.includes(search) 76 | ); 77 | }) 78 | .map((note) => { 79 | return ( 80 | 85 | ); 86 | })} 87 |
88 | 89 | ); 90 | } 91 | -------------------------------------------------------------------------------- /frontend/src/Component/About.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import { BackContext } from "../Context/notes/BackState"; 3 | 4 | // Import Image 5 | import notebookDark from "./notebookDark.png"; 6 | import notebookLight from "./notebookLight.png"; 7 | 8 | const About = () => { 9 | // eslint-disable-next-line 10 | const { mode } = useContext(BackContext); 11 | 12 | return ( 13 |

17 | Logo 24 |
25 |
26 | Notebook is a note-taking service included as part of the free, web-based 27 | Notebook Editors . 28 |
29 | Notebook is available as a web application for desktop and mobile 30 | versions. 31 |
32 |
33 |
34 | Design of Notebook is responsive design so its support on all web screens 35 | with the help of Bootstrap framework. The web application offers a variety 36 | of tools for creating a note to share a note with a link to provide full 37 | access to your note.The interface allows for a single-column view or a 38 | multi-column view. Notes can be categorized with tags by default General 39 | tag. 40 |
41 |
42 | MERN stack is a software stack that includes four open-source 43 | technologies: (MongoDB, Express.js, React, and Node.js). 44 |
45 |
46 | These components provide an end-to-end framework for building dynamic web 47 | sites and web applications. Among these technologies MongoDB is a database 48 | system, 49 |
50 |
51 | Node.js is a server-side runtime environment, Express.js is a web 52 | framework for Node.js and React is a client-side JavaScript library used 53 | for building user interfaces. 54 |
55 |
56 |
57 | Because all components of the MERN stack support programs that are written 58 | in JavaScript, MERN applications can be written in one programming 59 | language for both server-side and client-side execution environments. 60 |
61 |
62 |
63 | Express.js (also referred to as Express) is a modular web application 64 | framework for Node.js. Whilst Express is capable of acting as an 65 | internet-facing web server, even supporting SSL/TLS out of the box, it is 66 | often used in conjunction with a reverse proxy such as NGINX or Apache for 67 | performance reasons. 68 |

69 | ); 70 | }; 71 | 72 | export default About; 73 | -------------------------------------------------------------------------------- /frontend/src/Component/SearchNote.js: -------------------------------------------------------------------------------- 1 | import React, { useContext, useEffect } from "react"; 2 | import { useParams } from "react-router-dom"; 3 | 4 | import { NoteContext } from "../Context/notes/NoteState"; 5 | import { BackContext } from "../Context/notes/BackState"; 6 | 7 | export default function SearchNote() { 8 | const { SearchShareNote, searchNote, playing, speak } = 9 | useContext(NoteContext); 10 | const { mode } = useContext(BackContext); 11 | 12 | const { id } = useParams(); 13 | 14 | useEffect(() => { 15 | SearchShareNote(id); 16 | // eslint-disable-next-line 17 | }, []); 18 | 19 | return ( 20 |
21 | {searchNote.success === "true" ? ( 22 |
23 |
30 |
31 |
32 |
33 |
37 | {searchNote.mynote.title} 38 |
39 | 49 |
50 |
51 |
52 |
53 |
 61 |                 {searchNote.mynote.description}
 62 |               
63 |
64 |
65 |
66 |
67 |
68 |
69 | ) : searchNote.success === undefined ? ( 70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | ) : ( 97 |
98 |
102 | Note Not Found 103 |
104 |
105 | )} 106 |
107 | ); 108 | } 109 | -------------------------------------------------------------------------------- /frontend/src/Component/AddNote.js: -------------------------------------------------------------------------------- 1 | import React, { useContext, useState } from "react"; 2 | 3 | import { NoteContext } from "../Context/notes/NoteState"; 4 | import { AlertContext } from "../Context/notes/AlertState"; 5 | import { BackContext } from "../Context/notes/BackState"; 6 | 7 | export default function AddNote() { 8 | const { AddNote } = useContext(NoteContext); 9 | const { showAlert } = useContext(AlertContext); 10 | const { mode } = useContext(BackContext); 11 | 12 | const [note, setnote] = useState({ title: "", description: "", tag: "" }); 13 | const ChangesInNote = (e) => { 14 | setnote({ ...note, [e.target.name]: e.target.value }); 15 | }; 16 | 17 | //Save Note 18 | const SaveNote = async (e) => { 19 | e.preventDefault(); 20 | const jsonRes = await AddNote(note); 21 | if (jsonRes.success) { 22 | setnote({ title: "", description: "", tag: "" }); 23 | showAlert("Note Added", "primary"); 24 | } else { 25 | showAlert(jsonRes.error, "warning"); 26 | } 27 | }; 28 | return ( 29 |
30 |

34 | Create a Note 35 |

36 |
37 |
38 | 44 | 57 |
58 |
59 | 65 | 78 |
79 |
80 | 86 | 99 |
100 | 108 |
109 |
110 | ); 111 | } 112 | -------------------------------------------------------------------------------- /frontend/src/Component/Login.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useContext } from "react"; 2 | import { useNavigate, Link } from "react-router-dom"; 3 | 4 | import { AlertContext } from "../Context/notes/AlertState"; 5 | import { NoteContext } from "../Context/notes/NoteState"; 6 | import { BackContext } from "../Context/notes/BackState"; 7 | 8 | export default function Login() { 9 | const { showAlert } = useContext(AlertContext); 10 | const { host } = useContext(NoteContext); 11 | const { mode } = useContext(BackContext); 12 | 13 | const navigate = useNavigate(); 14 | 15 | const [credentials, setcredentials] = useState({ 16 | email: "", 17 | password: "", 18 | }); 19 | 20 | const LoginFunc = async () => { 21 | const url = `/api/auth/login`; 22 | const response = await fetch(url, { 23 | method: "POST", 24 | headers: { 25 | "Content-Type": "application/json", 26 | }, 27 | body: JSON.stringify(credentials), 28 | }); 29 | const returnVal = await response.json(); 30 | return returnVal; 31 | }; 32 | 33 | const handleSubmit = async (e) => { 34 | e.preventDefault(); 35 | const json = await LoginFunc(); 36 | // console.log(json); 37 | if (json.success) { 38 | localStorage.setItem("token", json.authtoken); 39 | navigate("/"); 40 | showAlert("Succesfully Login", "primary"); 41 | } else { 42 | showAlert("Problem with Login", "warning"); 43 | } 44 | }; 45 | 46 | const valueChanged = (e) => { 47 | setcredentials({ ...credentials, [e.target.name]: e.target.value }); 48 | }; 49 | return ( 50 |
51 |

55 | Login 56 |

57 |
58 |
59 |
60 | 66 | 67 | 81 | 82 | 83 | We'll never share your email with anyone else. 84 | 85 |
86 |
87 | 93 | 94 | 107 |
108 |
109 | 112 | 118 | SignUp 119 | 120 |
121 |
122 |
123 | ); 124 | } 125 | -------------------------------------------------------------------------------- /frontend/src/App.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Alegreya&display=swap"); 2 | 3 | i, 4 | .noteItem { 5 | cursor: pointer; 6 | } 7 | 8 | .fontMain { 9 | font-family: "Alegreya", serif; 10 | } 11 | 12 | body { 13 | background-color: #eef2e4; 14 | } 15 | 16 | .i-color-wh { 17 | color: white; 18 | } 19 | 20 | /* */ 21 | 22 | @keyframes ldio-9u8gbddmqad { 23 | 0% { 24 | opacity: 1; 25 | } 26 | 100% { 27 | opacity: 0; 28 | } 29 | } 30 | .ldio-9u8gbddmqad div { 31 | left: 75.64999999999999px; 32 | top: 20.4px; 33 | position: absolute; 34 | animation: ldio-9u8gbddmqad linear 1.4492753623188404s infinite; 35 | background: #85a2b6; 36 | width: 18.7px; 37 | height: 47.6px; 38 | border-radius: 3.8080000000000003px / 3.8080000000000003px; 39 | transform-origin: 9.35px 64.6px; 40 | } 41 | .ldio-9u8gbddmqad div:nth-child(1) { 42 | transform: rotate(0deg); 43 | animation-delay: -1.3833992094861658s; 44 | background: #85a2b6; 45 | } 46 | .ldio-9u8gbddmqad div:nth-child(2) { 47 | transform: rotate(16.363636363636363deg); 48 | animation-delay: -1.3175230566534912s; 49 | background: #85a2b6; 50 | } 51 | .ldio-9u8gbddmqad div:nth-child(3) { 52 | transform: rotate(32.72727272727273deg); 53 | animation-delay: -1.2516469038208167s; 54 | background: #85a2b6; 55 | } 56 | .ldio-9u8gbddmqad div:nth-child(4) { 57 | transform: rotate(49.09090909090909deg); 58 | animation-delay: -1.185770750988142s; 59 | background: #85a2b6; 60 | } 61 | .ldio-9u8gbddmqad div:nth-child(5) { 62 | transform: rotate(65.45454545454545deg); 63 | animation-delay: -1.1198945981554675s; 64 | background: #85a2b6; 65 | } 66 | .ldio-9u8gbddmqad div:nth-child(6) { 67 | transform: rotate(81.81818181818181deg); 68 | animation-delay: -1.054018445322793s; 69 | background: #85a2b6; 70 | } 71 | .ldio-9u8gbddmqad div:nth-child(7) { 72 | transform: rotate(98.18181818181819deg); 73 | animation-delay: -0.9881422924901185s; 74 | background: #85a2b6; 75 | } 76 | .ldio-9u8gbddmqad div:nth-child(8) { 77 | transform: rotate(114.54545454545455deg); 78 | animation-delay: -0.9222661396574439s; 79 | background: #85a2b6; 80 | } 81 | .ldio-9u8gbddmqad div:nth-child(9) { 82 | transform: rotate(130.9090909090909deg); 83 | animation-delay: -0.8563899868247693s; 84 | background: #85a2b6; 85 | } 86 | .ldio-9u8gbddmqad div:nth-child(10) { 87 | transform: rotate(147.27272727272728deg); 88 | animation-delay: -0.7905138339920947s; 89 | background: #85a2b6; 90 | } 91 | .ldio-9u8gbddmqad div:nth-child(11) { 92 | transform: rotate(163.63636363636363deg); 93 | animation-delay: -0.7246376811594202s; 94 | background: #85a2b6; 95 | } 96 | .ldio-9u8gbddmqad div:nth-child(12) { 97 | transform: rotate(180deg); 98 | animation-delay: -0.6587615283267456s; 99 | background: #85a2b6; 100 | } 101 | .ldio-9u8gbddmqad div:nth-child(13) { 102 | transform: rotate(196.36363636363637deg); 103 | animation-delay: -0.592885375494071s; 104 | background: #85a2b6; 105 | } 106 | .ldio-9u8gbddmqad div:nth-child(14) { 107 | transform: rotate(212.72727272727272deg); 108 | animation-delay: -0.5270092226613965s; 109 | background: #85a2b6; 110 | } 111 | .ldio-9u8gbddmqad div:nth-child(15) { 112 | transform: rotate(229.0909090909091deg); 113 | animation-delay: -0.46113306982872193s; 114 | background: #85a2b6; 115 | } 116 | .ldio-9u8gbddmqad div:nth-child(16) { 117 | transform: rotate(245.45454545454547deg); 118 | animation-delay: -0.39525691699604737s; 119 | background: #85a2b6; 120 | } 121 | .ldio-9u8gbddmqad div:nth-child(17) { 122 | transform: rotate(261.8181818181818deg); 123 | animation-delay: -0.3293807641633728s; 124 | background: #85a2b6; 125 | } 126 | .ldio-9u8gbddmqad div:nth-child(18) { 127 | transform: rotate(278.1818181818182deg); 128 | animation-delay: -0.26350461133069825s; 129 | background: #85a2b6; 130 | } 131 | .ldio-9u8gbddmqad div:nth-child(19) { 132 | transform: rotate(294.54545454545456deg); 133 | animation-delay: -0.19762845849802368s; 134 | background: #85a2b6; 135 | } 136 | .ldio-9u8gbddmqad div:nth-child(20) { 137 | transform: rotate(310.90909090909093deg); 138 | animation-delay: -0.13175230566534912s; 139 | background: #85a2b6; 140 | } 141 | .ldio-9u8gbddmqad div:nth-child(21) { 142 | transform: rotate(327.27272727272725deg); 143 | animation-delay: -0.06587615283267456s; 144 | background: #85a2b6; 145 | } 146 | .ldio-9u8gbddmqad div:nth-child(22) { 147 | transform: rotate(343.6363636363636deg); 148 | animation-delay: 0s; 149 | background: #85a2b6; 150 | } 151 | .loadingio-spinner-spinner-d5vda8qm7j5 { 152 | width: 170px; 153 | height: 170px; 154 | display: inline-block; 155 | overflow: hidden; 156 | background: none; 157 | } 158 | .ldio-9u8gbddmqad { 159 | width: 100%; 160 | height: 100%; 161 | position: relative; 162 | transform: translateZ(0) scale(1); 163 | backface-visibility: hidden; 164 | transform-origin: 0 0; /* see note above */ 165 | } 166 | .ldio-9u8gbddmqad div { 167 | box-sizing: content-box; 168 | } 169 | -------------------------------------------------------------------------------- /frontend/src/Component/Navbar.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import { Link, useLocation, useNavigate } from "react-router-dom"; 3 | 4 | import { BackContext } from "../Context/notes/BackState"; 5 | import { NoteContext } from "../Context/notes/NoteState"; 6 | 7 | // Import Image 8 | import notebookDark from "./notebookDark.png"; 9 | import notebookLight from "./notebookLight.png"; 10 | 11 | export default function Navbar() { 12 | const { mode, ChangeMode, search, ChangeSearch } = useContext(BackContext); 13 | const { setnotes } = useContext(NoteContext); 14 | 15 | const location = useLocation(); 16 | const navigate = useNavigate(); 17 | 18 | const handleLogout = () => { 19 | localStorage.removeItem("token"); 20 | setnotes([]); 21 | navigate("/login"); 22 | }; 23 | 24 | const handleSearchChange = (e) => { 25 | ChangeSearch(e.target.value); 26 | }; 27 | 28 | return ( 29 |
30 | 149 |
150 | ); 151 | } 152 | -------------------------------------------------------------------------------- /frontend/src/Context/notes/NoteState.js: -------------------------------------------------------------------------------- 1 | import React, { createContext, useState } from "react"; 2 | 3 | // Init SpeechSynth API 4 | const synth = window.speechSynthesis; 5 | const voices = synth.getVoices(); 6 | 7 | // Createcontext 8 | const NoteContext = createContext(); 9 | 10 | let initialValues = [ 11 | { 12 | _id: "1", 13 | title: "", 14 | description: "", 15 | tag: "Genral", 16 | }, 17 | { 18 | _id: "2", 19 | title: "", 20 | description: "", 21 | tag: "Genral", 22 | }, 23 | { 24 | _id: "3", 25 | title: "", 26 | description: "", 27 | __v: 0, 28 | }, 29 | { 30 | _id: "4", 31 | title: "", 32 | description: "", 33 | __v: 0, 34 | }, 35 | ]; 36 | 37 | const host = ""; 38 | 39 | const NoteState = (props) => { 40 | const [notes, setnotes] = useState(initialValues); 41 | 42 | const fetchNotes = async () => { 43 | const authToken = localStorage.getItem("token"); 44 | const url = `/api/notes/fetchallnotes`; 45 | const response = await fetch(url, { 46 | method: "GET", 47 | headers: { 48 | "Content-Type": "application/json", 49 | "auth-token": authToken, 50 | }, 51 | }); 52 | const FetchedNotes = await response.json(); 53 | // Set the Notes 54 | setnotes(FetchedNotes); 55 | }; 56 | 57 | const [searchNote, setsearchNote] = useState(""); 58 | const SearchShareNote = async (id) => { 59 | const authToken = localStorage.getItem("token"); 60 | const url = `/api/notes/sharedNote/${id}`; 61 | const response = await fetch(url, { 62 | method: "GET", 63 | headers: { 64 | "Content-Type": "application/json", 65 | "auth-token": authToken, 66 | }, 67 | }); 68 | const FetchedShareNote = await response.json(); 69 | setsearchNote(FetchedShareNote); 70 | }; 71 | 72 | // Add Notes 73 | const AddNote = async (note) => { 74 | const authToken = localStorage.getItem("token"); 75 | // Call fetch api and update 76 | const url = `/api/notes/createnotes`; 77 | const response = await fetch(url, { 78 | method: "POST", 79 | headers: { 80 | "Content-Type": "application/json", 81 | "auth-token": authToken, 82 | }, 83 | body: JSON.stringify(note), 84 | }); 85 | const jsonRes = await response.json(); 86 | setnotes([...notes, jsonRes.saveNote]); 87 | return jsonRes; 88 | }; 89 | 90 | // Delete Note 91 | const DeleteNote = async (id) => { 92 | const authToken = localStorage.getItem("token"); 93 | const url = `/api/notes/deletenote/${id}`; 94 | const response = await fetch(url, { 95 | method: "DELETE", 96 | headers: { 97 | "Content-Type": "application/json", 98 | "auth-token": authToken, 99 | }, 100 | }); 101 | // eslint-disable-next-line 102 | const jsonRes = await response.json(); 103 | 104 | setnotes( 105 | notes.filter((note) => { 106 | return note._id !== id; 107 | }), 108 | ); 109 | }; 110 | 111 | const [playing, setplaying] = useState(false); 112 | const speak = (note) => { 113 | if (synth.speaking || note === null || note === "") { 114 | // console.error('Already speaking...'); 115 | synth.cancel(); 116 | return; 117 | } 118 | 119 | // Check if speaking 120 | const textInput = note.title + " " + note.description; 121 | 122 | if (textInput !== "") { 123 | const speakText = new SpeechSynthesisUtterance(textInput); 124 | speakText.onstart = (e) => { 125 | setplaying(true); 126 | }; 127 | speakText.onend = (e) => { 128 | // console.log('Done speaking...'); 129 | setplaying(false); 130 | }; 131 | speakText.onerror = (e) => { 132 | // console.error('Something went wrong'); 133 | setplaying(false); 134 | }; 135 | const selectedVoice = "Microsoft Zira Desktop - English (United States)"; 136 | voices.forEach((voice) => { 137 | if (voice.name === selectedVoice) { 138 | speakText.voice = voice; 139 | } 140 | }); 141 | speakText.rate = "1"; 142 | speakText.pitch = "1"; 143 | // Speak 144 | synth.speak(speakText); 145 | } 146 | }; 147 | 148 | const UpdateNote = async (id, note) => { 149 | const authToken = localStorage.getItem("token"); 150 | 151 | // Call fetch api and update 152 | const url = `/api/notes/updatenote/${id}`; 153 | const response = await fetch(url, { 154 | method: "PUT", 155 | headers: { 156 | "Content-Type": "application/json", 157 | "auth-token": authToken, 158 | }, 159 | body: JSON.stringify(note), 160 | }); 161 | // eslint-disable-next-line 162 | const jsonRes = await response.json(); 163 | // search for note with id and Update 164 | let newNotes = JSON.parse(JSON.stringify(notes)); 165 | for (let index = 0; index < notes.length; index++) { 166 | if (newNotes[index]._id === id) { 167 | newNotes[index].title = note.title; 168 | newNotes[index].description = note.description; 169 | newNotes[index].tag = note.tag; 170 | newNotes[index].share = note.share; 171 | setnotes(newNotes); 172 | break; 173 | } 174 | } 175 | }; 176 | return ( 177 | 192 | {props.children} 193 | 194 | ); 195 | }; 196 | 197 | export default NoteState; 198 | export { NoteContext }; 199 | -------------------------------------------------------------------------------- /routes/notes.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | 4 | // Import Schema 5 | const Notes = require("../models/Notes"); 6 | 7 | // Express Validation 8 | const { body, validationResult } = require("express-validator"); 9 | 10 | // Import middleware fetchUserDetails to fetch user from JWT token 11 | const fetchUserDetails = require("../middleware/fetchUserDetails"); 12 | 13 | // Recieve app.use route request 14 | // Send all notes from specific user get request : /fetchallnotes 15 | router.get("/fetchallnotes", fetchUserDetails, async (req, res) => { 16 | try { 17 | const userID = req.user.id; 18 | const notes = await Notes.find({ user: userID }); 19 | +( 20 | // Send all notes to server 21 | res.send(notes) 22 | ); 23 | } catch (error) { 24 | // Run if any error occurs in last 25 | res.status(500).send("Internal Server try after some time2"); 26 | console.error(error.message); 27 | } 28 | }); 29 | 30 | //create notes : /createnotes 31 | router.post( 32 | "/createnotes", 33 | fetchUserDetails, 34 | [ 35 | // Verify the validation 36 | body("title", "Enter minimum 3 character in Title").isLength({ min: 3 }), 37 | body( 38 | "description", 39 | "Minimum 10 characters neccessary in Description", 40 | ).isLength({ min: 10 }), 41 | ], 42 | async (req, res) => { 43 | // console.log(req.body); 44 | let success = false; 45 | const errors = validationResult(req); 46 | if (!errors.isEmpty()) { 47 | // check error after validation 48 | success = false; 49 | return res.status(400).json({ success, errors: errors.array() }); 50 | } 51 | 52 | try { 53 | const userID = req.user.id; 54 | const { title, description } = req.body; 55 | let { tag } = req.body; 56 | if (tag === "" || tag === " ") { 57 | tag = "General"; 58 | } 59 | let notes = new Notes({ title, description, tag, user: userID }); 60 | let saveNote = await notes.save(); 61 | success = true; 62 | return res.json({ success, saveNote }); 63 | } catch (error) { 64 | // Run if any error occurs in last 65 | success = false; 66 | return res 67 | .status(500) 68 | .json({ success, error: "Internal Server try after some time2" }); 69 | // console.error(error.message); 70 | } 71 | }, 72 | ); 73 | 74 | // Update Notes endpoint : /updatenote 75 | 76 | router.put("/updatenote/:id", fetchUserDetails, async (req, res) => { 77 | try { 78 | const RecNoteId = req.params.id; // Parameter is note id sent by client 79 | let note = await Notes.findById(RecNoteId); // Check the note in database by id 80 | if (!note) { 81 | return res.status(404).send("Note not Found"); 82 | } // Check note existence 83 | 84 | const NoteUser = note.user.toString(); // change user object to string 85 | const ReqFromUser = req.user.id; 86 | 87 | if (NoteUser !== ReqFromUser) { 88 | return res.status(401).send("UnAuthorished Access"); 89 | } // Check the owner of note is real 90 | 91 | let { title, description, share, tag } = req.body; 92 | const updateDetails = {}; 93 | 94 | if (title) { 95 | updateDetails.title = title; 96 | } 97 | if (description) { 98 | updateDetails.description = description; 99 | } 100 | if (tag) { 101 | updateDetails.tag = tag; 102 | } 103 | updateDetails.share = share; 104 | // console.log(updateDetails); 105 | // Update the note using Notes Schema 106 | UpdateNote1 = await Notes.findByIdAndUpdate( 107 | RecNoteId, 108 | { $set: updateDetails }, 109 | { new: true }, 110 | ); 111 | return res.json({ UpdateNote1 }); 112 | } catch (error) { 113 | // Run if any error occurs in last 114 | return res.status(500).send("Internal Server try after some time2"); 115 | console.error(error.message); 116 | } 117 | }); 118 | 119 | // Delete a note using DELETE reqest login required: /deletenote/:id 120 | router.delete("/deletenote/:id", fetchUserDetails, async (req, res) => { 121 | try { 122 | const RecNoteId = req.params.id; // Parameter is note id sent by client 123 | let note = await Notes.findById(RecNoteId); // Check the note in database by id 124 | if (!note) { 125 | return res.status(404).send("Note not Found"); 126 | } // Check note existence 127 | 128 | const NoteUser = note.user.toString(); // change user object to string 129 | const ReqFromUser = req.user.id; 130 | if (NoteUser !== ReqFromUser) { 131 | return res.status(401).send("UnAuthorished Access"); 132 | } // Check the owner of note is real 133 | // res.send("Details verified"); 134 | 135 | delNote = await Notes.findByIdAndDelete(RecNoteId); 136 | return res.json({ Delete: "Note HAs Been Deleted" }); 137 | } catch (error) { 138 | // Run if any error occurs in last 139 | return res.status(500).send("Internal Server try after some time2"); 140 | console.error(error.message); 141 | } 142 | }); 143 | 144 | router.get("/sharedNote/:id", async (req, res) => { 145 | try { 146 | const noteId = req.params.id; 147 | const thisNote = await Notes.findById(noteId, async (err, note) => { 148 | if (err || note.share === false) { 149 | return res.json({ success: "false", error: "Note Not Found" }); 150 | } 151 | const mynote = await note.populate({ 152 | path: "user", 153 | model: "user", 154 | select: { _id: 0, name: 1, username: 1 }, 155 | }); 156 | return res.json({ success: "true", mynote }); 157 | }); 158 | return res.status(500).json({ success: "false" }); 159 | } catch (error) { 160 | console.error(error.message); 161 | } 162 | }); 163 | 164 | module.exports = router; 165 | -------------------------------------------------------------------------------- /routes/auth.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | 4 | // Import Schema 5 | const User = require("../models/User"); 6 | 7 | // Express Validation 8 | const { body, validationResult } = require("express-validator"); 9 | 10 | // import bcrypt for Encyption in passwords 11 | const bcrypt = require("bcryptjs"); 12 | 13 | // Use JWT - Json Web Token to Authenticate the User 14 | const jwt = require("jsonwebtoken"); 15 | // -- we send 2 parts key and data 16 | const JWT_key = process.env.JWT_TOKEN; // Store in the form og gitpod variable 17 | // JWT_TOKEN 18 | 19 | // Import middleware of getuser that extract info from JWT 20 | const fetchUser = require("../middleware/fetchUserDetails"); 21 | 22 | // Recieve app.use route request 23 | // Route 1 : user post metheod /api/auth/createuser 24 | router.post( 25 | "/createuser", 26 | [ 27 | // Verify the validation 28 | body("name", "Enter minimum 3 character in Name").isLength({ min: 3 }), 29 | body("username", "Username is minimum 6 digit").isLength({ min: 6 }), 30 | body( 31 | "email", 32 | "Wrong Email Pattern , Enter a valid Email Address", 33 | ).isEmail(), 34 | body("password", "Minimum password length is 6").isLength({ min: 6 }), 35 | ], 36 | async (req, res) => { 37 | // console.log("try to create the user"); 38 | const errors = validationResult(req); 39 | let success = false; 40 | if (!errors.isEmpty()) { 41 | // check error after validation 42 | success = false; 43 | return res.status(400).json({ success, errors: errors.array() }); 44 | } 45 | 46 | try { 47 | // Verifying email and username not present in db 48 | let userE = await User.findOne({ email: req.body.email }); 49 | let userU = await User.findOne({ username: req.body.username }); 50 | if (userE) { 51 | success = false; 52 | return res.status(400).json({ 53 | success, 54 | error: "User with samee email id already Registered", 55 | }); 56 | } 57 | if (userU) { 58 | success = false; 59 | return res.status(400).json({ 60 | success, 61 | error: "User with samee username already Registered", 62 | }); 63 | } 64 | 65 | // Create secure hhassed password from password 66 | // --- genrate salt 67 | var salt = await bcrypt.genSaltSync(10); 68 | var secPass = await bcrypt.hashSync(req.body.password, salt); // hash password 69 | 70 | //Creating the user 71 | let user = await User.create({ 72 | name: req.body.name, 73 | username: req.body.username, 74 | email: req.body.email, 75 | password: secPass, 76 | }); 77 | 78 | // Send back username and email if user were created 79 | // res.json({ 80 | // info: "User Created Successfully", 81 | // USER: { 82 | 83 | // username: user.username, 84 | // email: user.email 85 | // } 86 | // }); 87 | /* Place of sendin user details we send jwt */ 88 | // Sign token 89 | const data = { 90 | user: { 91 | id: user.id, 92 | }, 93 | }; 94 | let authtoken = jwt.sign(data, JWT_key); 95 | success = true; 96 | res.json({ success, authtoken }); 97 | 98 | // console.log(req.body); 99 | } catch (err) { 100 | // Run if any error occurs in last 101 | success = false; 102 | res 103 | .status(500) 104 | .json({ success, error: "Internal Server try after some time" }); 105 | console.error(err.message); 106 | } 107 | }, 108 | ); 109 | 110 | // Route 2 : Authenticate a User : Login 111 | router.post( 112 | "/login", 113 | [ 114 | body( 115 | "email", 116 | "Wrong Email Pattern , Enter a valid Email Address", 117 | ).isEmail(), 118 | ], 119 | async (req, res) => { 120 | // if Email is Wrong then make the error request 121 | let success = false; 122 | 123 | const errors = validationResult(req); 124 | if (!errors.isEmpty()) { 125 | success = false; 126 | return res.status(400).json({ success, errors: errors.array() }); 127 | } 128 | const { email, password } = req.body; 129 | try { 130 | let user = await User.findOne({ email }); 131 | if (!user) { 132 | // If user not exists it send Bad request 400 133 | success = false; 134 | return res.status(400).json({ 135 | success, 136 | error: "Please try to login with Correct Credentials", 137 | }); 138 | } 139 | // Check the password 140 | const passwordCompare = await bcrypt.compare(password, user.password); 141 | 142 | /* 143 | console.log(user.password) 144 | console.log(password); 145 | console.log(passwordCompare); 146 | */ 147 | 148 | if (!passwordCompare) { 149 | // If password wrong send Bad request 400 150 | success = false; 151 | return res.status(400).json({ 152 | success, 153 | error: "Please try to login with Correct Credentials", 154 | }); 155 | } 156 | 157 | /* Sending jwt token */ 158 | // Sign token 159 | const data = { 160 | user: { 161 | id: user.id, 162 | }, 163 | }; 164 | let authtoken = jwt.sign(data, JWT_key); 165 | success = true; 166 | res.json({ success, authtoken }); 167 | } catch (err) { 168 | // Run if any error occurs in last 169 | success = false; 170 | res.status(500).send({ success, error: "Internal Server Error" }); 171 | console.error(err.message); 172 | } 173 | }, 174 | ); 175 | 176 | // Route 3 : Post metheod /getUser : Get user details 177 | router.post("/getuser", fetchUser, async (req, res) => { 178 | console.log(req.user.id); // Id of User 179 | try { 180 | const userID = req.user.id; 181 | const userDetails = await User.findById(userID).select("-password"); 182 | res.send(userDetails); 183 | } catch (err) { 184 | // Run if any error occurs in last 185 | res.status(500).send("Internal Server try after some time2"); 186 | console.error(err.message); 187 | } 188 | }); 189 | 190 | router.put("/checkusername/:username", async (req, res) => { 191 | try { 192 | let user = await User.findOne({ username: req.params.username }); 193 | if (user) { 194 | return res.json({ res: true }); 195 | } else { 196 | return res.json({ res: false }); 197 | } 198 | } catch (e) { 199 | res.status(500).send("Problem to checking in username"); 200 | } 201 | }); 202 | 203 | module.exports = router; 204 | -------------------------------------------------------------------------------- /frontend/src/Component/EditNote.js: -------------------------------------------------------------------------------- 1 | import React, { useContext, useRef } from "react"; 2 | import { Link } from "react-router-dom"; 3 | 4 | import { NoteContext } from "../Context/notes/NoteState"; 5 | import { BackContext } from "../Context/notes/BackState"; 6 | import { AlertContext } from "../Context/notes/AlertState"; 7 | 8 | import Alert from "./Alert"; 9 | 10 | export default function EditNote(props) { 11 | const { showAlert } = useContext(AlertContext); 12 | 13 | const { UpdateNote, playing, speak } = useContext(NoteContext); 14 | const { mode } = useContext(BackContext); 15 | const { note, setnote } = props; 16 | 17 | const refClose = useRef(null); 18 | 19 | const NoteEditing = (e) => { 20 | setnote({ ...note, [e.target.name]: e.target.value }); 21 | }; 22 | 23 | const download = () => { 24 | let ele = document.createElement("a"); 25 | const txt = `${note.title}\n\n${note.description}\n\n\n${note.tag}\n\n${note.date}`; 26 | ele.setAttribute( 27 | "href", 28 | "data:text/plain;charset=utf-8," + encodeURIComponent(txt), 29 | ); 30 | ele.setAttribute("download", `${note.title}.txt`); 31 | ele.style.display = "none"; 32 | document.body.appendChild(ele); 33 | ele.click(); 34 | document.body.removeChild(ele); 35 | }; 36 | 37 | const ChangeShare = () => { 38 | if (note.share === true) { 39 | setnote({ ...note, share: false }); 40 | showAlert("Note Private, Kindly Save the Changes", "primary"); 41 | } else { 42 | setnote({ ...note, share: true }); 43 | showAlert("Note Public, Kindly Save the Changes", "warning"); 44 | } 45 | }; 46 | 47 | const CopyToClipBoard = () => { 48 | const noteUrl = `${window.location.origin}/note/${note._id}`; 49 | navigator.clipboard.writeText(noteUrl); 50 | showAlert("Link Copied", "primary"); 51 | }; 52 | 53 | return ( 54 |
55 | 236 |
237 | ); 238 | } 239 | -------------------------------------------------------------------------------- /frontend/src/Component/SignUp.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useContext } from "react"; 2 | import { useNavigate, Link } from "react-router-dom"; 3 | 4 | import { AlertContext } from "../Context/notes/AlertState"; 5 | import { NoteContext } from "../Context/notes/NoteState"; 6 | import { BackContext } from "../Context/notes/BackState"; 7 | 8 | export default function SignUp() { 9 | const { showAlert } = useContext(AlertContext); 10 | const { mode } = useContext(BackContext); 11 | 12 | const navigate = useNavigate(); 13 | const { host } = useContext(NoteContext); 14 | 15 | const [state, setstate] = useState(false); 16 | const [SignUpInfo, setSignUpInfo] = useState({ 17 | fname: "", 18 | lname: "", 19 | username: "", 20 | email: "", 21 | password: "", 22 | cpassword: "", 23 | }); 24 | 25 | const runthis = async () => { 26 | const username = SignUpInfo.username; 27 | const url = `/api/auth/checkUsername/${username}`; 28 | 29 | if (username.length >= 6) { 30 | const response = await fetch(url, { 31 | method: "PUT", 32 | headers: { 33 | "Content-Type": "application/json", 34 | }, 35 | }); 36 | const jsonRes = await response.json(); 37 | if (jsonRes.res === true) { 38 | setstate(true); 39 | } else if (jsonRes.res === false) { 40 | setstate(false); 41 | } 42 | } 43 | }; 44 | 45 | const ValueChanged = (e) => { 46 | setSignUpInfo({ ...SignUpInfo, [e.target.name]: e.target.value }); 47 | // console.log(SignUpInfo); 48 | }; 49 | 50 | const SignUpToAccount = async (e) => { 51 | e.preventDefault(); 52 | // console.log(SignUpInfo); 53 | const value = { 54 | name: `${SignUpInfo.fname + " " + SignUpInfo.lname}`, 55 | username: SignUpInfo.username, 56 | email: SignUpInfo.email, 57 | password: SignUpInfo.password, 58 | }; 59 | // console.log(value); 60 | const url = `/api/auth/createuser`; 61 | const response = await fetch(url, { 62 | method: "POST", 63 | headers: { 64 | "Content-Type": "application/json", 65 | }, 66 | body: JSON.stringify(value), 67 | }); 68 | // eslint-disable-next-line 69 | const json = await response.json(); 70 | if (json.success) { 71 | localStorage.setItem("token", json.authtoken); 72 | navigate("/"); 73 | showAlert("Succesfully SignUp", "primary"); 74 | } else { 75 | showAlert("Error in Sign Up", "warning"); 76 | } 77 | }; 78 | 79 | return ( 80 | <> 81 |

85 | SignUp 86 |

87 |
88 |
89 |
90 |
91 |
92 | 98 | 111 |
112 |
113 | 119 | 132 |
133 |
134 | 135 |
136 |
137 | 143 | 158 |
159 |
160 | 166 | 184 | 188 | Username Not Available 189 | 190 |
191 |
192 | 193 |
194 |
195 | 201 | 214 |
215 |
216 | 222 | 239 |
240 |
241 | 246 | 267 |
268 |
269 |
270 | 277 | 283 | Login 284 | 285 |
286 |
287 |
288 | 289 | ); 290 | } 291 | -------------------------------------------------------------------------------- /frontend/src/Component/PrivacyPolicy.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import Parser from "html-react-parser"; 3 | 4 | import { BackContext } from "../Context/notes/BackState"; 5 | 6 | const rawhtml = ` 7 |

Privacy Policy

8 |

Last updated: November 24, 2021

9 |

This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information 10 | when You use the Service and tells You about Your privacy rights and how the law protects You.

11 |

We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and 12 | use of information in accordance with this Privacy Policy. 13 |

Interpretation and Definitions

14 |

Interpretation

15 |

The words of which the initial letter is capitalized have meanings defined under the following conditions. The 16 | following definitions shall have the same meaning regardless of whether they appear in singular or in plural.

17 |

Definitions

18 |

For the purposes of this Privacy Policy:

19 | 65 |

Collecting and Using Your Personal Data

66 |

Types of Data Collected

67 |

Personal Data

68 |

While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be 69 | used to contact or identify You. Personally identifiable information may include, but is not limited to:

70 | 84 |

Usage Data

85 |

Usage Data is collected automatically when using the Service.

86 |

Usage Data may include information such as Your Device's Internet Protocol address (e.g. IP address), browser type, 87 | browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those 88 | pages, unique device identifiers and other diagnostic data.

89 |

When You access the Service by or through a mobile device, We may collect certain information automatically, 90 | including, but not limited to, the type of mobile device You use, Your mobile device unique ID, the IP address of 91 | Your mobile device, Your mobile operating system, the type of mobile Internet browser You use, unique device 92 | identifiers and other diagnostic data.

93 |

We may also collect information that Your browser sends whenever You visit our Service or when You access the Service 94 | by or through a mobile device.

95 |

Tracking Technologies and Cookies

96 |

We use Cookies and similar tracking technologies to track the activity on Our Service and store certain information. 97 | Tracking technologies used are beacons, tags, and scripts to collect and track information and to improve and 98 | analyze Our Service. The technologies We use may include:

99 | 116 |

Cookies can be "Persistent" or "Session" Cookies. Persistent Cookies remain on Your personal 117 | computer or mobile device when You go offline, while Session Cookies are deleted as soon as You close Your web 118 | browser. 119 |

We use both Session and Persistent Cookies for the purposes set out below:

120 | 145 |

For more information about the cookies we use and your choices regarding cookies, please visit our Cookies Policy or 146 | the Cookies section of our Privacy Policy.

147 |

Use of Your Personal Data

148 |

The Company may use Personal Data for the following purposes:

149 | 189 |

We may share Your personal information in the following situations:

190 | 207 |

Retention of Your Personal Data

208 |

The Company will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy 209 | Policy. We will retain and use Your Personal Data to the extent necessary to comply with our legal obligations (for 210 | example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our 211 | legal agreements and policies.

212 |

The Company will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a 213 | shorter period of time, except when this data is used to strengthen the security or to improve the functionality of 214 | Our Service, or We are legally obligated to retain this data for longer time periods.

215 |

Transfer of Your Personal Data

216 |

Your information, including Personal Data, is processed at the Company's operating offices and in any other places 217 | where the parties involved in the processing are located. It means that this information may be transferred to — and 218 | maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where 219 | the data protection laws may differ than those from Your jurisdiction.

220 |

Your consent to this Privacy Policy followed by Your submission of such information represents Your agreement to that 221 | transfer.

222 |

The Company will take all steps reasonably necessary to ensure that Your data is treated securely and in accordance 223 | with this Privacy Policy and no transfer of Your Personal Data will take place to an organization or a country 224 | unless there are adequate controls in place including the security of Your data and other personal information.

225 |

Disclosure of Your Personal Data

226 |

Business Transactions

227 |

If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will 228 | provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy.

229 |

Law enforcement

230 |

Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law 231 | or in response to valid requests by public authorities (e.g. a court or a government agency).

232 |

Other legal requirements

233 |

The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:

234 | 241 |

Security of Your Personal Data

242 |

The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, 243 | or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your 244 | Personal Data, We cannot guarantee its absolute security.

245 |

Children's Privacy

246 |

Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable 247 | information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has 248 | provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from 249 | anyone under the age of 13 without verification of parental consent, We take steps to remove that information from 250 | Our servers.

251 |

If We need to rely on consent as a legal basis for processing Your information and Your country requires consent from 252 | a parent, We may require Your parent's consent before We collect and use that information.

253 |

Links to Other Websites

254 |

Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You 255 | will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You 256 | visit.

257 |

We have no control over and assume no responsibility for the content, privacy policies or practices of any third 258 | party sites or services.

259 |

Changes to this Privacy Policy

260 |

We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy 261 | Policy on this page.

262 |

We will let You know via email and/or a prominent notice on Our Service, prior to the change becoming effective and 263 | update the "Last updated" date at the top of this Privacy Policy.

264 |

You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are 265 | effective when they are posted on this page.

266 |

Contact Us

267 |

If you have any questions about this Privacy Policy, You can contact us:

268 | 277 | `; 278 | 279 | export default function PrivacyPolicy() { 280 | const { mode } = useContext(BackContext); 281 | return ( 282 |
283 | {Parser(rawhtml)} 284 |
285 | ); 286 | } 287 | -------------------------------------------------------------------------------- /frontend/src/Component/TermsCondition.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import Parser from "html-react-parser"; 3 | 4 | import { BackContext } from "../Context/notes/BackState"; 5 | 6 | const rawhtml = ` 7 |

TERMS OF SERVICES

8 |
PLEASE READ THIS TERMS OF SERVICE AGREEMENT CAREFULLY, AS IT CONTAINS IMPORTANT 9 | INFORMATION REGARDING YOUR LEGAL RIGHTS AND REMEDIES.
10 |
Last Revised: 2021-11-24 07:19:34
11 |
12 |

1. OVERVIEW

13 |
This Terms of Service Agreement ("Agreement") is entered into by and between 14 | Prenotebook, registered address UttarPradesh, India ("Company") and you, and is made effective as of 15 | the date of your use of this website https://prenotebook.ml/ ("Site") or the date of electronic 16 | acceptance.
17 |
This Agreement sets forth the general terms and conditions of your use of the 18 | https://prenotebook.ml/ as well as the products and/or services purchased or accessed through this Site (the 19 | "Services").Whether you are simply browsing or using this Site or purchase Services, your use of this 20 | Site and your electronic acceptance of this Agreement signifies that you have read, understand, acknowledge and 21 | agree to be bound by this Agreement our Privacy policy. The terms "we", "us" or "our" shall refer 23 | to Company. The terms "you", "your", "User" or "customer" shall refer to 24 | any individual or entity who accepts this Agreement, uses our Site, has access or uses the Services. Nothing in 25 | this Agreement shall be deemed to confer any third-party rights or benefits.
26 |
Company may, in its sole and absolute discretion, change or modify this Agreement, and 27 | any policies or agreements which are incorporated herein, at any time, and such changes or modifications shall 28 | be effective immediately upon posting to this Site. Your use of this Site or the Services after such changes or 29 | modifications have been made shall constitute your acceptance of this Agreement as last revised.
30 |
IF YOU DO NOT AGREE TO BE BOUND BY THIS AGREEMENT AS LAST REVISED, DO NOT USE (OR 31 | CONTINUE TO USE) THIS SITE OR THE SERVICES.
32 |
33 |
34 |

2. ELIGIBILITY

35 |
This Site and the Services are available only to Users who can form legally binding 36 | contracts under applicable law. By using this Site or the Services, you represent and warrant that you are (i) 37 | at least eighteen (18) years of age, (ii) otherwise recognized as being able to form legally binding contracts 38 | under applicable law, and (iii) are not a person barred from purchasing or receiving the Services found under 39 | the laws of the India or other applicable jurisdiction.
40 |
If you are entering into this Agreement on behalf of a company or any corporate entity, 41 | you represent and warrant that you have the legal authority to bind such corporate entity to the terms and 42 | conditions contained in this Agreement, in which case the terms "you", "your", 43 | "User" or "customer" shall refer to such corporate entity. If, after your electronic 44 | acceptance of this Agreement, Company finds that you do not have the legal authority to bind such corporate 45 | entity, you will be personally responsible for the obligations contained in this Agreement.
46 |
47 |
48 |

3. RULES OF USER CONDUCT

49 |
By using this Site You acknowledge and agree that:
50 |
    51 |
  • Your use of this Site, including any content you submit, will comply with this Agreement and all applicable 52 | local, state, national and international laws, rules and regulations.
  • 53 |
54 |
You will not use this Site in a manner that:
55 |
    56 |
  • Is illegal, or promotes or encourages illegal activity;
  • 57 |
  • Promotes, encourages or engages in child pornography or the exploitation of children;
  • 58 |
  • Promotes, encourages or engages in terrorism, violence against people, animals, or property;
  • 59 |
  • Promotes, encourages or engages in any spam or other unsolicited bulk email, or computer or network hacking 60 | or cracking;
  • 61 |
  • Infringes on the intellectual property rights of another User or any other person or entity;
  • 62 |
  • Violates the privacy or publicity rights of another User or any other person or entity, or breaches any duty 63 | of confidentiality that you owe to another User or any other person or entity;
  • 64 |
  • Interferes with the operation of this Site;
  • 65 |
  • Contains or installs any viruses, worms, bugs, Trojan horses, Cryptocurrency Miners or other code, files or 66 | programs designed to, or capable of, using many resources, disrupting, damaging, or limiting the 67 | functionality of any software or hardware.
  • 68 |
69 |
You will not:
70 |
    71 |
  • copy or distribute in any medium any part of this Site, except where expressly authorized by Company,
  • 72 |
  • copy or duplicate this Terms of Services agreement, which was created with the help of the TermsHub.io,
  • 76 |
  • modify or alter any part of this Site or any of its related technologies,
  • 77 |
  • access Companies Content (as defined below) or User Content through any technology or means other than 78 | through this Site itself.
  • 79 |
80 |
81 |
82 |

4. INTELLECTUAL PROPERTY

83 |
In addition to the general rules above, the provisions in this Section apply 84 | specifically to your use of Companies Content posted to Site. Companies Content on this Site, including without 85 | limitation the text, software, scripts, source code, API, graphics, photos, sounds, music, videos and 86 | interactive features and the trademarks, service marks and logos contained therein ("Companies 87 | Content"), are owned by or licensed to Prenotebook in perpetuity, and are subject to copyright, trademark, 88 | and/or patent protection.
89 |
Companies Content is provided to you "as is", "as available" and 90 | "with all faults" for your information and personal, non-commercial use only and may not be 91 | downloaded, copied, reproduced, distributed, transmitted, broadcast, displayed, sold, licensed, or otherwise 92 | exploited for any purposes whatsoever without the express prior written consent of Company. No right or license 93 | under any copyright, trademark, patent, or other proprietary right or license is granted by this Agreement. 94 |
95 |
96 |
97 |

5. DISCLAIMER OF REPRESENTATIONS AND WARRANTIES 98 |

99 |
YOU SPECIFICALLY ACKNOWLEDGE AND AGREE THAT YOUR USE OF THIS SITE SHALL BE AT YOUR OWN 100 | RISK AND THAT THIS SITE ARE PROVIDED "AS IS", "AS AVAILABLE" AND "WITH ALL 101 | FAULTS". COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, AGENTS, DISCLAIM ALL WARRANTIES, STATUTORY, EXPRESS 102 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A 103 | PARTICULAR PURPOSE AND NON-INFRINGEMENT. COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, AND AGENTS MAKE NO 104 | REPRESENTATIONS OR WARRANTIES ABOUT (I) THE ACCURACY, COMPLETENESS, OR CONTENT OF THIS SITE, (II) THE ACCURACY, 105 | COMPLETENESS, OR CONTENT OF ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, 106 | AND/OR (III) THE SERVICES FOUND AT THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR 107 | OTHERWISE) TO THIS SITE, AND COMPANY ASSUMES NO LIABILITY OR RESPONSIBILITY FOR THE SAME.
108 |
IN ADDITION, YOU SPECIFICALLY ACKNOWLEDGE AND AGREE THAT NO ORAL OR WRITTEN INFORMATION 109 | OR ADVICE PROVIDED BY COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, OR AGENTS, AND THIRD-PARTY SERVICE PROVIDERS 110 | WILL (I) CONSTITUTE LEGAL OR FINANCIAL ADVICE OR (II) CREATE A WARRANTY OF ANY KIND WITH RESPECT TO THIS SITE OR 111 | THE SERVICES FOUND AT THIS SITE, AND USERS SHOULD NOT RELY ON ANY SUCH INFORMATION OR ADVICE.
112 |
THE FOREGOING DISCLAIMER OF REPRESENTATIONS AND WARRANTIES SHALL APPLY TO THE FULLEST 113 | EXTENT PERMITTED BY LAW, and shall survive any termination or expiration of this Agreement or your use of this 114 | Site or the Services found at this Site.
115 |
116 |
117 |

6. LIMITATION OF LIABILITY

118 |
IN NO EVENT SHALL COMPANY, ITS OFFICERS, DIRECTORS, EMPLOYEES, AGENTS, AND ALL THIRD 119 | PARTY SERVICE PROVIDERS, BE LIABLE TO YOU OR ANY OTHER PERSON OR ENTITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, 120 | SPECIAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING ANY DAMAGES THAT MAY RESULT FROM (I) THE 121 | ACCURACY, COMPLETENESS, OR CONTENT OF THIS SITE, (II) THE ACCURACY, COMPLETENESS, OR CONTENT OF ANY SITES LINKED 122 | (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, (III) THE SERVICES FOUND AT THIS SITE OR ANY 123 | SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO THIS SITE, (IV) PERSONAL INJURY OR 124 | PROPERTY DAMAGE OF ANY NATURE WHATSOEVER, (V) THIRD-PARTY CONDUCT OF ANY NATURE WHATSOEVER, (VI) ANY 125 | INTERRUPTION OR CESSATION OF SERVICES TO OR FROM THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER 126 | ADVERTISING OR OTHERWISE) TO THIS SITE, (VII) ANY VIRUSES, WORMS, BUGS, TROJAN HORSES, OR THE LIKE, WHICH MAY BE 127 | TRANSMITTED TO OR FROM THIS SITE OR ANY SITES LINKED (THROUGH HYPERLINKS, BANNER ADVERTISING OR OTHERWISE) TO 128 | THIS SITE, (VIII) ANY USER CONTENT OR CONTENT THAT IS DEFAMATORY, HARASSING, ABUSIVE, HARMFUL TO MINORS OR ANY 129 | PROTECTED CLASS, PORNOGRAPHIC, "X-RATED", OBSCENE OR OTHERWISE OBJECTIONABLE, AND/OR (IX) ANY LOSS OR 130 | DAMAGE OF ANY KIND INCURRED AS A RESULT OF YOUR USE OF THIS SITE OR THE SERVICES FOUND AT THIS SITE, WHETHER 131 | BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL OR EQUITABLE THEORY, AND WHETHER OR NOT COMPANY IS ADVISED 132 | OF THE POSSIBILITY OF SUCH DAMAGES.
133 |
IN ADDITION, You SPECIFICALLY ACKNOWLEDGE AND agree that any cause of action arising 134 | out of or related to this Site or the Services found at this Site must be commenced within one (1) year after 135 | the cause of action accrues, otherwise such cause of action shall be permanently barred.
136 |
THE FOREGOING LIMITATION OF LIABILITY SHALL APPLY TO THE FULLEST EXTENT PERMITTED BY 137 | LAW, AND shall survive any termination or expiration of this Agreement or your use of this Site or the Services 138 | found at this Site.
139 |
140 |
141 |

7. INDEMNITY

142 |
You agree to protect, defend, indemnify and hold harmless Company and its officers, 143 | directors, employees, agents from and against any and all claims, demands, costs, expenses, losses, liabilities 144 | and damages of every kind and nature (including, without limitation, reasonable attorneys’ fees) imposed upon or 145 | incurred by Company directly or indirectly arising from (i) your use of and access to this Site; (ii) your 146 | violation of any provision of this Agreement or the policies or agreements which are incorporated herein; and/or 147 | (iii) your violation of any third-party right, including without limitation any intellectual property or other 148 | proprietary right. The indemnification obligations under this section shall survive any termination or 149 | expiration of this Agreement or your use of this Site or the Services found at this Site.
150 |
151 |
152 |

8. DATA TRANSFER

153 |
If you are visiting this Site from a country other than the country in which our 154 | servers are located, your communications with us may result in the transfer of information across international 155 | boundaries. By visiting this Site and communicating electronically with us, you consent to such transfers.
156 |
157 |
158 |

9. AVAILABILITY OF WEBSITE

159 |
Subject to the terms and conditions of this Agreement and our policies, we shall use 160 | commercially reasonable efforts to attempt to provide this Site on 24/7 basis. You acknowledge and agree that 161 | from time to time this Site may be inaccessible for any reason including, but not limited to, periodic 162 | maintenance, repairs or replacements that we undertake from time to time, or other causes beyond our control 163 | including, but not limited to, interruption or failure of telecommunication or digital transmission links or 164 | other failures.
165 |
You acknowledge and agree that we have no control over the availability of this Site on 166 | a continuous or uninterrupted basis, and that we assume no liability to you or any other party with regard 167 | thereto.
168 |
169 |
170 |

10. DISCONTINUED SERVICES

171 |
Company reserves the right to cease offering or providing any of the Services at any 172 | time, for any or no reason, and without prior notice. Although Company makes great effort to maximize the 173 | lifespan of all its Services, there are times when a Service we offer will be discontinued. If that is the case, 174 | that product or service will no longer be supported by Company. In such case, Company will either offer a 175 | comparable Service for you to migrate to or a refund. Company will not be liable to you or any third party for 176 | any modification, suspension, or discontinuance of any of the Services we may offer or facilitate access to. 177 |
178 |
179 |
180 |

11. NO THIRD-PARTY BENEFICIARIES

181 |
Nothing in this Agreement shall be deemed to confer any third-party rights or benefits. 182 |
183 |
184 |
185 |

12. COMPLIANCE WITH LOCAL LAWS

186 |
Company makes no representation or warranty that the content available on this Site are 187 | appropriate in every country or jurisdiction, and access to this Site from countries or jurisdictions where its 188 | content is illegal is prohibited. Users who choose to access this Site are responsible for compliance with all 189 | local laws, rules and regulations.
190 |
191 |
192 |

13. GOVERNING LAW

193 |
This Agreement and any dispute or claim arising out of or in connection with it or its 194 | subject matter or formation shall be governed by and construed in accordance with the laws of India, Uttar 195 | Pradesh, to the exclusion of conflict of law rules.
196 |
197 |
198 |

14. DISPUTE RESOLUTION

199 |
Any controversy or claim arising out of or relating to these Terms of Services will be 200 | settled by binding arbitration. Any such controversy or claim must be arbitrated on an individual basis, and 201 | must not be consolidated in any arbitration with any claim or controversy of any other party. The arbitration 202 | must be conducted in India, Uttar Pradesh, and judgment on the arbitration award may be entered into any court 203 | having jurisdiction thereof.
204 |
205 |
206 |

15. TITLES AND HEADINGS

207 |
The titles and headings of this Agreement are for convenience and ease of reference 208 | only and shall not be utilized in any way to construe or interpret the agreement of the parties as otherwise set 209 | forth herein.
210 |
211 |
212 |

16. SEVERABILITY

213 |
Each covenant and agreement in this Agreement shall be construed for all purposes to be 214 | a separate and independent covenant or agreement. If a court of competent jurisdiction holds any provision (or 215 | portion of a provision) of this Agreement to be illegal, invalid, or otherwise unenforceable, the remaining 216 | provisions (or portions of provisions) of this Agreement shall not be affected thereby and shall be found to be 217 | valid and enforceable to the fullest extent permitted by law.
218 |
219 |
220 |

17. CONTACT INFORMATION

221 |
If you have any questions about this Agreement, please contact us by email or regular 222 | mail at the following address:
223 |
Prenotebook
224 |
UttarPradesh
225 |
India
226 |
support@prenotebook.ml
227 |
228 | `; 229 | 230 | export default function TermsCondition() { 231 | const { mode } = useContext(BackContext); 232 | return ( 233 |
234 | {Parser(rawhtml)} 235 |
236 | ); 237 | } 238 | -------------------------------------------------------------------------------- /frontend/src/Component/notebook1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | PreNotebook 165 | -VedGupta 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | --------------------------------------------------------------------------------