Note-taking is a web application that allows users to manage their notes. Users can register, log in, create, update, and delete their notes.
To run this application locally, follow these steps:
- Clone this repository to your local machine.
- Navigate to the project directory.
- Install dependencies by running
npm install
. - Set up your database and update the database configuration in the
.env
file. - Start the server by running
npm start
. - Access the application in your web browser at
http://localhost:5000
.
The database schema for this application consists of three tables:
Column Name | Data Type | Description |
---|---|---|
id | INT | User ID (Primary Key) |
username | VARCHAR(255) | Username (Unique, Not Null) |
password | VARCHAR(255) | Password (Not Null) |
Column Name | Data Type | Description |
---|---|---|
id | INT | Note ID (Primary Key) |
title | VARCHAR(255) | Note Title (Not Null) |
content | TEXT | Note Content |
user_id | INT | User ID (Foreign Key referencing users.id, Not Null) |
created_at | TIMESTAMP | Creation Timestamp (Default: Current Timestamp) |
updated_at | TIMESTAMP | Last Updated Timestamp (Default: Current Timestamp on Update) |
Column Name | Data Type | Description |
---|---|---|
id | INT | Note Version ID (Primary Key) |
note_id | INT | Note ID (Foreign Key referencing notes.id, Not Null) |
title | VARCHAR(255) | Note Title (Not Null) |
content | TEXT | Note Content |
created_at | TIMESTAMP | Creation Timestamp (Default: Current Timestamp) |
- Endpoint:
/api/auth/register
- Method: POST
- Description: Register a new user
- Endpoint:
/api/auth/login
- Method: POST
- Description: Log in an existing user
- Endpoint:
/api/notes
- Method: GET
- Description: Get all notes for the authenticated user
- Endpoint:
/api/notes
- Method: POST
- Description: Add a new note for the authenticated user
- Endpoint:
/api/notes/:id
- Method: PUT
- Description: Update an existing note for the authenticated user
- Endpoint:
/api/notes/:id
- Method: DELETE
- Description: Delete an existing note for the authenticated user
- Endpoint:
/api/previousNote/:id
- Method: GET
- Description: Get the previous version of a note
- Node.js
- Express.js
- MySQL
- JSON Web Tokens (JWT) for authentication
- bcrypt for password hashing
- React.js for the frontend