Routes

BatchSearch

  • Purpose: Optimizes API requests by grouping multiple search queries made by different users into a single request. This reduces the total number of API requests by processing multiple searches together and returning results specific to each user’s query.

  • Used in: Navbar component, where users enter their search queries.

Folders

  • Purpose: Responsible for retrieving folders from the database and providing them to the client. Also handles the deletion of folders from the database.

  • Used in: Folders component.

ImageUpload

  • Purpose: Handles the uploading and deletion of images to and from Cloudinary. This allows users to manage their profile pictures.

  • Used in: Settings component.

Notes

  • Purpose: Retrieves the user's saved notes from the database and provides them to the client. Also responsible for deleting notes from the database.

  • Used in: Note component.

Users

  • Purpose: Manages user registration, login, account deletion, and updates to usernames and passwords.

  • Used in: Login, Registration, and Settings components.

VideoNotingDemo

  • Purpose: Retrieves the web application demonstration video from Cloudinary.

  • Used in: Home Component.

Videos

  • Purpose: Adds video metadata to the database. When a user clicks on a video, its metadata is stored in the database. This route retrieves the metadata and provides it to the client to avoid redundant API queries.

  • Used in: Note and UserProfile components.


Protected Routes

Protected routes are implemented using middleware to ensure that only authenticated users can access certain endpoint

Middleware: 'validateToken'

This middleware checks the validity of the user's token before allowing access to the routes.