Skip to content

Commit f4c012b

Browse files
authored
Merge pull request #116 from raj-mistry-01/main
iNoteBook Added
2 parents 76d6ce7 + e77c999 commit f4c012b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+22538
-0
lines changed

assets/iNoteBook.png

28.5 KB
Loading

inotebook/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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*

inotebook/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# iNoteBook
2+
3+
## Overview
4+
5+
iNoteBook is a digital platform designed for users to easily save, manage, and organize their notes. With features that enhance productivity and accessibility, iNoteBook aims to provide a seamless note-taking experience.
6+
7+
## Features
8+
9+
- **User Dashboard**: An intuitive interface where users can view, add, and manage their notes effortlessly.
10+
- **Save Notes**: Users can create and save notes quickly, allowing for easy access and organization.
11+
- **Delete Notes**: Remove any unwanted notes with a simple click.
12+
- **Update Notes**: Edit existing notes to keep information current and relevant.
13+
- **Download Notes**: Easily download individual notes in various formats for offline access.
14+
- **Recycle Bin Concept**: Deleted notes are not permanently lost; users can retrieve them from the recycle bin.
15+
16+
## Technologies Used
17+
18+
- **Frontend**:
19+
- **React**: For building a dynamic user interface.
20+
- **Bootstrap**: To create responsive and visually appealing layouts.
21+
22+
- **Backend**:
23+
- **Node.js**: For handling server-side logic and API requests.
24+
- **Express**: To manage routes and middleware effectively.
25+
- **Flask**: To support specific functionalities for creating the pdfs for the Notes.
26+
- **DataBase**:
27+
- **MongoDB**: For JSON Data
28+
29+
## Getting Started
30+
31+
To get started with iNoteBook locally, follow these steps:
32+
33+
1. **Clone the repository**:
34+
```bash
35+
git clone <repository-url>
36+
1. **cd inotebook**:
37+
```bash
38+
cd for your system
39+
1. **cd /flask-server and DownLoad the requirements.txt**:
40+
```bash
41+
pip install -r requirements.txt
42+
1. **just modify the path of local directory for the pdf file**:
43+
```bash
44+
pip install -r requirements.txt
45+
1. **cd /backend and install node modules**:
46+
```bash
47+
npm install
48+
1. **cd /inotebook and install node modules**:
49+
```bash
50+
npm install
51+
1. **cd /inotebook and run the project and parellal on the python server.py**:
52+
```bash
53+
npm run both for node
54+
python server.py for python
55+
56+
## Have Look
57+
58+
## Saving The Note
59+
60+
61+
![Screenshot 2024-10-22 005350](https://github.com/user-attachments/assets/b4417e57-6561-42c1-ba85-a100881991f7)
62+
63+
## NotesSection
64+
65+
![Screenshot 2024-10-22 005424](https://github.com/user-attachments/assets/2586ad9e-ebd8-4712-bcbd-a5894945c3bd)
66+
67+
## Update Note
68+
69+
![Screenshot 2024-10-22 005437](https://github.com/user-attachments/assets/ebc84d57-56e4-4558-9cdc-d05aa944b585)
70+
71+
72+
## One Note DownLoad
73+
74+
![Screenshot 2024-10-22 011310](https://github.com/user-attachments/assets/910a9694-fbe8-45ef-8a02-42846ead675f)
75+
76+
77+
## All Notes DownLoad
78+
79+
80+
https://github.com/user-attachments/assets/551a4db8-9c1c-4152-b965-c18a7b01b917
81+
82+
You can Also these In flask server/output

inotebook/backend/db.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const mongoose = require("mongoose")
2+
const mongoURI = "dbStr"
3+
4+
const connectToMongo = () => {
5+
mongoose.connect(mongoURI)
6+
console.log("Connected to mongo");
7+
}
8+
9+
module.exports = connectToMongo;

inotebook/backend/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const connectToMongo = require("./db")
2+
const express = require("express")
3+
const cors = require("cors")
4+
connectToMongo()
5+
const app = express()
6+
const port = 7000
7+
app.use(cors())
8+
9+
10+
// importing routes from routes folder
11+
app.use(express.json())
12+
app.use("/api/auth" ,require("./routes/auth"))
13+
app.use("/api/notes" ,require("./routes/notes"))
14+
app.use("/api/userStats",require("./routes/usernotesinfo"))
15+
16+
app.listen(port,()=>{
17+
console.log(`App listening at http://localhost:${port}`)
18+
})
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var jwt = require("jsonwebtoken")
2+
const JWT_SECRET = "escapethematrix"
3+
4+
const fetchuser = (req,res,next) => {
5+
// GET THE USER FROM THE JWT USER AND ADD IT TO REQ
6+
const token = req.header("authToken")
7+
console.log(token);
8+
if (!token) {
9+
res.status(401).send("PLease authenticate using a valid token")
10+
}
11+
try {
12+
const data = jwt.verify(token,JWT_SECRET)
13+
req.user = data.user
14+
next()
15+
}
16+
catch (error) {
17+
res.status(401).send("PLease authenticate using a valid token")
18+
19+
}
20+
}
21+
22+
module.exports = fetchuser
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const mongoose = require("mongoose")
2+
const {Schema} = mongoose;
3+
const DeleteNotesSchema = new Schema({
4+
user : {
5+
type : mongoose.Schema.Types.ObjectId,
6+
ref : "user"
7+
},
8+
title : {
9+
type : String,
10+
required : true
11+
},
12+
description : {
13+
type : String,
14+
required : true
15+
},
16+
tag : {
17+
type : String,
18+
default : "General"
19+
},
20+
date : {
21+
type : Date,
22+
default : Date.now
23+
}
24+
})
25+
26+
module.exports = mongoose.model("deletednotes",DeleteNotesSchema)

inotebook/backend/models/Notes.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const mongoose = require("mongoose")
2+
const {Schema} = mongoose;
3+
const NotesSchema = new Schema({
4+
user : {
5+
type : mongoose.Schema.Types.ObjectId,
6+
ref : "user"
7+
},
8+
title : {
9+
type : String,
10+
required : true
11+
},
12+
description : {
13+
type : String,
14+
required : true
15+
},
16+
tag : {
17+
type : String,
18+
default : "General"
19+
},
20+
date : {
21+
type : Date,
22+
default : Date.now
23+
}
24+
})
25+
26+
module.exports = mongoose.model("notes",NotesSchema)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const mongoose = require('mongoose');
2+
3+
const userStatsSchema = new mongoose.Schema({
4+
email: {
5+
type: String,
6+
required: true,
7+
unique: true,
8+
lowercase: true,
9+
trim: true,
10+
},
11+
totalNotes: {
12+
type: Number,
13+
required: true,
14+
min: 0,
15+
default: 0
16+
},
17+
updatedNotes: {
18+
type: Number,
19+
required: true,
20+
min: 0,
21+
default: 0
22+
},
23+
deletedNotes: {
24+
type: Number,
25+
required: true,
26+
min: 0,
27+
default: 0
28+
},
29+
createdAt: {
30+
type: Date,
31+
default: Date.now
32+
}
33+
});
34+
35+
module.exports = mongoose.model('UserStats', userStatsSchema);

inotebook/backend/models/Recents.js

Whitespace-only changes.

inotebook/backend/models/User.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const mongoose = require("mongoose")
2+
const {Schema} = mongoose;
3+
const UserSchema = new Schema({
4+
name : {
5+
type : String,
6+
required : true
7+
},
8+
email : {
9+
type : String,
10+
required : true,
11+
unique : true
12+
},
13+
password : {
14+
type : String,
15+
required : true
16+
},
17+
date : {
18+
type : Date,
19+
default : Date.now
20+
},
21+
22+
})
23+
const User = mongoose.model("user",UserSchema)
24+
User.createIndexes()
25+
module.exports = User

0 commit comments

Comments
 (0)