Skip to content

a2rp/backend-bookmark-manager-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backend-bookmark-manager-api

Backend API for bookmark manager with links, tags, categories, favorites, and user ownership using JWT and HttpOnly cookies.

Features

  • Register user
  • Login user
  • Logout user
  • Create bookmark
  • Get all bookmarks (user-specific)
  • Get single bookmark (user-specific)
  • Update bookmark (user-specific)
  • Delete bookmark (user-specific)
  • Tags support
  • Category support
  • Favorite bookmark support
  • Protected routes
  • JWT authentication
  • HttpOnly cookie based auth
  • MongoDB with Mongoose

Tech Stack

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT
  • bcryptjs
  • cookie-parser

Environment Variables

Create a .env file:

PORT=1206
MONGO_URI=mongodb://127.0.0.1:27017/backend_bookmark_manager_api
JWT_SECRET=your_secret_key
NODE_ENV=development

Install

npm install

Run

npm run dev

API Endpoints

Auth

  • POST /api/auth/register
  • POST /api/auth/login
  • POST /api/auth/logout

Bookmarks

  • POST /api/bookmarks
  • GET /api/bookmarks
  • GET /api/bookmarks/:id
  • PUT /api/bookmarks/:id
  • DELETE /api/bookmarks/:id

Bookmark Fields

  • title
  • url
  • tags
  • category
  • isFavorite

Notes

  • Each bookmark belongs to a specific user
  • Users can only access their own bookmarks
  • Authentication via HttpOnly cookies
  • Use withCredentials: true in frontend

Follow Me

About

Secure backend API for bookmark manager with links, tags, categories, favorites, and user ownership using Node.js, Express, MongoDB, JWT, and HttpOnly cookies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors