🟢 Live API
Library Backend l REST API
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
- 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.
- Backend: Node.js, Express, MongoDB, Mongoose
- Security: JWT, Bcrypt
- Testing: Jest, Supertest
- Utilities: Nodemailer, Winston, dotenv
- Dev Tools: TypeScript, ESLint, Prettier, Nodemon
For a detailed view, check the ERD documentation.
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
- Install mongodb
- Install nodejs
-
Create a
.env
file in the root directory and copy the content from.env.example
-
Make sure mongodb is running
- brew install mongodb
- Install dependencies:
yarn
- Use this command for development mode:
yarn run watch
- If you need to customize your env, take a look at
secrets.ts
file
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()