Skip to content

prithidevghosh/speerNote

Repository files navigation

Speer Note API

The Speer Note API is a powerful tool for managing your notes. It provides various endpoints for user authentication, note management, and keyword-based note searching. Below, you'll find a detailed guide on how to interact with the API, along with key features and example requests.

Deployed Link
https://speer-note.vercel.app/api

Prerequisites

  • Node.js v14.15.0 or higher
  • NPM v6.14.8 or higher
  • MongoDB v4.4 or higher

Authentication

The API uses JSON Web Tokens (JWT) for authentication. To access authenticated routes, include a valid JWT in the Authorization header of your requests. The endpoints with a 🔒 at end, signifies a protected route

steps to locally configure and run this app

Clone the repo

git clone https://github.com/prithidevghosh/speerNote.git

Install the required packages

npm install

Start the server locally

nodemon

Configuration

The application requires a MongoDB instance to be set up. You can configure the database connection by setting the following environment variables:

MONGOURI = "your mongo cluster URI"
PORT=8008
TOKEN_SECRET = "your own token secret"

You can set these environment variables in a .env file in the root directory of the application.

API Endpoints

Endpoint Name Method Purpose
/auth/signup POST User Registration (Sign-Up)
/auth/login POST User Authentication (Sign-In)
/notes 🔒 GET Retrieve Notes
/notes 🔒 POST Create Note
/notes/delete/:noteid 🔒 DELETE Delete Note
/notes/update/:noteid 🔒 PUT Update Note
/notes/share/:shareduserid/:noteid 🔒 POST Share Note
/search?q=your_query 🔒 GET Search Notes

Example prod curl

curl --location 'https://speer-note.vercel.app/api/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email":"ghosh1@email.com",
    "password":"ghosh1"
}'

Here is a list of features added to the Speer Note application:

  1. User Authentication:
    • Users can create a new account (/auth/signup).
    • Users can log in to their account (/auth/login).
  2. Note Management:
    • Users can retrieve their notes (/notes - GET).
    • Users can create a new note (/notes - POST).
    • Users can delete a note (/notes/delete/:noteid - DELETE).
    • Users can update a note (/notes/update/:noteid - PUT).
    • Users can share a note with another user (/notes/share/:shareduserid/:noteid - POST).
  3. Search Functionality:
    • Users can search for notes based on keywords (/search?q=your_query).
  4. Middleware:
    • Passport authentication middleware is used to secure routes.
  5. Database:
    • MongoDB is used as the database, and Mongoose is the ODM.
  6. Token-based Authentication:
    • JSON Web Tokens (JWT) are used for secure user authentication.
  7. Environment Variables:
    • Environment variables are used to store sensitive information like database connection URI and token secret.
  8. Deployed on Vercel:

About

The Speer Note API is a powerful tool for managing your notes. It provides various endpoints for user authentication, note management, and keyword-based note searching. Below, you'll find a detailed guide on how to interact with the API, along with key features and example requests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors