{"id":21343730,"url":"https://github.com/sahiljain0/bookstore","last_synced_at":"2026-04-08T21:32:10.641Z","repository":{"id":263947025,"uuid":"891680322","full_name":"Sahiljain0/BookSTore","owner":"Sahiljain0","description":"Book store API made using Node.js, Express.js, and MongoDB","archived":false,"fork":false,"pushed_at":"2024-11-21T07:51:51.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T03:14:22.837Z","etag":null,"topics":["api","book","expressjs","jwt","mongodb","nodejs","store","swagger-ui"],"latest_commit_sha":null,"homepage":"https://bookstore-un61.onrender.com/api-docs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sahiljain0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T19:03:29.000Z","updated_at":"2024-11-21T07:54:14.000Z","dependencies_parsed_at":"2024-11-21T06:30:25.921Z","dependency_job_id":"02993670-494f-4311-9ed7-2b7dc3ee7836","html_url":"https://github.com/Sahiljain0/BookSTore","commit_stats":null,"previous_names":["sahiljain0/bookstore"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sahiljain0/BookSTore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahiljain0%2FBookSTore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahiljain0%2FBookSTore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahiljain0%2FBookSTore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahiljain0%2FBookSTore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sahiljain0","download_url":"https://codeload.github.com/Sahiljain0/BookSTore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahiljain0%2FBookSTore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","book","expressjs","jwt","mongodb","nodejs","store","swagger-ui"],"created_at":"2024-11-22T01:15:03.879Z","updated_at":"2026-04-08T21:32:10.627Z","avatar_url":"https://github.com/Sahiljain0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online Book Store API\n\nBook store API made using Node.js, Express.js, and MongoDB\n\n### API Features:\n\n1. **Books**\n   - Show a list of books to buy\n   - In book list, only show books which are in stock\n   - Show individual book details\n2. **Purchase**\n   - Books can be purchased only by logged in user\n   - Purchase is allowed only if the book is in stock\n   - Book's stock decrease/increase based on how many purchases have been made or canceled respectively\n   - Users can see their respective purchase list or individual purchase\n   - User can cancel their purchase (or order)\n3. **User**\n   - User signup / login feature available\n   - User has 2 roles\n     - Normal user\n     - Admin user\n   - A normal user can signup by _Name_, _Email_ and _Password_\n   - For login, _Email_ and _Password_ is required\n   - To register/signup as an **ADMIN**, an extra **admin-signup-key** is required which is not public\n   - Authentication is done by JWT tokens\n   - A normal user can see and purchase books but he/she can not add/modify a book\n   - A norma user can also cancel a purchase\n4. **Admin features**\n   - Only Admin can add/delete a book\n   - Admin can increase or decrease a book's stock\n   - Admin can update a book's data, such as title, description\n\n### Guide to local setup\n\n1. Clone this repository\n   ```bash\n   git clone https://github.com/Sahiljain0/BookSTore.git\n   ```\n2. Install node packages (from root directory)\n   ```bash\n   npm install\n   ```\n3. Setup a database on [MongoDB cloud database](https://www.mongodb.com/cloud) and get a _\"Connection String\"_\n4. Add the _\"Connection String\"_ to **mongoURI** key in `default.json` file which is in `config` folder\n5. Add **\"jwtSecret\"** and **\"admin-signup-key\"** key's value of your choice in `default.json`\n6. Run development server\n   ```bash\n   npm run server\n   ```\n7. Use the API in Postman or any other API testing tool\n\n\n## API Documentation and Testing\n\nThis project includes detailed API documentation for easy integration and testing. Below are the available options for testing the APIs:\n\n### 1. API Documentation (APIDoc.md)\n\nAll API endpoints are documented in the `APIDoc.md` file located in the project root. This file contains:\n- Descriptions of each API endpoint.\n- Request methods (GET, POST, PUT, PATCH, DELETE).\n- Sample request/response bodies.\n- Error handling details.\n\n### 2. Testing with Postman\n\nThe APIs can be easily tested using [Postman](http://localhost:4000/). To get started:\n- Import the `APIDoc.md` file into Postman or manually configure the endpoints as described in the documentation.\n- Set up the required headers, parameters, and request bodies as mentioned in the documentation.\n\n### 3. Swagger UI\n\nFor an interactive API testing experience, Swagger UI is integrated into the project. It allows you to explore and test all the endpoints directly from the browser.\n\n#### Steps to Use Swagger UI:\n1. Start the project by running:\n   ```bash\n   npm run server\n  \n  ( http://localhost:4000/api-docs/)\n  \n2. Use the interactive interface to test endpoints. Swagger UI provides:\n- Endpoint details (e.g., HTTP method, path, and required parameters).\n- Input fields for testing the API.\n- Real-time response visualization.\n\n### 4. Getting Started with the APIs\n\n- Ensure the server is running before testing the APIs.\n- Use either Postman or Swagger UI to test various endpoints.\n- Refer to the `APIDoc.md` file for any additional details or examples.\n\n\n\n# for admin registration \n    role = 1\n   \n\n# for student registration \n   role = 0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahiljain0%2Fbookstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahiljain0%2Fbookstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahiljain0%2Fbookstore/lists"}