Skip to content

TheLunatic1/bookhaven-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

The Book Haven – Server (API) πŸ“š

πŸ“š Backend RESTful API for The Book Haven – a full-stack book management system. Handles all CRUD operations with user-specific data using email from Firebase Auth.
πŸ“š Backend API for The Book Haven – Node.js + Express + MongoDB | User-specific CRUD operations

πŸ”₯ Live API Base URL: https://bookhaven-server.vercel.app/api

🌐 Client Live Demo: https://bookhaven-client.web.app Book Haven API Preview

✨ Features

  • Full CRUD operations for books (Create, Read, Update, Delete)
  • User-specific books filtering using userEmail (perfect for Firebase Auth)
  • Quantity management (increment/decrement when borrowing)
  • CORS enabled – works seamlessly with Firebase/Vercel/Netlify frontends
  • Lightweight, fast, and production-ready
  • Deployed on Vercel Serverless Functions

πŸ› οΈ Tech Stack

Technology Purpose
Node.js (18+) Runtime
Express.js Web framework
MongoDB Atlas NoSQL Database
Mongoose MongoDB object modeling
CORS Allow frontend domains
dotenv Environment variables

πŸ“¦ Dependencies

```json
"dependencies": {
  "express": "^4.18.2",
  "mongoose": "^8.0.0",
  "cors": "^2.8.5",
  "dotenv": "^16.3.1"
}

Clone the repository

git clone https://github.com/TheLunatic1/bookhaven-server.git
cd bookhaven-server

Install dependencies

npm install

Create .env file (see example below)

cp .env.example .env

Start development server

npm run dev

Required .env variables

PORT=5000
MONGODB_URI=your_mongodb_atlas_connection_string

πŸ“‘ API Endpoints

MethodEndpointDescriptionAuth Required?
GET/api/booksGet all booksNo
GET/api/books/my?email=user@example.comGet user's own booksNo (email-based)
POST/api/booksAdd a new bookNo (client handles auth)
PUT/api/books/:idUpdate book (title, quantity, etc.)No (email check inside)
DELETE/api/books/:idDelete a bookNo (email check inside)

πŸ”— Important Links

About

πŸ“š Backend RESTful API for The Book Haven – a full-stack book management system. Handles all CRUD operations with user-specific data using email from Firebase Auth.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors