Giter VIP home page Giter VIP logo

dfanso / book-store Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 197 KB

The Bookstore API is a RESTful service designed to manage a collection of books, allowing users to perform Create and GetAll operations on books stored in a database. This service is built using NestJS, a progressive Node.js framework for building efficient and scalable server-side applications.

Home Page: https://book-store-dfanso.vercel.app

License: MIT License

JavaScript 6.02% TypeScript 93.98%

book-store's Introduction

Bookstore API

Description

The Bookstore API is a RESTful service designed to manage a collection of books, allowing users to perform Create and GetAll operations on books stored in a database. This service is built using NestJS, a progressive Node.js framework for building efficient and scalable server-side applications.

Technologies Used

  • NestJS: A framework for building Node.js server-side applications.
  • MongoDB: A NoSQL database used to store the book data.
  • Mongoose: An ODM (Object Document Mapping) library for MongoDB and Node.js.
  • Swagger: An open-source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful web services.

Getting Started

Prerequisites

  • Node.js

Installation

  1. Clone the repository:

    git clone https://github.com/DFanso/book-store.git
    
  2. Navigate to the project directory:

    cd bookstore-api
    
  3. Install the dependencies:

    npm install
    
  4. Start the MongoDB service (ensure MongoDB is installed and properly set up on your machine).

  5. Copy the .env.example file to .env and adjust the environment variables to match your setup, particularly the database connection string.

  6. Start the application:

    npm run start
    
  7. The application should now be running on http://localhost:9000. Access the Swagger documentation at http://localhost:9000/api for an interactive API documentation and testing interface.

  8. Use the Token in Header Authentication

API Endpoints

POST v1/books

  • Description: Add a new book to the collection.

  • Request Body:

    {
      "title": "Book Title",
      "author": "Author Name",
      "year": 2020,
      "genre": "Fiction"
    }
  • Response: HTTP 201 (Created), with the created book object.

GET v1/books

  • Description: Retrieve a list of all books in the collection.
  • Response: HTTP 200 (OK), with an array of book objects.

book-store's People

Contributors

dfanso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.