Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mailsg/crudlib
A backend service to perform CRUD operations.
https://github.com/mailsg/crudlib
Last synced: 7 days ago
JSON representation
A backend service to perform CRUD operations.
- Host: GitHub
- URL: https://github.com/mailsg/crudlib
- Owner: mailsg
- Created: 2023-11-09T15:29:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-10T12:40:15.000Z (over 1 year ago)
- Last Synced: 2024-12-08T14:41:24.718Z (2 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [Usage](#usage)
- [👥 Author](#author)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [📝 License](#license)**Bookstore API** is a backend service used to perform CRUD operation with books. It is built with NodeJS and uses MongoDB as the database.
Server
Database
- **API Endpoints to perform CRUD operations**
- **Database deployment on Mongo Atlas**
To get a local copy up and running, follow these steps.
### Prerequisites
### Setup
Clone this repository to your desired folder:
```sh
git clone https://github.com/mailsg/crudlib.git
cd crudlib
```
### Install
Install this project by executing the following commands. Since its an Open API, there is no need to set up any API keys:
```sh
cd crudlib
npm install
touch .env
`Add the following lines to the .env file`
MONGODB_URI=`Your MongoDB-Atlas URI (mongodb+srv)`
DATABASE_NAME=`Your MongoDB Database Name`
COLLECTION_NAME=`Your MongoDB Collection Name`
- Please note that the above 3 variables are mandatory for the project to run.
- I have used Database Name as `library` and Collection Name as `books` for this project. You can use any name of your choice or use the same as mine.
- The database and collection has to be created manually in MongoDB Atlas.
```
### Usage
To run the project, execute the following command:
```sh
npm start
```
Below are the Endpoints to perform CRUD operations:
- **GET** `http://localhost:3000/api/books` - Get all books
- **GET** `http://localhost:3000/api/books/:id` - Get a book by id
- **POST** `http://localhost:3000/api/books` - Create a new book
- **Request Body**
```json
{
"title": "Book Title",
"author": "Book Author",
"summary": "Book Summary"
}
```
- **PUT** `http://localhost:3000/api/books/:id` - Update a book by id
- **Request Body** (Any or all of the following)
```json
{
"title": "Book Title",
"author": "Book Author",
"summary": "Book Summary"
}
```
- **DELETE** `http://localhost:3000/api/books/:id` - Delete a book by id
👤 **Sandeep Ghosh**
- GitHub: [@mailsg](https://github.com/mailsg)
- LinkedIn: [LinkedIn](https://linkedin.com/in/sandeep0912)
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](../../issues/).
If you like this project consider leaving a star to the repository.
Thank you for giving me the opportunity to showcase my skills.
This project is [MIT](./MIT.md) licensed.