Skip to content

This backend application, developed for book borrowing services, harnesses the power of TypeScript, Node.js, Express, and MongoDB. It features an open API for library management, enabling functionalities such as adding, updating, deleting, and retrieving book data. For testing, the application utilizes Jest and Supertest to ensure functionality

Notifications You must be signed in to change notification settings

moscuet/library-server100

Repository files navigation


🟢 Live API
Library Backend l REST API



library-server100

This backend application, developed for book borrowing services, harnesses the power of TypeScript, Node.js, Express, and MongoDB. It features an open API for library management, enabling functionalities such as adding, updating, deleting, and retrieving data of author, book and borrowing. For testing, the application utilizes Jest and Supertest to ensure high functionality and reliability.

Check out the live API at Library Server API

Frondend Library app powered with library-server100 API:  Github Repo   Live Front End

🔥 Features

  • CRUD for Books & Authors: Manage book and author data with full create, read, update, and delete capabilities.
  • Borrowing & Returns: Track and manage the lending process efficiently.
  • Secure Login: Protect user data with JWT authentication.
  • Testing Suite: Ensure reliability with Jest and Supertest.

🛠 Tech Stack

  • Backend: Node.js, Express, MongoDB, Mongoose
  • Security: JWT, Bcrypt
  • Testing: Jest, Supertest
  • Utilities: Nodemailer, Winston, dotenv
  • Dev Tools: TypeScript, ESLint, Prettier, Nodemon

📖 Entity Relationship Diagram (ERD)

Entity Relationship Diagram (ERD)

For a detailed view, check the ERD documentation.


🚀 Endpoints

all books: https://library-server400.herokuapp.com/api/books
all books with data population: https://library-server400.herokuapp.com/api/books/all
get book by id: https://library-server400.herokuapp.com/api/books/id
update book by id: hhttps://library-server400.herokuapp.com/api/books/id 
delete all book: https://library-server400.herokuapp.com/api/books/all
post new book: https://library-server400.herokuapp.com/api/books

Prerequisites

  1. Install mongodb
  2. Install nodejs

Setting Up

  1. Create a .env file in the root directory and copy the content from .env.example

  2. Make sure mongodb is running

  • brew install mongodb
  1. Install dependencies: yarn
  2. Use this command for development mode: yarn run watch
  3. If you need to customize your env, take a look at secrets.ts file

mongodb setup in local env

for mac user: install: brew install mongodb, Tap the MongoDB Homebrew Tap: brew tap mongodb/brew Start MongoDB Service: brew services start mongodb-community, Verify Installation: brew services list Install MongoDB Shell (mongosh): brew install mongosh Running the MongoDB Shell: mongosh Create or Use a Databas: use yourDatabaseName Experiment with MongoDB: db.createCollection("myCollection") db.myCollection.insert({ name: "test", value: 1 }) db.myCollection.find()

About

This backend application, developed for book borrowing services, harnesses the power of TypeScript, Node.js, Express, and MongoDB. It features an open API for library management, enabling functionalities such as adding, updating, deleting, and retrieving book data. For testing, the application utilizes Jest and Supertest to ensure functionality

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published