{"info":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","description":"<html><head></head><body><p>Welcome to the Book Management API! Follow these simple steps to get the project up and running. 🚀</p>\n<hr>\n<h2 id=\"prerequisites\">Prerequisites</h2>\n<p>Before you start, make sure you have the following installed on your system:</p>\n<ol>\n<li><p><strong>Node.js</strong> (v14 or higher) - <a href=\"https://nodejs.org/\">Download Node.js</a></p>\n</li>\n<li><p><strong>Git</strong> (optional, for cloning the repository) - <a href=\"https://git-scm.com/\">Download Git</a></p>\n</li>\n</ol>\n<hr>\n<h2 id=\"step-1-clone-the-repository\">Step 1: Clone the Repository</h2>\n<p>First, clone the project repository to your local machine. If you haven’t already, open a terminal and run:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">git clone https://github.com/Daltonic/sia_test\ncd sia_test\n\n</code></pre>\n<p>Or simply download the project files as a ZIP and extract them.</p>\n<hr>\n<h2 id=\"step-2-install-dependencies\">Step 2: Install Dependencies</h2>\n<p>Next, navigate to the project folder and install the required dependencies using npm:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">npm install\n\n</code></pre>\n<p>This will install:</p>\n<ul>\n<li><p><strong>express</strong> (Web framework)</p>\n</li>\n<li><p><strong>sqlite3</strong> (Database driver)</p>\n</li>\n<li><p><strong>body-parser</strong> (Middleware for parsing JSON requests)</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"step-3-start-the-server\">Step 3: Start the Server</h2>\n<p>Once the dependencies are installed, start the server with the following command:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">npm start\n\n</code></pre>\n<p>If everything is set up correctly, you’ll see:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">Server running on http://localhost:9000\n\n</code></pre>\n<hr>\n<h2 id=\"step-4-manage-the-database\">Step 4: Manage the Database</h2>\n<p>The project uses <strong>SQLite</strong> for data storage. A file named <code>booksDB.sqlite</code> will be created automatically in the project directory. You can view and edit the database using tools like:</p>\n<ul>\n<li><p><a href=\"https://sqlitebrowser.org/\">DB Browser for SQLite</a></p>\n</li>\n<li><p>Command-line SQLite tool</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"troubleshooting\">Troubleshooting</h2>\n<ul>\n<li><p><strong>Port Conflict</strong>: If port <code>9000</code> is already in use, modify the <code>PORT</code> variable in <code>app.js</code>.</p>\n</li>\n<li><p><strong>Dependency Issues</strong>: Run <code>npm install</code> again to ensure all dependencies are installed.</p>\n</li>\n</ul>\n<hr>\n<p>Enjoy managing your books with this API! If you run into any issues, feel free to ask for help. 🎉</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"3187120","collectionId":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","publishedId":"2sAYHzHP92","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"28A952"},"publishDate":"2024-12-31T11:45:51.000Z"},"item":[{"name":"Endpoints API","item":[{"name":"Create Book","id":"3f6c1e4a-5c73-4e5f-bf6a-58c5d3892687","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"title\": \"The Great Gatsby\",\n  \"author\": \"F. Scott Fitzgerald\",\n  \"pages\": 180,\n  \"published\": \"1925\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:9000/books","description":"<p><strong>URL:</strong> <code>POST /books</code><br /><strong>Description:</strong> Add a brand-new book to your collection. 📚</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","type":"collection"}},"urlObject":{"protocol":"http","port":"9000","path":["books"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"a67ce8fd-ea6f-4094-81eb-d24296a4b5df","name":"New Book Example","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"title\": \"The Great Gatsby\",\n  \"author\": \"F. Scott Fitzgerald\",\n  \"pages\": 180,\n  \"published\": \"1925\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:9000/books"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"97"},{"key":"ETag","value":"W/\"61-Haoi101NtzH82ZECbRFtGQyQ2Qo\""},{"key":"Date","value":"Mon, 16 Dec 2024 20:34:23 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 4,\n    \"title\": \"The Great Gatsby\",\n    \"author\": \"F. Scott Fitzgerald\",\n    \"pages\": 180,\n    \"published\": \"1925\"\n}"}],"_postman_id":"3f6c1e4a-5c73-4e5f-bf6a-58c5d3892687"},{"name":"Update Book","id":"91605863-1449-4bea-84c9-b01896c106dd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"1984 Again\",\n    \"author\": \"George Orwell\",\n    \"pages\": 328,\n    \"published\": \"1949\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:9000/books/1","description":"<p><strong>URL:</strong> <code>PUT /books/:id</code><br /><strong>Description:</strong> Make edits to a book’s details—give it a facelift! 🛠️</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","type":"collection"}},"urlObject":{"protocol":"http","port":"9000","path":["books","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"8c2cf17f-23fb-4add-9b99-890d13c897d5","name":"Updated Book Example","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"1984 Again\",\n    \"author\": \"George Orwell\",\n    \"pages\": 328,\n    \"published\": \"1949\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:9000/books/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"87"},{"key":"ETag","value":"W/\"57-IjJGMYkks+lbUBAV+Dh/norLmo4\""},{"key":"Date","value":"Mon, 16 Dec 2024 20:32:34 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"1\",\n    \"title\": \"1984 Again\",\n    \"author\": \"George Orwell\",\n    \"pages\": 328,\n    \"published\": \"1949\"\n}"}],"_postman_id":"91605863-1449-4bea-84c9-b01896c106dd"},{"name":"List Books","id":"a1b94d35-c7b1-4611-80c9-c00cca7ab9f9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:9000/books","description":"<p><strong>URL:</strong> <code>GET /books</code><br /><strong>Description:</strong> Fetch a list of all books in your library. Perfect for bookworms! 🧐<br /><strong>How to Use:</strong> Send a GET request to <code>http://localhost:9000/books</code>.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","type":"collection"}},"urlObject":{"protocol":"http","port":"9000","path":["books"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"804a272d-f2e0-4f9f-8a4e-25d826919105","name":"Book Listing Example","originalRequest":{"method":"GET","header":[],"url":"http://localhost:9000/books"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"372"},{"key":"ETag","value":"W/\"174-ToZI6bv0kEqe7NBtHAVxbk8aedk\""},{"key":"Date","value":"Mon, 16 Dec 2024 20:34:29 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 1,\n        \"title\": \"1984 Again\",\n        \"author\": \"George Orwell\",\n        \"pages\": 328,\n        \"published\": \"1949\"\n    },\n    {\n        \"id\": 2,\n        \"title\": \"To Kill a Mockingbird\",\n        \"author\": \"Harper Lee\",\n        \"pages\": 281,\n        \"published\": \"1960\"\n    },\n    {\n        \"id\": 3,\n        \"title\": \"Pride and Prejudice\",\n        \"author\": \"Jane Austen\",\n        \"pages\": 416,\n        \"published\": \"1813\"\n    },\n    {\n        \"id\": 4,\n        \"title\": \"The Great Gatsby\",\n        \"author\": \"F. Scott Fitzgerald\",\n        \"pages\": 180,\n        \"published\": \"1925\"\n    }\n]"}],"_postman_id":"a1b94d35-c7b1-4611-80c9-c00cca7ab9f9"},{"name":"Show Book","id":"a5d75258-d3e8-4682-bd14-52086d7dc2d7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:9000/books/1","description":"<p><strong>URL:</strong> <code>GET /books/:id</code><br /><strong>Description:</strong> Find details about a specific book using its ID. 🔍<br /><strong>How to Use:</strong> Replace <code>:id</code> with the book’s ID in the URL (e.g., <code>/books/1</code>) and send a GET request to <code>http://localhost:9000/books/1</code>.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","type":"collection"}},"urlObject":{"protocol":"http","port":"9000","path":["books","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"ef9acddc-4156-4e02-9ece-bd23783b9dfa","name":"Book Details Example","originalRequest":{"method":"GET","header":[],"url":"http://localhost:9000/books/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"85"},{"key":"ETag","value":"W/\"55-m2+qGGNwiA4YIH00u53c4cf29dA\""},{"key":"Date","value":"Mon, 16 Dec 2024 20:33:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"title\": \"1984 Again\",\n    \"author\": \"George Orwell\",\n    \"pages\": 328,\n    \"published\": \"1949\"\n}"}],"_postman_id":"a5d75258-d3e8-4682-bd14-52086d7dc2d7"},{"name":"Remove Book","id":"43ae0dff-9670-4ee9-ae8c-d393c3b27ad8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:9000/books/4","description":"<p><strong>URL:</strong> <code>DELETE /books/:id</code><br /><strong>Description:</strong> Remove a book from your collection. (Farewell, book! 👋)<br /><strong>How to Use:</strong> Replace <code>:id</code> with the book’s ID (e.g., <code>/books/1</code>) and send a DELETE request to <code>http://localhost:9000/books/1</code>.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","type":"collection"}},"urlObject":{"protocol":"http","port":"9000","path":["books","4"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"c2d044ef-4c9d-4428-8939-fc7df13842ec","name":"Deleted Book Example","originalRequest":{"method":"DELETE","header":[],"url":"http://localhost:9000/books/4"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"39"},{"key":"ETag","value":"W/\"27-2sU+wH8LsO2HgYqDa0daGODIV30\""},{"key":"Date","value":"Mon, 16 Dec 2024 20:36:20 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Book deleted successfully\"\n}"}],"_postman_id":"43ae0dff-9670-4ee9-ae8c-d393c3b27ad8"}],"id":"c222da47-0be4-438b-aaee-2ebd69277043","description":"<h3 id=\"available-endpoints\">Available Endpoints</h3>\n<ol>\n<li><p><strong>Welcome Endpoint</strong></p>\n<ul>\n<li><p><strong>GET /</strong></p>\n</li>\n<li><p>Response: <code>Welcome to the Book Management API!</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Create a Book</strong></p>\n<ul>\n<li><p><strong>POST /books</strong></p>\n</li>\n<li><p>{ \"title\": \"Book Title\", \"author\": \"Author Name\", \"pages\": 123, \"published\": \"2024-01-01\"}</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Get All Books</strong></p>\n<ul>\n<li><strong>GET /books</strong></li>\n</ul>\n</li>\n<li><p><strong>Get a Book by ID</strong></p>\n<ul>\n<li><strong>GET /books/:id</strong></li>\n</ul>\n</li>\n<li><p><strong>Update a Book</strong></p>\n<ul>\n<li><p><strong>PUT /books/:id</strong></p>\n</li>\n<li><p>Payload (same as Create a Book)</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Delete a Book</strong></p>\n<ul>\n<li><strong>DELETE /books/:id</strong></li>\n</ul>\n</li>\n</ol>\n","_postman_id":"c222da47-0be4-438b-aaee-2ebd69277043","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","id":"2608eeac-ff2c-45b9-bc62-ac07ced2e99d","name":"Book Management System","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"{{token}}"}]}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""]}},{"listen":"test","script":{"type":"text/javascript","exec":[""]}}],"variable":[{"id":"1bcd335c-8130-4a0e-854f-13c02ee16a6b","key":"baseUrl","value":"https://farming-simulator.pstmn.io"}]}