Welcome to My Notes App! This is a simple and intuitive web application that allows you to create, manage, and organize your personal notes. The app is built using the MERN stack, which consists of MongoDB, Express.js, React, and Node.js. It utilizes bcrypt for password hashing, JWT token-based authentication and authorization, and cookies for session management, and middleware for additional security and functionality.
To run the My Notes App locally on your machine, follow these steps:
-
Node.js: Make sure you have Node.js installed on your system. You can download it from the official website: Node.js.
-
MongoDB: Install MongoDB and make sure it's running on your local machine or provide the connection details in the
.env
file.
- Clone the repository:
git clone https://github.com/AKASH-PRASAD7/My-Notes.git
cd My-Notes
- Install dependencies:
npm install
- Create a
.env
file in the root directory with the following configuration:
MONGO_URI=<YOUR CONNECION URI>
PORT=8001
SECRET_KEY=<JWT_SECRET_KEY>
Make sure to replace <YOUR CONNECION URI>
with your actual MongoDB connection string.
Start the development server:
npm start
The app will be accessible at http://localhost:8001
.
- User Authentication: Sign up and sign in securely using bcrypt-hashed passwords and JWT tokens.
- Authorization & Cookies: Maintain user sessions using HTTP-only secure cookies for authentication.
- Create Notes: Add new notes with a title and description.
- Middleware: Implement additional security and functionality using custom middleware.
- View All Notes: See all your notes in a user-friendly list.
- Edit Notes: Modify and update existing notes.
- Delete Notes: Remove unwanted notes from the list.
The project follows a structured folder organization:
my-notes-app/
├── client/
│ ├── public/
│ └── src/
│ ├── components/
│ ├── containers/
│ ├── pages/
│ ├── App.js
│ ├── index.js
│ └── ...
├── server/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── app.js
│ └── ...
├── .env
├── package.json
└── README.md
- The
client
folder contains the React front-end code, while theserver
folder holds the Node.js back-end code.
-
Front-End:
- React.js
- React Router
- Tailwind css
- Axios
-
Back-End:
- Node.js
- Express.js
- MongoDB (with Mongoose)
- bcrypt (for password hashing)
- jsonwebtoken (JWT) (for token-based authentication)
The My Notes App provides the following API endpoints:
POST /auth/signup
: Create a new user account.POST /auth/signin
: Sign in to an existing account.POST /auth/signout
: Sign out from the current user account.
GET /notes
: Get all user notes.POST /notes
: Add a new note.PATCH /notes/:notesId
: Update a note.DELETE /notes/:notesId
: Delete a note.
The My Notes App utilizes custom middleware for additional security and functionality:
verifyCookie
: Verifies the JWT token present in the session cookie for user authentication.
We welcome contributions from the community to enhance the app and make it even better. If you find any issues or have suggestions for new features, feel free to open an issue or submit a pull request.
This project is licensed under the Creatives Common.