├── README.md ├── backend ├── package-lock.json ├── package.json ├── server.js └── utilities │ ├── createDB.js │ ├── createTables.js │ └── credentials.js ├── frontend ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── Books │ │ ├── Books.css │ │ └── Books.js │ ├── Issue │ │ ├── Issue.css │ │ └── Issue.js │ ├── Nav │ │ ├── Nav.css │ │ └── Nav.js │ ├── Return │ │ ├── Return.css │ │ └── Return.js │ └── search │ │ ├── search.css │ │ └── search.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── serviceWorker.js │ └── setupTests.js └── screenshot ├── Issue.PNG ├── Return.PNG ├── Search.PNG └── home.PNG /README.md: -------------------------------------------------------------------------------- 1 | `A ReactJS + NodeJS App for library book management which allows issuing, returning and viewing options of current books in the library.` 2 | 3 | Open the project directory in a terminal, 4 | Then cd to frontend and run "npm init" to install the dependencies. 5 | Again then cd to backend directory and run "npm init", atlast run the command "npm run dev" to start the app. 6 | Concurrently package is used for running backend and frontend simultaneously. 7 | Frontend -> ReactJS. 8 | Backend -> NodeJS. 9 | The project uses MySQL Database, so for that I've used Xampp for creating the local server as well as mysql package. 10 | 11 | The project creates the database and tables by itself but all the initial student and books data has to be inserted directly. 12 | 13 | Database -> library 14 | 15 | Tables -> book - Books in the library 16 | student - Students related data 17 | borrow - Stores the student and corresponding issued books. 18 | 19 | NodeJS utitilities -> createDB -> Creates the database if it doesn't exist 20 | createTables -> Creates the tables if they doesn't exist 21 | credentials -> Xampp credentials, add password accordingly 22 | 23 | React Components -> Books -> List All the Books available 24 | Issue -> Issue a book 25 | Return -> List books issued by a student and option to return 26 | Search -> List students who have issued a particular book 27 | Nav -> Navbar 28 | -------------------------------------------------------------------------------- /backend/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.7", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 10 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 11 | "requires": { 12 | "mime-types": "~2.1.24", 13 | "negotiator": "0.6.2" 14 | } 15 | }, 16 | "ansi-regex": { 17 | "version": "4.1.0", 18 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 19 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" 20 | }, 21 | "ansi-styles": { 22 | "version": "3.2.1", 23 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 24 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 25 | "requires": { 26 | "color-convert": "^1.9.0" 27 | } 28 | }, 29 | "array-flatten": { 30 | "version": "1.1.1", 31 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 32 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 33 | }, 34 | "bignumber.js": { 35 | "version": "7.2.1", 36 | "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", 37 | "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" 38 | }, 39 | "body-parser": { 40 | "version": "1.19.0", 41 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 42 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 43 | "requires": { 44 | "bytes": "3.1.0", 45 | "content-type": "~1.0.4", 46 | "debug": "2.6.9", 47 | "depd": "~1.1.2", 48 | "http-errors": "1.7.2", 49 | "iconv-lite": "0.4.24", 50 | "on-finished": "~2.3.0", 51 | "qs": "6.7.0", 52 | "raw-body": "2.4.0", 53 | "type-is": "~1.6.17" 54 | } 55 | }, 56 | "bytes": { 57 | "version": "3.1.0", 58 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 59 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 60 | }, 61 | "camelcase": { 62 | "version": "5.3.1", 63 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 64 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" 65 | }, 66 | "chalk": { 67 | "version": "2.4.2", 68 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 69 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 70 | "requires": { 71 | "ansi-styles": "^3.2.1", 72 | "escape-string-regexp": "^1.0.5", 73 | "supports-color": "^5.3.0" 74 | }, 75 | "dependencies": { 76 | "supports-color": { 77 | "version": "5.5.0", 78 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 79 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 80 | "requires": { 81 | "has-flag": "^3.0.0" 82 | } 83 | } 84 | } 85 | }, 86 | "cliui": { 87 | "version": "5.0.0", 88 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", 89 | "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", 90 | "requires": { 91 | "string-width": "^3.1.0", 92 | "strip-ansi": "^5.2.0", 93 | "wrap-ansi": "^5.1.0" 94 | } 95 | }, 96 | "color-convert": { 97 | "version": "1.9.3", 98 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 99 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 100 | "requires": { 101 | "color-name": "1.1.3" 102 | } 103 | }, 104 | "color-name": { 105 | "version": "1.1.3", 106 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 107 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 108 | }, 109 | "concurrently": { 110 | "version": "5.0.2", 111 | "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-5.0.2.tgz", 112 | "integrity": "sha512-iUNVI6PzKO0RVXV9pHWM0khvEbELxf3XLIoChaV6hHyoIaJuxQWZiOwlNysnJX5khsfvIK66+OJqRdbYrdsR1g==", 113 | "requires": { 114 | "chalk": "^2.4.2", 115 | "date-fns": "^2.0.1", 116 | "lodash": "^4.17.15", 117 | "read-pkg": "^4.0.1", 118 | "rxjs": "^6.5.2", 119 | "spawn-command": "^0.0.2-1", 120 | "supports-color": "^6.1.0", 121 | "tree-kill": "^1.2.2", 122 | "yargs": "^13.3.0" 123 | } 124 | }, 125 | "content-disposition": { 126 | "version": "0.5.3", 127 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 128 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 129 | "requires": { 130 | "safe-buffer": "5.1.2" 131 | } 132 | }, 133 | "content-type": { 134 | "version": "1.0.4", 135 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 136 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 137 | }, 138 | "cookie": { 139 | "version": "0.4.0", 140 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 141 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 142 | }, 143 | "cookie-signature": { 144 | "version": "1.0.6", 145 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 146 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 147 | }, 148 | "core-util-is": { 149 | "version": "1.0.2", 150 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 151 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 152 | }, 153 | "date-fns": { 154 | "version": "2.8.1", 155 | "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.8.1.tgz", 156 | "integrity": "sha512-EL/C8IHvYRwAHYgFRse4MGAPSqlJVlOrhVYZ75iQBKrnv+ZedmYsgwH3t+BCDuZDXpoo07+q9j4qgSSOa7irJg==" 157 | }, 158 | "debug": { 159 | "version": "2.6.9", 160 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 161 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 162 | "requires": { 163 | "ms": "2.0.0" 164 | } 165 | }, 166 | "decamelize": { 167 | "version": "1.2.0", 168 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 169 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" 170 | }, 171 | "depd": { 172 | "version": "1.1.2", 173 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 174 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 175 | }, 176 | "destroy": { 177 | "version": "1.0.4", 178 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 179 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 180 | }, 181 | "ee-first": { 182 | "version": "1.1.1", 183 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 184 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 185 | }, 186 | "emoji-regex": { 187 | "version": "7.0.3", 188 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 189 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" 190 | }, 191 | "encodeurl": { 192 | "version": "1.0.2", 193 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 194 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 195 | }, 196 | "error-ex": { 197 | "version": "1.3.2", 198 | "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", 199 | "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", 200 | "requires": { 201 | "is-arrayish": "^0.2.1" 202 | } 203 | }, 204 | "escape-html": { 205 | "version": "1.0.3", 206 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 207 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 208 | }, 209 | "escape-string-regexp": { 210 | "version": "1.0.5", 211 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 212 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 213 | }, 214 | "etag": { 215 | "version": "1.8.1", 216 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 217 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 218 | }, 219 | "express": { 220 | "version": "4.17.1", 221 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 222 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 223 | "requires": { 224 | "accepts": "~1.3.7", 225 | "array-flatten": "1.1.1", 226 | "body-parser": "1.19.0", 227 | "content-disposition": "0.5.3", 228 | "content-type": "~1.0.4", 229 | "cookie": "0.4.0", 230 | "cookie-signature": "1.0.6", 231 | "debug": "2.6.9", 232 | "depd": "~1.1.2", 233 | "encodeurl": "~1.0.2", 234 | "escape-html": "~1.0.3", 235 | "etag": "~1.8.1", 236 | "finalhandler": "~1.1.2", 237 | "fresh": "0.5.2", 238 | "merge-descriptors": "1.0.1", 239 | "methods": "~1.1.2", 240 | "on-finished": "~2.3.0", 241 | "parseurl": "~1.3.3", 242 | "path-to-regexp": "0.1.7", 243 | "proxy-addr": "~2.0.5", 244 | "qs": "6.7.0", 245 | "range-parser": "~1.2.1", 246 | "safe-buffer": "5.1.2", 247 | "send": "0.17.1", 248 | "serve-static": "1.14.1", 249 | "setprototypeof": "1.1.1", 250 | "statuses": "~1.5.0", 251 | "type-is": "~1.6.18", 252 | "utils-merge": "1.0.1", 253 | "vary": "~1.1.2" 254 | } 255 | }, 256 | "finalhandler": { 257 | "version": "1.1.2", 258 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 259 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 260 | "requires": { 261 | "debug": "2.6.9", 262 | "encodeurl": "~1.0.2", 263 | "escape-html": "~1.0.3", 264 | "on-finished": "~2.3.0", 265 | "parseurl": "~1.3.3", 266 | "statuses": "~1.5.0", 267 | "unpipe": "~1.0.0" 268 | } 269 | }, 270 | "find-up": { 271 | "version": "3.0.0", 272 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", 273 | "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", 274 | "requires": { 275 | "locate-path": "^3.0.0" 276 | } 277 | }, 278 | "forwarded": { 279 | "version": "0.1.2", 280 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 281 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 282 | }, 283 | "fresh": { 284 | "version": "0.5.2", 285 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 286 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 287 | }, 288 | "get-caller-file": { 289 | "version": "2.0.5", 290 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 291 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" 292 | }, 293 | "has-flag": { 294 | "version": "3.0.0", 295 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 296 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 297 | }, 298 | "hosted-git-info": { 299 | "version": "2.8.5", 300 | "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", 301 | "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" 302 | }, 303 | "http-errors": { 304 | "version": "1.7.2", 305 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 306 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 307 | "requires": { 308 | "depd": "~1.1.2", 309 | "inherits": "2.0.3", 310 | "setprototypeof": "1.1.1", 311 | "statuses": ">= 1.5.0 < 2", 312 | "toidentifier": "1.0.0" 313 | } 314 | }, 315 | "iconv-lite": { 316 | "version": "0.4.24", 317 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 318 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 319 | "requires": { 320 | "safer-buffer": ">= 2.1.2 < 3" 321 | } 322 | }, 323 | "inherits": { 324 | "version": "2.0.3", 325 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 326 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 327 | }, 328 | "ipaddr.js": { 329 | "version": "1.9.0", 330 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", 331 | "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" 332 | }, 333 | "is-arrayish": { 334 | "version": "0.2.1", 335 | "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", 336 | "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" 337 | }, 338 | "is-fullwidth-code-point": { 339 | "version": "2.0.0", 340 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 341 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" 342 | }, 343 | "isarray": { 344 | "version": "1.0.0", 345 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 346 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 347 | }, 348 | "json-parse-better-errors": { 349 | "version": "1.0.2", 350 | "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", 351 | "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" 352 | }, 353 | "locate-path": { 354 | "version": "3.0.0", 355 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", 356 | "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", 357 | "requires": { 358 | "p-locate": "^3.0.0", 359 | "path-exists": "^3.0.0" 360 | } 361 | }, 362 | "lodash": { 363 | "version": "4.17.21", 364 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 365 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 366 | }, 367 | "media-typer": { 368 | "version": "0.3.0", 369 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 370 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 371 | }, 372 | "merge-descriptors": { 373 | "version": "1.0.1", 374 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 375 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 376 | }, 377 | "methods": { 378 | "version": "1.1.2", 379 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 380 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 381 | }, 382 | "mime": { 383 | "version": "1.6.0", 384 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 385 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 386 | }, 387 | "mime-db": { 388 | "version": "1.42.0", 389 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", 390 | "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" 391 | }, 392 | "mime-types": { 393 | "version": "2.1.25", 394 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", 395 | "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", 396 | "requires": { 397 | "mime-db": "1.42.0" 398 | } 399 | }, 400 | "ms": { 401 | "version": "2.0.0", 402 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 403 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 404 | }, 405 | "mysql": { 406 | "version": "2.17.1", 407 | "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.17.1.tgz", 408 | "integrity": "sha512-7vMqHQ673SAk5C8fOzTG2LpPcf3bNt0oL3sFpxPEEFp1mdlDcrLK0On7z8ZYKaaHrHwNcQ/MTUz7/oobZ2OyyA==", 409 | "requires": { 410 | "bignumber.js": "7.2.1", 411 | "readable-stream": "2.3.6", 412 | "safe-buffer": "5.1.2", 413 | "sqlstring": "2.3.1" 414 | } 415 | }, 416 | "negotiator": { 417 | "version": "0.6.2", 418 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 419 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 420 | }, 421 | "normalize-package-data": { 422 | "version": "2.5.0", 423 | "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", 424 | "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", 425 | "requires": { 426 | "hosted-git-info": "^2.1.4", 427 | "resolve": "^1.10.0", 428 | "semver": "2 || 3 || 4 || 5", 429 | "validate-npm-package-license": "^3.0.1" 430 | } 431 | }, 432 | "on-finished": { 433 | "version": "2.3.0", 434 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 435 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 436 | "requires": { 437 | "ee-first": "1.1.1" 438 | } 439 | }, 440 | "p-limit": { 441 | "version": "2.2.1", 442 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", 443 | "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", 444 | "requires": { 445 | "p-try": "^2.0.0" 446 | } 447 | }, 448 | "p-locate": { 449 | "version": "3.0.0", 450 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", 451 | "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", 452 | "requires": { 453 | "p-limit": "^2.0.0" 454 | } 455 | }, 456 | "p-try": { 457 | "version": "2.2.0", 458 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 459 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" 460 | }, 461 | "parse-json": { 462 | "version": "4.0.0", 463 | "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", 464 | "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", 465 | "requires": { 466 | "error-ex": "^1.3.1", 467 | "json-parse-better-errors": "^1.0.1" 468 | } 469 | }, 470 | "parseurl": { 471 | "version": "1.3.3", 472 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 473 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 474 | }, 475 | "path-exists": { 476 | "version": "3.0.0", 477 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 478 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" 479 | }, 480 | "path-parse": { 481 | "version": "1.0.6", 482 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 483 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" 484 | }, 485 | "path-to-regexp": { 486 | "version": "0.1.7", 487 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 488 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 489 | }, 490 | "pify": { 491 | "version": "3.0.0", 492 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", 493 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" 494 | }, 495 | "process-nextick-args": { 496 | "version": "2.0.1", 497 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 498 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 499 | }, 500 | "proxy-addr": { 501 | "version": "2.0.5", 502 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", 503 | "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", 504 | "requires": { 505 | "forwarded": "~0.1.2", 506 | "ipaddr.js": "1.9.0" 507 | } 508 | }, 509 | "qs": { 510 | "version": "6.7.0", 511 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 512 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 513 | }, 514 | "range-parser": { 515 | "version": "1.2.1", 516 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 517 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 518 | }, 519 | "raw-body": { 520 | "version": "2.4.0", 521 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 522 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 523 | "requires": { 524 | "bytes": "3.1.0", 525 | "http-errors": "1.7.2", 526 | "iconv-lite": "0.4.24", 527 | "unpipe": "1.0.0" 528 | } 529 | }, 530 | "read-pkg": { 531 | "version": "4.0.1", 532 | "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", 533 | "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", 534 | "requires": { 535 | "normalize-package-data": "^2.3.2", 536 | "parse-json": "^4.0.0", 537 | "pify": "^3.0.0" 538 | } 539 | }, 540 | "readable-stream": { 541 | "version": "2.3.6", 542 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 543 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 544 | "requires": { 545 | "core-util-is": "~1.0.0", 546 | "inherits": "~2.0.3", 547 | "isarray": "~1.0.0", 548 | "process-nextick-args": "~2.0.0", 549 | "safe-buffer": "~5.1.1", 550 | "string_decoder": "~1.1.1", 551 | "util-deprecate": "~1.0.1" 552 | } 553 | }, 554 | "require-directory": { 555 | "version": "2.1.1", 556 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 557 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" 558 | }, 559 | "require-main-filename": { 560 | "version": "2.0.0", 561 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", 562 | "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" 563 | }, 564 | "resolve": { 565 | "version": "1.14.1", 566 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", 567 | "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", 568 | "requires": { 569 | "path-parse": "^1.0.6" 570 | } 571 | }, 572 | "rxjs": { 573 | "version": "6.5.3", 574 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", 575 | "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", 576 | "requires": { 577 | "tslib": "^1.9.0" 578 | } 579 | }, 580 | "safe-buffer": { 581 | "version": "5.1.2", 582 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 583 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 584 | }, 585 | "safer-buffer": { 586 | "version": "2.1.2", 587 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 588 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 589 | }, 590 | "semver": { 591 | "version": "5.7.1", 592 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 593 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 594 | }, 595 | "send": { 596 | "version": "0.17.1", 597 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 598 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 599 | "requires": { 600 | "debug": "2.6.9", 601 | "depd": "~1.1.2", 602 | "destroy": "~1.0.4", 603 | "encodeurl": "~1.0.2", 604 | "escape-html": "~1.0.3", 605 | "etag": "~1.8.1", 606 | "fresh": "0.5.2", 607 | "http-errors": "~1.7.2", 608 | "mime": "1.6.0", 609 | "ms": "2.1.1", 610 | "on-finished": "~2.3.0", 611 | "range-parser": "~1.2.1", 612 | "statuses": "~1.5.0" 613 | }, 614 | "dependencies": { 615 | "ms": { 616 | "version": "2.1.1", 617 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 618 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 619 | } 620 | } 621 | }, 622 | "serve-static": { 623 | "version": "1.14.1", 624 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 625 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 626 | "requires": { 627 | "encodeurl": "~1.0.2", 628 | "escape-html": "~1.0.3", 629 | "parseurl": "~1.3.3", 630 | "send": "0.17.1" 631 | } 632 | }, 633 | "set-blocking": { 634 | "version": "2.0.0", 635 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 636 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 637 | }, 638 | "setprototypeof": { 639 | "version": "1.1.1", 640 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 641 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 642 | }, 643 | "spawn-command": { 644 | "version": "0.0.2-1", 645 | "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", 646 | "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=" 647 | }, 648 | "spdx-correct": { 649 | "version": "3.1.0", 650 | "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", 651 | "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", 652 | "requires": { 653 | "spdx-expression-parse": "^3.0.0", 654 | "spdx-license-ids": "^3.0.0" 655 | } 656 | }, 657 | "spdx-exceptions": { 658 | "version": "2.2.0", 659 | "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", 660 | "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" 661 | }, 662 | "spdx-expression-parse": { 663 | "version": "3.0.0", 664 | "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", 665 | "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", 666 | "requires": { 667 | "spdx-exceptions": "^2.1.0", 668 | "spdx-license-ids": "^3.0.0" 669 | } 670 | }, 671 | "spdx-license-ids": { 672 | "version": "3.0.5", 673 | "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", 674 | "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" 675 | }, 676 | "sqlstring": { 677 | "version": "2.3.1", 678 | "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", 679 | "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=" 680 | }, 681 | "statuses": { 682 | "version": "1.5.0", 683 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 684 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 685 | }, 686 | "string-width": { 687 | "version": "3.1.0", 688 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 689 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 690 | "requires": { 691 | "emoji-regex": "^7.0.1", 692 | "is-fullwidth-code-point": "^2.0.0", 693 | "strip-ansi": "^5.1.0" 694 | } 695 | }, 696 | "string_decoder": { 697 | "version": "1.1.1", 698 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 699 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 700 | "requires": { 701 | "safe-buffer": "~5.1.0" 702 | } 703 | }, 704 | "strip-ansi": { 705 | "version": "5.2.0", 706 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 707 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 708 | "requires": { 709 | "ansi-regex": "^4.1.0" 710 | } 711 | }, 712 | "supports-color": { 713 | "version": "6.1.0", 714 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", 715 | "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", 716 | "requires": { 717 | "has-flag": "^3.0.0" 718 | } 719 | }, 720 | "toidentifier": { 721 | "version": "1.0.0", 722 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 723 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 724 | }, 725 | "tree-kill": { 726 | "version": "1.2.2", 727 | "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", 728 | "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==" 729 | }, 730 | "tslib": { 731 | "version": "1.10.0", 732 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", 733 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" 734 | }, 735 | "type-is": { 736 | "version": "1.6.18", 737 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 738 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 739 | "requires": { 740 | "media-typer": "0.3.0", 741 | "mime-types": "~2.1.24" 742 | } 743 | }, 744 | "unpipe": { 745 | "version": "1.0.0", 746 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 747 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 748 | }, 749 | "util-deprecate": { 750 | "version": "1.0.2", 751 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 752 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 753 | }, 754 | "utils-merge": { 755 | "version": "1.0.1", 756 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 757 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 758 | }, 759 | "validate-npm-package-license": { 760 | "version": "3.0.4", 761 | "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", 762 | "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", 763 | "requires": { 764 | "spdx-correct": "^3.0.0", 765 | "spdx-expression-parse": "^3.0.0" 766 | } 767 | }, 768 | "vary": { 769 | "version": "1.1.2", 770 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 771 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 772 | }, 773 | "which-module": { 774 | "version": "2.0.0", 775 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 776 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" 777 | }, 778 | "wrap-ansi": { 779 | "version": "5.1.0", 780 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", 781 | "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", 782 | "requires": { 783 | "ansi-styles": "^3.2.0", 784 | "string-width": "^3.0.0", 785 | "strip-ansi": "^5.0.0" 786 | } 787 | }, 788 | "y18n": { 789 | "version": "4.0.1", 790 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", 791 | "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==" 792 | }, 793 | "yargs": { 794 | "version": "13.3.0", 795 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", 796 | "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", 797 | "requires": { 798 | "cliui": "^5.0.0", 799 | "find-up": "^3.0.0", 800 | "get-caller-file": "^2.0.1", 801 | "require-directory": "^2.1.1", 802 | "require-main-filename": "^2.0.0", 803 | "set-blocking": "^2.0.0", 804 | "string-width": "^3.0.0", 805 | "which-module": "^2.0.0", 806 | "y18n": "^4.0.0", 807 | "yargs-parser": "^13.1.1" 808 | } 809 | }, 810 | "yargs-parser": { 811 | "version": "13.1.2", 812 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", 813 | "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", 814 | "requires": { 815 | "camelcase": "^5.0.0", 816 | "decamelize": "^1.2.0" 817 | } 818 | } 819 | } 820 | } 821 | -------------------------------------------------------------------------------- /backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "server": "nodemon server.js", 9 | "client": "cd.. && npm start --prefix frontend", 10 | "dev": "concurrently \"npm run server\" \"npm run client\"" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "concurrently": "^5.0.2", 16 | "express": "^4.17.1", 17 | "mysql": "^2.17.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const mysql = require('mysql'); 3 | const DATABASE = require('./utilities/createDB'); 4 | const TABLES = require('./utilities/createTables'); 5 | const cred = require('./utilities/credentials'); 6 | 7 | class LIBRARY { 8 | 9 | constructor(port, app) { 10 | 11 | this.port = port; 12 | this.app = app; 13 | this.app.use(express.json()) 14 | this.temp = 0; 15 | 16 | //Initialize Database 17 | new DATABASE().initDB(); 18 | 19 | //Initialize All The Tables 20 | new TABLES().initTable(); 21 | 22 | this.db = mysql.createConnection({ 23 | ...cred, 24 | database: 'library' 25 | }); 26 | 27 | } 28 | 29 | get() { 30 | 31 | //GET LIST OF ALL THE BOOKS 32 | this.app.get('/api/getBooks', (req, res) => { 33 | let sql = `SELECT * FROM book`; 34 | this.db.query(sql, (err, result) => { 35 | if(err) 36 | console.log(err); 37 | else 38 | console.log("Successfully extracted books"); 39 | res.send(result); 40 | }); 41 | }); 42 | 43 | //GET LIST OF BOOKS BY SEMESTER 44 | this.app.get('/api/getBooks/:id', (req, res) => { 45 | let sql = `SELECT * FROM book where semester = '${req.params.id}'`; 46 | this.db.query(sql, (err, result) => { 47 | if(err) 48 | console.log(err); 49 | else 50 | console.log("Successfully extracted books"); 51 | res.send(result); 52 | }); 53 | }); 54 | 55 | //BORROW A BOOK 56 | this.app.post('/api/borrow', (req, res) => { 57 | let sql = [`INSERT INTO BORROW(idStudent, idBook) VALUES (${req.body.sid}, ${req.body.id});`, 58 | `Update BOOK SET count = count - 1 WHERE id = ${req.body.id}`]; 59 | 60 | for(let i = 0; i < sql.length; i++){ 61 | this.db.query(sql[i], (err, result) => { 62 | if(err){ 63 | console.log("Couldn't add"); 64 | this.temp = 1; 65 | } 66 | else 67 | console.log("Successfully inserted"); 68 | }); 69 | if(this.temp) 70 | break; 71 | } 72 | }); 73 | 74 | //GET ALL THE ISSUED BOOKS BY A STUDENT 75 | this.app.get('/api/getIssues/:sid', (req, res) => { 76 | 77 | let sql = `SELECT book.name, book.author, book.semester, book.id, borrow.date, borrow.deadline, student.name as sname\ 78 | FROM book, student, borrow\ 79 | where borrow.idStudent = '${req.params.sid}' and book.id = borrow.idBook and student.id = '${req.params.sid}'`; 80 | 81 | this.db.query(sql, (err, result) => { 82 | if(err) 83 | console.log(err); 84 | else 85 | console.log("Successfully extracted issues"); 86 | res.send(result); 87 | }); 88 | }); 89 | 90 | //RETURN A BOOK, UPDATE FINE IF ANY 91 | this.app.post('/api/return', (req, res) => { 92 | 93 | let sql = [`SELECT deadline from borrow\ 94 | WHERE idBook = ${req.body.id} and idStudent = ${req.body.sid}`, 95 | `DELETE FROM borrow where idStudent = ${req.body.sid} and idBook = ${req.body.id}`, 96 | `UPDATE BOOK SET count = count + 1 WHERE id = ${req.body.id}`]; 97 | 98 | for(let i = 0; i < sql.length; i++){ 99 | this.db.query(sql[i], (err, result) => { 100 | if(err){ 101 | console.log("Couldn't return"); 102 | } 103 | 104 | //FOR FINE 105 | else if(i == 0){ 106 | var d1 = new Date(result[0].deadline); 107 | var d2 = new Date() 108 | const timeDiff = d2 - d1; 109 | const daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); 110 | if(daysDiff > 0) { 111 | this.db.query(`UPDATE STUDENT SET fine = fine + ${(daysDiff - 1) * 10} WHERE id = '${req.body.sid}'`, (err, result) => { 112 | if(err) 113 | console.log(err); 114 | else 115 | console.log("Fine Updated Succesfully"); 116 | }); 117 | } 118 | } 119 | 120 | }); 121 | } 122 | }); 123 | 124 | //GET ALL THE STUDENTS WHO HAVE ISSUED A PARTICULAR BOOK 125 | this.app.get('/api/students/:id', (req, res) => { 126 | 127 | let sql = `SELECT student.name, borrow.date, borrow.deadline\ 128 | FROM student, borrow\ 129 | where borrow.idBook = '${req.params.id}' and student.id = borrow.idStudent`; 130 | 131 | this.db.query(sql, (err, result) => { 132 | if(err) 133 | console.log("Couldn't get issues"); 134 | else 135 | console.log("Successfully extracted issues"); 136 | res.send(result); 137 | }); 138 | }); 139 | } 140 | 141 | listen() { 142 | this.app.listen(this.port, (err) => { 143 | if(err) 144 | console.log(err); 145 | else 146 | console.log(`Server Started On ${this.port}`); 147 | }) 148 | } 149 | 150 | } 151 | 152 | let library = new LIBRARY(3001, express()); 153 | library.get(); 154 | library.listen(); -------------------------------------------------------------------------------- /backend/utilities/createDB.js: -------------------------------------------------------------------------------- 1 | const mysql = require('mysql'); 2 | const cred = require('./credentials'); 3 | 4 | class DATABASE { 5 | 6 | constructor(){ 7 | this.db = mysql.createConnection(cred); 8 | this.sql = "CREATE DATABASE IF NOT EXISTS library"; 9 | } 10 | 11 | initDB() { 12 | this.db.query(this.sql, (err, result) => { 13 | if(err) 14 | console.log("Couldn't create database"); 15 | else 16 | console.log(`Successfully created database `); 17 | }) 18 | } 19 | } 20 | 21 | module.exports = DATABASE; -------------------------------------------------------------------------------- /backend/utilities/createTables.js: -------------------------------------------------------------------------------- 1 | const mysql = require('mysql'); 2 | const cred = require('./credentials'); 3 | 4 | class TABLES { 5 | 6 | constructor(){ 7 | 8 | this.db = mysql.createConnection({ 9 | ...cred, 10 | database: 'library' 11 | }); 12 | 13 | this.sql = { 14 | student: 'CREATE TABLE IF NOT EXISTS STUDENT(id int AUTO_INCREMENT, name VARCHAR(255), fine float(6,2) DEFAULT 0, PRIMARY KEY (id))', 15 | books: 'CREATE TABLE IF NOT EXISTS BOOK(id int AUTO_INCREMENT, name VARCHAR(255), author VARCHAR(255), semester int(1), count int, PRIMARY KEY (id))', 16 | borrow: "CREATE TABLE IF NOT EXISTS BORROW(idStudent int, idBook int, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, deadline TIMESTAMP DEFAULT DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 7 DAY),\ 17 | PRIMARY KEY (idStudent, idBook),\ 18 | FOREIGN KEY(idStudent) REFERENCES STUDENT(id),\ 19 | FOREIGN KEY(idBook) REFERENCES BOOK(id))" 20 | }; 21 | 22 | } 23 | 24 | initTable() { 25 | for(let i in this.sql){ 26 | this.db.query(this.sql[i], (err, result) => { 27 | if(err) 28 | console.log(`Couldn't create table ${i}`); 29 | else 30 | console.log(`Successfully created table ${i}`); 31 | }) 32 | } 33 | } 34 | } 35 | 36 | module.exports = TABLES; -------------------------------------------------------------------------------- /backend/utilities/credentials.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | host: 'localhost', 3 | user: 'root', 4 | password: 'qwerty' 5 | }; -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@material-ui/core": "^4.8.1", 7 | "@testing-library/jest-dom": "^4.2.4", 8 | "@testing-library/react": "^9.4.0", 9 | "@testing-library/user-event": "^7.2.1", 10 | "axios": "^0.21.1", 11 | "react": "^16.12.0", 12 | "react-dom": "^16.12.0", 13 | "react-router-dom": "^5.1.2", 14 | "react-scripts": "3.3.0" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": "react-app" 24 | }, 25 | "browserslist": { 26 | "production": [ 27 | ">0.2%", 28 | "not dead", 29 | "not op_mini all" 30 | ], 31 | "development": [ 32 | "last 1 chrome version", 33 | "last 1 firefox version", 34 | "last 1 safari version" 35 | ] 36 | }, 37 | "proxy": "http://localhost:3001" 38 | } 39 | -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | 28 | React App 29 | 30 | 31 | 32 |
33 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/frontend/public/logo192.png -------------------------------------------------------------------------------- /frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/frontend/public/logo512.png -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: none; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Nav from './components/Nav/Nav'; 3 | import Books from './components/Books/Books'; 4 | import Issue from './components/Issue/Issue'; 5 | import Return from './components/Return/Return'; 6 | import Search from './components/search/search'; 7 | import './App.css'; 8 | import {Route, Redirect, Switch} from 'react-router-dom'; 9 | 10 | class App extends React.Component { 11 | 12 | render(){ 13 | return ( 14 |
15 |
24 | ); 25 | } 26 | } 27 | 28 | export default App; 29 | -------------------------------------------------------------------------------- /frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /frontend/src/components/Books/Books.css: -------------------------------------------------------------------------------- 1 | #books { 2 | margin: auto; 3 | text-align: center; 4 | } 5 | 6 | #sel { 7 | width: 35%; 8 | margin: 10px auto; 9 | } 10 | 11 | #results { 12 | margin: 25px auto; 13 | width: 60%; 14 | border-radius: 8px; 15 | background-color: rgb(111, 167, 219); 16 | } 17 | 18 | .table td { 19 | vertical-align: middle; 20 | } 21 | 22 | #heading { 23 | font-family: Georgia, 'Times New Roman', Times, serif; 24 | font-size: 1.5em; 25 | } -------------------------------------------------------------------------------- /frontend/src/components/Books/Books.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Books.css'; 3 | 4 | class Books extends React.Component { 5 | 6 | state = { 7 | header: 8 | 9 | Book Name 10 | Author 11 | Total Count 12 | Semester No 13 | 14 | , 15 | books: [] 16 | }; 17 | 18 | async componentDidMount() { 19 | await fetch("/api/getBooks") 20 | .then(res => res.json()) 21 | .then(books => { 22 | books.map( 23 | el => { 24 | if(el.count > 0) { 25 | this.setState({ 26 | books: [...this.state.books, 27 | 28 | {el.name.toUpperCase()} 29 | {el.author} 30 | {el.count} 31 | {el.semester} 32 | ] 33 | }) 34 | } 35 | return el; 36 | }) 37 | }); 38 | } 39 | 40 | render() { 41 | return ( 42 |
43 | AVAILABLE BOOKS 44 | 45 | {this.state.header} 46 | 47 | {this.state.books} 48 | 49 |
50 |
51 | ); 52 | } 53 | 54 | } 55 | 56 | export default Books; -------------------------------------------------------------------------------- /frontend/src/components/Issue/Issue.css: -------------------------------------------------------------------------------- 1 | #isssue { 2 | margin: auto; 3 | } 4 | 5 | .sel { 6 | width: 35%; 7 | margin: 10px auto; 8 | } 9 | 10 | #results { 11 | margin: 25px auto; 12 | width: 60%; 13 | border-radius: 8px; 14 | background-color: rgb(111, 167, 219); 15 | } 16 | 17 | .table td { 18 | vertical-align: middle; 19 | } -------------------------------------------------------------------------------- /frontend/src/components/Issue/Issue.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Issue.css'; 3 | 4 | class Books extends React.Component { 5 | 6 | state = { 7 | header: , 8 | books: [] 9 | }; 10 | 11 | fetchData = () => { 12 | var sem = document.getElementById('select').value; 13 | this.setState({header: 14 | 15 | Book Name 16 | Author 17 | Semester No 18 | 19 | 20 | , 21 | books: []}); 22 | 23 | fetch(`/api/getBooks/${sem}`) 24 | .then(res => res.json()) 25 | .then(books => 26 | books.forEach( 27 | el => this.setState({ 28 | books: [...this.state.books, 29 | 30 | {el.name.toUpperCase()} 31 | {el.author} 32 | {el.semester} 33 | 34 | ] 35 | }))); 36 | } 37 | 38 | componentDidMount() { 39 | if(document.getElementById('id').value === '') 40 | document.getElementById('select').disabled = true; 41 | else 42 | document.getElementById('select').disabled = false; 43 | } 44 | 45 | issueIt = el => { 46 | fetch('/api/borrow', { 47 | method: 'post', 48 | headers: {'Content-Type':'application/json'}, 49 | body: JSON.stringify({ 50 | ...el, 51 | sid: parseInt(document.getElementById('id').value) 52 | }) 53 | }); 54 | /*.then(res => { 55 | fetch('/api/borrowed') 56 | .then(res => res.json()) 57 | .then(e => console.log(e)); 58 | });*/ 59 | 60 | } 61 | 62 | render() { 63 | return ( 64 |
65 |
66 | 67 | 78 | 79 |
80 | 81 | {this.state.header} 82 | 83 | {this.state.books} 84 | 85 |
86 |
87 | ); 88 | } 89 | 90 | } 91 | 92 | export default Books; -------------------------------------------------------------------------------- /frontend/src/components/Nav/Nav.css: -------------------------------------------------------------------------------- 1 | #nav { 2 | background-color: #2196F3; 3 | min-height: 60px; 4 | margin-bottom: 50px; 5 | } 6 | 7 | #nav ul { 8 | list-style-type: none; 9 | float: right; 10 | } 11 | 12 | #nav ul li { 13 | display: inline; 14 | padding: 10px 15px; 15 | font-size: 1.3em; 16 | } 17 | 18 | a, a:hover { 19 | text-decoration: none; 20 | color: #282c34; 21 | } 22 | 23 | #nav span { 24 | position: absolute; 25 | float: none; 26 | font-size: 1.5em; 27 | top: 3.5%; 28 | left: 50%; 29 | transform: translate(-50%, -50%); 30 | } -------------------------------------------------------------------------------- /frontend/src/components/Nav/Nav.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Nav.css'; 3 | import { Link } from 'react-router-dom'; 4 | 5 | class Nav extends React.Component { 6 | 7 | constructor(props) { 8 | super(props); 9 | this.update = this.update.bind(this); 10 | } 11 | 12 | state = {}; 13 | 14 | update() { 15 | this.setState(this.state); 16 | } 17 | 18 | render(){ 19 | return ( 20 | 29 | ); 30 | } 31 | } 32 | 33 | export default Nav; -------------------------------------------------------------------------------- /frontend/src/components/Return/Return.css: -------------------------------------------------------------------------------- 1 | #return { 2 | margin: auto; 3 | } 4 | 5 | #rResults { 6 | margin: 25px auto; 7 | width: 60%; 8 | border-radius: 8px; 9 | background-color: rgb(111, 167, 219); 10 | } 11 | 12 | .table td { 13 | vertical-align: middle; 14 | } -------------------------------------------------------------------------------- /frontend/src/components/Return/Return.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Return.css'; 3 | 4 | class Return extends React.Component { 5 | 6 | state = { 7 | header: , 8 | books: [], 9 | name: '' 10 | }; 11 | 12 | fetchData = () => { 13 | var sid = document.getElementById('sid').value; 14 | this.setState({header: 15 | 16 | Book Name 17 | Author 18 | Semester No 19 | Issue Date 20 | Return Deadline 21 | 22 | 23 | , 24 | books: []}); 25 | 26 | fetch(`/api/getIssues/${sid}`) 27 | .then(res => res.json()) 28 | .then(books => { 29 | if(books.length > 0) { 30 | this.setState({...this.state, name: `Books Issued By ${books[0].sname}`}); 31 | books.forEach( 32 | el => this.setState({ 33 | books: [...this.state.books, 34 | 35 | {el.name.toUpperCase()} 36 | {el.author} 37 | {el.semester} 38 | {el.date} 39 | {el.deadline} 40 | 41 | ] 42 | })) 43 | } 44 | else{ 45 | this.setState({header: []}); 46 | this.setState({...this.state, name: "No Books Issued By The Student"}); 47 | } 48 | }); 49 | } 50 | 51 | returnIt = el => { 52 | fetch('/api/return', { 53 | method: 'post', 54 | headers: {'Content-Type':'application/json'}, 55 | body: JSON.stringify({ 56 | ...el, 57 | sid: parseInt(document.getElementById('sid').value) 58 | }) 59 | }); 60 | 61 | } 62 | 63 | render() { 64 | return ( 65 |
66 |
67 | 68 | 69 |

70 | {this.state.name} 71 | 72 | {this.state.header} 73 | 74 | {this.state.books} 75 | 76 |
77 |
78 | ); 79 | } 80 | 81 | } 82 | 83 | export default Return; -------------------------------------------------------------------------------- /frontend/src/components/search/search.css: -------------------------------------------------------------------------------- 1 | #search { 2 | margin: auto; 3 | } 4 | 5 | #sResults { 6 | margin: 25px auto; 7 | width: 60%; 8 | border-radius: 8px; 9 | background-color: rgb(111, 167, 219); 10 | } 11 | 12 | .table td { 13 | vertical-align: middle; 14 | } -------------------------------------------------------------------------------- /frontend/src/components/search/search.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './search.css'; 3 | 4 | class Books extends React.Component { 5 | 6 | state = { 7 | header: , 8 | books: [], 9 | name: '' 10 | }; 11 | 12 | fetchData = () => { 13 | var id = document.getElementById('id').value; 14 | this.setState({header: 15 | 16 | Student Name 17 | Issue Date 18 | Return Deadline 19 | 20 | , 21 | books: []}); 22 | 23 | fetch(`/api/students/${id}`) 24 | .then(res => res.json()) 25 | .then(student => { 26 | if(student.length > 0) { 27 | this.setState({...this.state, name: `Following Students Issued This Book`}); 28 | student.forEach( 29 | el => this.setState({ 30 | books: [...this.state.books, 31 | 32 | {el.name.toUpperCase()} 33 | {el.date} 34 | {el.deadline} 35 | ] 36 | })) 37 | } 38 | else{ 39 | this.setState({header: []}); 40 | this.setState({...this.state, name: "No One Have Issued This Book"}); 41 | } 42 | }); 43 | } 44 | 45 | returnIt = el => { 46 | fetch('/api/return', { 47 | method: 'post', 48 | headers: {'Content-Type':'application/json'}, 49 | body: JSON.stringify({ 50 | ...el, 51 | sid: parseInt(document.getElementById('sid').value) 52 | }) 53 | }); 54 | 55 | } 56 | 57 | render() { 58 | return ( 59 | 72 | ); 73 | } 74 | 75 | } 76 | 77 | export default Books; -------------------------------------------------------------------------------- /frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | import { BrowserRouter } from 'react-router-dom'; 7 | 8 | ReactDOM.render( 9 | 10 | 11 | 12 | , document.getElementById('root')); 13 | 14 | // If you want your app to work offline and load faster, you can change 15 | // unregister() to register() below. Note this comes with some pitfalls. 16 | // Learn more about service workers: https://bit.ly/CRA-PWA 17 | serviceWorker.unregister(); 18 | -------------------------------------------------------------------------------- /frontend/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /frontend/src/serviceWorker.js: -------------------------------------------------------------------------------- 1 | // This optional code is used to register a service worker. 2 | // register() is not called by default. 3 | 4 | // This lets the app load faster on subsequent visits in production, and gives 5 | // it offline capabilities. However, it also means that developers (and users) 6 | // will only see deployed updates on subsequent visits to a page, after all the 7 | // existing tabs open on the page have been closed, since previously cached 8 | // resources are updated in the background. 9 | 10 | // To learn more about the benefits of this model and instructions on how to 11 | // opt-in, read https://bit.ly/CRA-PWA 12 | 13 | const isLocalhost = Boolean( 14 | window.location.hostname === 'localhost' || 15 | // [::1] is the IPv6 localhost address. 16 | window.location.hostname === '[::1]' || 17 | // 127.0.0.0/8 are considered localhost for IPv4. 18 | window.location.hostname.match( 19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ 20 | ) 21 | ); 22 | 23 | export function register(config) { 24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 25 | // The URL constructor is available in all browsers that support SW. 26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); 27 | if (publicUrl.origin !== window.location.origin) { 28 | // Our service worker won't work if PUBLIC_URL is on a different origin 29 | // from what our page is served on. This might happen if a CDN is used to 30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374 31 | return; 32 | } 33 | 34 | window.addEventListener('load', () => { 35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 36 | 37 | if (isLocalhost) { 38 | // This is running on localhost. Let's check if a service worker still exists or not. 39 | checkValidServiceWorker(swUrl, config); 40 | 41 | // Add some additional logging to localhost, pointing developers to the 42 | // service worker/PWA documentation. 43 | navigator.serviceWorker.ready.then(() => { 44 | console.log( 45 | 'This web app is being served cache-first by a service ' + 46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA' 47 | ); 48 | }); 49 | } else { 50 | // Is not localhost. Just register service worker 51 | registerValidSW(swUrl, config); 52 | } 53 | }); 54 | } 55 | } 56 | 57 | function registerValidSW(swUrl, config) { 58 | navigator.serviceWorker 59 | .register(swUrl) 60 | .then(registration => { 61 | registration.onupdatefound = () => { 62 | const installingWorker = registration.installing; 63 | if (installingWorker == null) { 64 | return; 65 | } 66 | installingWorker.onstatechange = () => { 67 | if (installingWorker.state === 'installed') { 68 | if (navigator.serviceWorker.controller) { 69 | // At this point, the updated precached content has been fetched, 70 | // but the previous service worker will still serve the older 71 | // content until all client tabs are closed. 72 | console.log( 73 | 'New content is available and will be used when all ' + 74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' 75 | ); 76 | 77 | // Execute callback 78 | if (config && config.onUpdate) { 79 | config.onUpdate(registration); 80 | } 81 | } else { 82 | // At this point, everything has been precached. 83 | // It's the perfect time to display a 84 | // "Content is cached for offline use." message. 85 | console.log('Content is cached for offline use.'); 86 | 87 | // Execute callback 88 | if (config && config.onSuccess) { 89 | config.onSuccess(registration); 90 | } 91 | } 92 | } 93 | }; 94 | }; 95 | }) 96 | .catch(error => { 97 | console.error('Error during service worker registration:', error); 98 | }); 99 | } 100 | 101 | function checkValidServiceWorker(swUrl, config) { 102 | // Check if the service worker can be found. If it can't reload the page. 103 | fetch(swUrl, { 104 | headers: { 'Service-Worker': 'script' } 105 | }) 106 | .then(response => { 107 | // Ensure service worker exists, and that we really are getting a JS file. 108 | const contentType = response.headers.get('content-type'); 109 | if ( 110 | response.status === 404 || 111 | (contentType != null && contentType.indexOf('javascript') === -1) 112 | ) { 113 | // No service worker found. Probably a different app. Reload the page. 114 | navigator.serviceWorker.ready.then(registration => { 115 | registration.unregister().then(() => { 116 | window.location.reload(); 117 | }); 118 | }); 119 | } else { 120 | // Service worker found. Proceed as normal. 121 | registerValidSW(swUrl, config); 122 | } 123 | }) 124 | .catch(() => { 125 | console.log( 126 | 'No internet connection found. App is running in offline mode.' 127 | ); 128 | }); 129 | } 130 | 131 | export function unregister() { 132 | if ('serviceWorker' in navigator) { 133 | navigator.serviceWorker.ready.then(registration => { 134 | registration.unregister(); 135 | }); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /screenshot/Issue.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/screenshot/Issue.PNG -------------------------------------------------------------------------------- /screenshot/Return.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/screenshot/Return.PNG -------------------------------------------------------------------------------- /screenshot/Search.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/screenshot/Search.PNG -------------------------------------------------------------------------------- /screenshot/home.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinceRajRoy/Library-Management-System/c894eb83898d153e0a72c987b3f8b160d3e4e2a1/screenshot/home.PNG --------------------------------------------------------------------------------