├── .github └── workflows │ ├── config.yml │ └── deploy.sh ├── .gitignore ├── .gitignore_cicd ├── client ├── README.md ├── build │ ├── asset-manifest.json │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ ├── precache-manifest.0699d5c9698c486c05b4904bd5856d75.js │ ├── robots.txt │ ├── service-worker.js │ └── static │ │ ├── css │ │ ├── main.cf6385ff.chunk.css │ │ └── main.cf6385ff.chunk.css.map │ │ └── js │ │ ├── 2.3c07f4e1.chunk.js │ │ ├── 2.3c07f4e1.chunk.js.LICENSE.txt │ │ ├── 2.3c07f4e1.chunk.js.map │ │ ├── main.bb3a1453.chunk.js │ │ ├── main.bb3a1453.chunk.js.map │ │ ├── runtime-main.09b85ec0.js │ │ └── runtime-main.09b85ec0.js.map ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── src │ ├── components │ │ ├── Chat │ │ │ └── index.tsx │ │ ├── Home │ │ │ ├── index.tsx │ │ │ └── style.css │ │ ├── Login │ │ │ ├── index.tsx │ │ │ └── style.css │ │ ├── Register │ │ │ ├── index.tsx │ │ │ └── style.css │ │ └── index.tsx │ ├── index.css │ ├── index.tsx │ ├── react-app-env.d.ts │ └── utility.ts ├── tsconfig.json └── yarn.lock └── server ├── build ├── models │ ├── messages.js │ └── user.js ├── server.js ├── utilities.js ├── websocket.js └── wsfunc.js ├── models ├── messages.ts └── user.ts ├── package.json ├── server.ts ├── tsconfig.json ├── utilities.ts ├── websocket.ts ├── wsfunc.ts └── yarn.lock /.github/workflows/config.yml: -------------------------------------------------------------------------------- 1 | name: CI deploy 2 | on: 3 | push: 4 | branches: [master] 5 | env: 6 | AWS_HOST: 52.90.10.161 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: actions/setup-node@v1 13 | with: 14 | node-version: '14.8.0' 15 | - name: Build Server 16 | env: 17 | NODE_ENV: development 18 | run: | 19 | cd server 20 | yarn install --frozen-lockfile 21 | tsc 22 | - name: Build Client 23 | env: 24 | NODE_ENV: development 25 | run: | 26 | cd client 27 | yarn install --frozen-lockfile 28 | yarn build 29 | - name: Deploy on server 30 | env: 31 | DEPLOYMENT_KEY_B64: ${{ secrets.DEPLOYMENT_KEY_B64 }} 32 | run: | 33 | mkdir ~/.ssh; 34 | touch ~/.ssh/known_hosts; 35 | ssh-keyscan $AWS_HOST >> ~/.ssh/known_hosts; 36 | echo $DEPLOYMENT_KEY_B64 | base64 -d > ~/.ssh/id_rsa; 37 | chmod 644 ~/.ssh/known_hosts; 38 | chmod 600 ~/.ssh/id_rsa; 39 | chmod 0755 ./.github/workflows/deploy.sh; 40 | ./.github/workflows/deploy.sh; 41 | rm -rf ~/.ssh; 42 | -------------------------------------------------------------------------------- /.github/workflows/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | user="ubuntu" 4 | 5 | rm -rf .git 6 | rm -rf .gitignore 7 | git config --global user.email "mehulmpt@gmail.com" 8 | git config --global user.name "Mehul Mohan" 9 | mv .gitignore_cicd .gitignore 10 | git init . 11 | git add . 12 | git commit -m "Deploying" 13 | git remote add production ssh://$user@$AWS_HOST/~/webapp 14 | git push --force production master 15 | 16 | ssh $user@$AWS_HOST "cd ~/webapp && \ 17 | pm2 kill 18 | NODE_ENV=production pm2 start /home/ubuntu/webapp/server/build/server.js 19 | exit" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /.gitignore_cicd: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /client/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 | ### `yarn 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 | ### `yarn 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 | ### `yarn 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 | ### `yarn 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 | -------------------------------------------------------------------------------- /client/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "main.css": "/static/css/main.cf6385ff.chunk.css", 4 | "main.js": "/static/js/main.bb3a1453.chunk.js", 5 | "main.js.map": "/static/js/main.bb3a1453.chunk.js.map", 6 | "runtime-main.js": "/static/js/runtime-main.09b85ec0.js", 7 | "runtime-main.js.map": "/static/js/runtime-main.09b85ec0.js.map", 8 | "static/js/2.3c07f4e1.chunk.js": "/static/js/2.3c07f4e1.chunk.js", 9 | "static/js/2.3c07f4e1.chunk.js.map": "/static/js/2.3c07f4e1.chunk.js.map", 10 | "index.html": "/index.html", 11 | "precache-manifest.0699d5c9698c486c05b4904bd5856d75.js": "/precache-manifest.0699d5c9698c486c05b4904bd5856d75.js", 12 | "service-worker.js": "/service-worker.js", 13 | "static/css/main.cf6385ff.chunk.css.map": "/static/css/main.cf6385ff.chunk.css.map", 14 | "static/js/2.3c07f4e1.chunk.js.LICENSE.txt": "/static/js/2.3c07f4e1.chunk.js.LICENSE.txt" 15 | }, 16 | "entrypoints": [ 17 | "static/js/runtime-main.09b85ec0.js", 18 | "static/js/2.3c07f4e1.chunk.js", 19 | "static/css/main.cf6385ff.chunk.css", 20 | "static/js/main.bb3a1453.chunk.js" 21 | ] 22 | } -------------------------------------------------------------------------------- /client/build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehulmpt/codedamn-live-project/d4aae7e430d76882c9b01faee1acb90396b47155/client/build/favicon.ico -------------------------------------------------------------------------------- /client/build/index.html: -------------------------------------------------------------------------------- 1 | React App
-------------------------------------------------------------------------------- /client/build/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehulmpt/codedamn-live-project/d4aae7e430d76882c9b01faee1acb90396b47155/client/build/logo192.png -------------------------------------------------------------------------------- /client/build/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehulmpt/codedamn-live-project/d4aae7e430d76882c9b01faee1acb90396b47155/client/build/logo512.png -------------------------------------------------------------------------------- /client/build/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 | -------------------------------------------------------------------------------- /client/build/precache-manifest.0699d5c9698c486c05b4904bd5856d75.js: -------------------------------------------------------------------------------- 1 | self.__precacheManifest = (self.__precacheManifest || []).concat([ 2 | { 3 | "revision": "b5484e7ecb41e88e5b6a93f2d6e2dfbb", 4 | "url": "/index.html" 5 | }, 6 | { 7 | "revision": "3663d118ecb55f962aae", 8 | "url": "/static/css/main.cf6385ff.chunk.css" 9 | }, 10 | { 11 | "revision": "318428ceeb62820617d2", 12 | "url": "/static/js/2.3c07f4e1.chunk.js" 13 | }, 14 | { 15 | "revision": "0749163b59fbee32225059cb60c18af6", 16 | "url": "/static/js/2.3c07f4e1.chunk.js.LICENSE.txt" 17 | }, 18 | { 19 | "revision": "3663d118ecb55f962aae", 20 | "url": "/static/js/main.bb3a1453.chunk.js" 21 | }, 22 | { 23 | "revision": "9b4e396c183e42c1fa5c", 24 | "url": "/static/js/runtime-main.09b85ec0.js" 25 | } 26 | ]); -------------------------------------------------------------------------------- /client/build/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /client/build/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Welcome to your Workbox-powered service worker! 3 | * 4 | * You'll need to register this file in your web app and you should 5 | * disable HTTP caching for this file too. 6 | * See https://goo.gl/nhQhGp 7 | * 8 | * The rest of the code is auto-generated. Please don't update this file 9 | * directly; instead, make changes to your Workbox build configuration 10 | * and re-run your build process. 11 | * See https://goo.gl/2aRDsh 12 | */ 13 | 14 | importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); 15 | 16 | importScripts( 17 | "/precache-manifest.0699d5c9698c486c05b4904bd5856d75.js" 18 | ); 19 | 20 | self.addEventListener('message', (event) => { 21 | if (event.data && event.data.type === 'SKIP_WAITING') { 22 | self.skipWaiting(); 23 | } 24 | }); 25 | 26 | workbox.core.clientsClaim(); 27 | 28 | /** 29 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to 30 | * requests for URLs in the manifest. 31 | * See https://goo.gl/S9QRab 32 | */ 33 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 34 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 35 | 36 | workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), { 37 | 38 | blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/], 39 | }); 40 | -------------------------------------------------------------------------------- /client/build/static/css/main.cf6385ff.chunk.css: -------------------------------------------------------------------------------- 1 | body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.App{display:flex;height:100vh;width:100vw;justify-content:center;align-items:center;text-align:center}.buttons{width:480px;display:flex;justify-content:space-between}.form{height:100vh;width:100vw;justify-content:center;align-items:center;text-align:center}.form,.register-fields{display:flex;flex-direction:column}.register-fields{width:480px}.register-fields>div{margin-bottom:20px} 2 | /*# sourceMappingURL=main.cf6385ff.chunk.css.map */ -------------------------------------------------------------------------------- /client/build/static/css/main.cf6385ff.chunk.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.css","style.css"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CCZA,KACC,YAAa,CACb,YAAa,CACb,WAAY,CACZ,sBAAuB,CACvB,kBAAmB,CACnB,iBACD,CAEA,SACC,WAAY,CACZ,YAAa,CACb,6BACD,CAbA,MAEC,YAAa,CACb,WAAY,CACZ,sBAAuB,CACvB,kBAAmB,CACnB,iBAED,CAEA,uBATC,YAAa,CAMb,qBAOD,CAJA,iBAEC,WAED,CAEA,qBACC,kBACD","file":"main.cf6385ff.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".form {\n\tdisplay: flex;\n\theight: 100vh;\n\twidth: 100vw;\n\tjustify-content: center;\n\talign-items: center;\n\ttext-align: center;\n\tflex-direction: column;\n}\n\n.register-fields {\n\tdisplay: flex;\n\twidth: 480px;\n\tflex-direction: column;\n}\n\n.register-fields > div {\n\tmargin-bottom: 20px;\n}\n"]} -------------------------------------------------------------------------------- /client/build/static/js/2.3c07f4e1.chunk.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | /** 8 | * A better abstraction over CSS. 9 | * 10 | * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present 11 | * @website https://github.com/cssinjs/jss 12 | * @license MIT 13 | */ 14 | 15 | /** @license React v0.19.1 16 | * scheduler.production.min.js 17 | * 18 | * Copyright (c) Facebook, Inc. and its affiliates. 19 | * 20 | * This source code is licensed under the MIT license found in the 21 | * LICENSE file in the root directory of this source tree. 22 | */ 23 | 24 | /** @license React v16.13.1 25 | * react-dom.production.min.js 26 | * 27 | * Copyright (c) Facebook, Inc. and its affiliates. 28 | * 29 | * This source code is licensed under the MIT license found in the 30 | * LICENSE file in the root directory of this source tree. 31 | */ 32 | 33 | /** @license React v16.13.1 34 | * react-is.production.min.js 35 | * 36 | * Copyright (c) Facebook, Inc. and its affiliates. 37 | * 38 | * This source code is licensed under the MIT license found in the 39 | * LICENSE file in the root directory of this source tree. 40 | */ 41 | 42 | /** @license React v16.13.1 43 | * react.production.min.js 44 | * 45 | * Copyright (c) Facebook, Inc. and its affiliates. 46 | * 47 | * This source code is licensed under the MIT license found in the 48 | * LICENSE file in the root directory of this source tree. 49 | */ 50 | -------------------------------------------------------------------------------- /client/build/static/js/main.bb3a1453.chunk.js: -------------------------------------------------------------------------------- 1 | (this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{60:function(e,t,a){e.exports=a(75)},65:function(e,t,a){},66:function(e,t,a){},73:function(e,t,a){},74:function(e,t,a){},75:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),c=a(7),o=a.n(c),l=(a(65),a(24)),i=a(10),s=a(102);a(66);function u(){return r.a.createElement("div",{className:"App"},r.a.createElement("header",{className:"App-header"},r.a.createElement("h1",null,"Simple Chat Room App"),r.a.createElement("div",{className:"buttons"},r.a.createElement(s.a,{color:"secondary",variant:"contained",component:l.b,to:"/login"},"Login"),r.a.createElement(s.a,{color:"primary",variant:"contained",component:l.b,to:"/register"},"Register"))))}var m=a(20),p=a.n(m),d=a(26),f=a(18),h=a(109),g=(a(73),!("localhost"===window.location.hostname)?"":"http://localhost:1337");function v(e,t){return E.apply(this,arguments)}function E(){return(E=Object(d.a)(p.a.mark((function e(t,a){var n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(g).concat(t),{method:"POST",headers:{"Content-Type":"application/json","x-access-token":localStorage.getItem("token")||""},body:JSON.stringify(a)}).then((function(e){return e.json()}));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){var e=Object(n.useState)(""),t=Object(f.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)(""),l=Object(f.a)(o,2),u=l[0],m=l[1],g=Object(i.f)();function E(){return(E=Object(d.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("/api/login",{email:a,password:u});case 2:"ok"===(t=e.sent).status?(localStorage.setItem("token",t.data),alert("You are logged in"),g.push("/chat")):alert(t.error);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return r.a.createElement("div",{className:"form"},r.a.createElement("h1",null,"Login"),r.a.createElement("form",{className:"register-fields"},r.a.createElement(h.a,{fullWidth:!0,placeholder:"you@awesome.com",label:"Your Email",value:a,onChange:function(e){return c(e.target.value)},variant:"outlined"}),r.a.createElement(h.a,{fullWidth:!0,value:u,onChange:function(e){return m(e.target.value)},placeholder:"p@$$w0rd",label:"Password",variant:"outlined"}),r.a.createElement(s.a,{color:"primary",variant:"contained",onClick:function(){return E.apply(this,arguments)}},"Login")))}a(74);function y(){var e=Object(n.useState)(""),t=Object(f.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)(""),l=Object(f.a)(o,2),i=l[0],u=l[1];function m(){return(m=Object(d.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("/api/register",{email:a,password:i});case 2:t=e.sent,console.log(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return r.a.createElement("div",{className:"form"},r.a.createElement("h1",null,"Register"),r.a.createElement("form",{className:"register-fields"},r.a.createElement(h.a,{fullWidth:!0,placeholder:"you@awesome.com",label:"Your Email",value:a,onChange:function(e){return c(e.target.value)},variant:"outlined"}),r.a.createElement(h.a,{fullWidth:!0,value:i,onChange:function(e){return u(e.target.value)},placeholder:"p@$$w0rd",label:"Password",variant:"outlined"}),r.a.createElement(s.a,{color:"primary",variant:"contained",onClick:function(){return m.apply(this,arguments)}},"Register")))}var O=a(52),j=a(106),S=a(107),w=a(110),k=a(108),x=a(41);function N(){var e=Object(n.useState)(""),t=Object(f.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)([]),l=Object(f.a)(o,2),u=l[0],m=l[1],p=Object(n.useState)(null),d=Object(f.a)(p,2),g=d[0],v=d[1],E=Object(i.f)();return Object(n.useEffect)((function(){var e=new WebSocket("ws://localhost:1338/"+localStorage.getItem("token"));return e.addEventListener("open",(function(){e.send(JSON.stringify({intent:"old-messages",count:10}))}),{once:!0}),e.addEventListener("error",(function(){alert("Please login first"),E.replace("/login")})),e.addEventListener("message",(function(e){var t=function(e){try{return JSON.parse(e)}catch(t){return null}}(e.data);t&&("chat"===t.intent?m((function(e){return[].concat(Object(O.a)(e),[t])})):"old-messages"===t.intent&&(console.log(t.data,"are the older messages"),m(t.data.map((function(e){return{user:e.email,message:e.message}})).reverse())))})),v(e),function(){e.close()}}),[]),r.a.createElement("div",null,r.a.createElement("h1",null,"Chat Page"),r.a.createElement("div",{className:"chat-box"},u.map((function(e,t){return r.a.createElement(j.a,{alignItems:"flex-start",key:t},r.a.createElement(S.a,null,r.a.createElement(w.a,{alt:"Remy Sharp",src:"/static/images/avatar/1.jpg"})),r.a.createElement(k.a,{primary:e.user,secondary:r.a.createElement(r.a.Fragment,null,r.a.createElement(x.a,{component:"span",variant:"body2",color:"textPrimary"},e.message))}))}))),r.a.createElement(h.a,{onChange:function(e){return c(e.target.value)},value:a,multiline:!0,rows:2,variant:"outlined",color:"primary"}),r.a.createElement(s.a,{variant:"outlined",color:"primary",onClick:function(){(null===g||void 0===g?void 0:g.readyState)===WebSocket.OPEN&&(g.send(JSON.stringify({message:a,intent:"chat"})),c(""))}},"Send Message"))}var C=function(){return r.a.createElement(l.a,null,r.a.createElement(i.c,null,r.a.createElement(i.a,{path:"/",component:u,exact:!0}),r.a.createElement(i.a,{path:"/login",component:b,exact:!0}),r.a.createElement(i.a,{path:"/register",component:y,exact:!0}),r.a.createElement(i.a,{path:"/chat",component:N,exact:!0})))};o.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(C,null)),document.getElementById("root"))}},[[60,1,2]]]); 2 | //# sourceMappingURL=main.bb3a1453.chunk.js.map -------------------------------------------------------------------------------- /client/build/static/js/main.bb3a1453.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["components/Home/index.tsx","utility.ts","components/Login/index.tsx","components/Register/index.tsx","components/Chat/index.tsx","components/index.tsx","index.tsx"],"names":["Home","className","Button","color","variant","component","Link","to","API_URL","window","location","hostname","apiCall","path","payload","a","fetch","method","headers","localStorage","getItem","body","JSON","stringify","then","t","json","res","Register","useState","email","setEmail","password","setPassword","history","useHistory","status","setItem","data","alert","push","error","TextField","fullWidth","placeholder","label","value","onChange","e","target","onClick","console","log","Chat","chatMessage","setChatMessage","chatMessages","setChatMessages","wsRef","setWSRef","useEffect","ws","WebSocket","addEventListener","send","intent","count","once","replace","event","message","parse","processMessage","oldMessages","map","item","user","reverse","close","index","ListItem","alignItems","key","ListItemAvatar","Avatar","alt","src","ListItemText","primary","secondary","Fragment","Typography","multiline","rows","readyState","OPEN","App","exact","Login","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"2SAKe,SAASA,IACvB,OACC,yBAAKC,UAAU,OACd,4BAAQA,UAAU,cACjB,oDACA,yBAAKA,UAAU,WACd,kBAACC,EAAA,EAAD,CAAQC,MAAM,YAAYC,QAAQ,YAAYC,UAAWC,IAAMC,GAAG,UAAlE,SAGA,kBAACL,EAAA,EAAD,CAAQC,MAAM,UAAUC,QAAQ,YAAYC,UAAWC,IAAMC,GAAG,aAAhE,e,8CCXCC,G,QAHqD,cAA7BC,OAAOC,SAASC,UAGd,GAAK,yBAE9B,SAAeC,EAAtB,oC,4CAAO,WAAuBC,EAAcC,GAArC,eAAAC,EAAA,sEACYC,MAAM,GAAD,OAAIR,GAAJ,OAAcK,GAAQ,CAC5CI,OAAQ,OACRC,QAAS,CACR,eAAgB,mBAChB,iBAAkBC,aAAaC,QAAQ,UAAY,IAEpDC,KAAMC,KAAKC,UAAUT,KACnBU,MAAK,SAACC,GAAD,OAAOA,EAAEC,UARX,cACAC,EADA,yBAUCA,GAVD,4C,sBCCQ,SAASC,IAAY,IAAD,EACRC,mBAAS,IADD,mBAC3BC,EAD2B,KACpBC,EADoB,OAEFF,mBAAS,IAFP,mBAE3BG,EAF2B,KAEjBC,EAFiB,KAI5BC,EAAUC,cAJkB,4CAMlC,4BAAApB,EAAA,sEACmBH,EAAQ,aAAc,CAAEkB,QAAOE,aADlD,OAGoB,QAFbL,EADP,QAGSS,QAEPjB,aAAakB,QAAQ,QAASV,EAAIW,MAClCC,MAAM,qBACNL,EAAQM,KAAK,UAEbD,MAAMZ,EAAIc,OATZ,4CANkC,sBAmBlC,OACC,yBAAKxC,UAAU,QACd,qCACA,0BAAMA,UAAU,mBACf,kBAACyC,EAAA,EAAD,CACCC,WAAS,EACTC,YAAY,kBACZC,MAAM,aACNC,MAAOhB,EACPiB,SAAU,SAACC,GAAD,OAAYjB,EAASiB,EAAEC,OAAOH,QACxC1C,QAAQ,aAET,kBAACsC,EAAA,EAAD,CACCC,WAAS,EACTG,MAAOd,EACPe,SAAU,SAACC,GAAD,OAAYf,EAAYe,EAAEC,OAAOH,QAC3CF,YAAY,WACZC,MAAM,WACNzC,QAAQ,aAET,kBAACF,EAAA,EAAD,CAAQC,MAAM,UAAUC,QAAQ,YAAY8C,QAvCb,4CAuC/B,W,MCxCW,SAAStB,IAAY,IAAD,EACRC,mBAAS,IADD,mBAC3BC,EAD2B,KACpBC,EADoB,OAEFF,mBAAS,IAFP,mBAE3BG,EAF2B,KAEjBC,EAFiB,iDAIlC,4BAAAlB,EAAA,sEACmBH,EAAQ,gBAAiB,CAAEkB,QAAOE,aADrD,OACOL,EADP,OAECwB,QAAQC,IAAIzB,GAFb,4CAJkC,sBASlC,OACC,yBAAK1B,UAAU,QACd,wCACA,0BAAMA,UAAU,mBACf,kBAACyC,EAAA,EAAD,CACCC,WAAS,EACTC,YAAY,kBACZC,MAAM,aACNC,MAAOhB,EACPiB,SAAU,SAACC,GAAD,OAAYjB,EAASiB,EAAEC,OAAOH,QACxC1C,QAAQ,aAET,kBAACsC,EAAA,EAAD,CACCC,WAAS,EACTG,MAAOd,EACPe,SAAU,SAACC,GAAD,OAAYf,EAAYe,EAAEC,OAAOH,QAC3CF,YAAY,WACZC,MAAM,WACNzC,QAAQ,aAET,kBAACF,EAAA,EAAD,CAAQC,MAAM,UAAUC,QAAQ,YAAY8C,QA7Bb,4CA6B/B,c,wDCRW,SAASG,IAAQ,IAAD,EACQxB,mBAAS,IADjB,mBACvByB,EADuB,KACVC,EADU,OAEU1B,mBAAoB,IAF9B,mBAEvB2B,EAFuB,KAETC,EAFS,OAGJ5B,mBAA2B,MAHvB,mBAGvB6B,EAHuB,KAGhBC,EAHgB,KAKxBzB,EAAUC,cAwEhB,OA5DAyB,qBAAU,WACT,IAAMC,EAAK,IAAIC,UAAU,uBAAyB3C,aAAaC,QAAQ,UAgDvE,OA9CAyC,EAAGE,iBACF,QACA,WACCF,EAAGG,KACF1C,KAAKC,UAAU,CACd0C,OAAQ,eACRC,MAAO,QAIV,CAAEC,MAAM,IAGTN,EAAGE,iBAAiB,SAAS,WAC5BxB,MAAM,sBACNL,EAAQkC,QAAQ,aAGjBP,EAAGE,iBAAiB,WAAW,SAACM,GAC/B,IAEMC,EAjDT,SAAwBxD,GACvB,IACC,OAAOQ,KAAKiD,MAAMzD,GACjB,MAAO2B,GACR,OAAO,MA6Ce+B,CAFRH,EAAM/B,MAIdgC,IAEkB,SAAnBA,EAAQL,OACXR,GAAgB,SAACgB,GAChB,MAAM,GAAN,mBAAWA,GAAX,CAAwBH,OAEI,iBAAnBA,EAAQL,SAClBd,QAAQC,IAAIkB,EAAQhC,KAAM,0BAC1BmB,EACCa,EAAQhC,KACNoC,KAAI,SAACC,GACL,MAAO,CACNC,KAAMD,EAAK7C,MACXwC,QAASK,EAAKL,YAGfO,gBAKLlB,EAASE,GAEF,WACNA,EAAGiB,WAEF,IASF,6BACC,yCACA,yBAAK7E,UAAU,YACbuD,EAAakB,KAAI,SAACJ,EAASS,GAC3B,OACC,kBAACC,EAAA,EAAD,CAAUC,WAAW,aAAaC,IAAKH,GACtC,kBAACI,EAAA,EAAD,KACC,kBAACC,EAAA,EAAD,CAAQC,IAAI,aAAaC,IAAI,iCAE9B,kBAACC,EAAA,EAAD,CACCC,QAASlB,EAAQM,KACjBa,UACC,kBAAC,IAAMC,SAAP,KACC,kBAACC,EAAA,EAAD,CACCtF,UAAU,OACVD,QAAQ,QACRD,MAAM,eAELmE,EAAQA,iBAejB,kBAAC5B,EAAA,EAAD,CACCK,SAAU,SAACC,GAAD,OAAOO,EAAeP,EAAEC,OAAOH,QACzCA,MAAOQ,EACPsC,WAAS,EACTC,KAAM,EACNzF,QAAQ,WACRD,MAAM,YAGP,kBAACD,EAAA,EAAD,CAAQE,QAAQ,WAAWD,MAAM,UAAU+C,QAjH7C,YACU,OAALQ,QAAK,IAALA,OAAA,EAAAA,EAAOoC,cAAehC,UAAUiC,OAKpCrC,EAAMM,KAAK1C,KAAKC,UAAU,CAAE+C,QAAShB,EAAaW,OAAQ,UAC1DV,EAAe,OA0Gd,iBC9HYyC,MAbf,WACC,OACC,kBAAC,IAAD,KACC,kBAAC,IAAD,KACC,kBAAC,IAAD,CAAOnF,KAAK,IAAIR,UAAWL,EAAMiG,OAAK,IACtC,kBAAC,IAAD,CAAOpF,KAAK,SAASR,UAAW6F,EAAOD,OAAK,IAC5C,kBAAC,IAAD,CAAOpF,KAAK,YAAYR,UAAWuB,EAAUqE,OAAK,IAClD,kBAAC,IAAD,CAAOpF,KAAK,QAAQR,UAAWgD,EAAM4C,OAAK,OCT9CE,IAASC,OACR,kBAAC,IAAMC,WAAP,KACC,kBAAC,EAAD,OAEDC,SAASC,eAAe,W","file":"static/js/main.bb3a1453.chunk.js","sourcesContent":["import React from 'react'\nimport { Button } from '@material-ui/core'\nimport { Link } from 'react-router-dom'\nimport './style.css'\n\nexport default function Home() {\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t

Simple Chat Room App

\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t)\n}\n","export const IS_DEVELOPMENT = window.location.hostname === 'localhost'\nexport const IS_PRODUCTION = !IS_DEVELOPMENT\n\nconst API_URL = IS_PRODUCTION ? '' : 'http://localhost:1337'\n\nexport async function apiCall(path: string, payload: { [key: string]: any }) {\n\tconst res = await fetch(`${API_URL}${path}`, {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t'x-access-token': localStorage.getItem('token') || ''\n\t\t},\n\t\tbody: JSON.stringify(payload)\n\t}).then((t) => t.json())\n\n\treturn res\n}\n","import React, { useState } from 'react'\nimport { TextField, Button } from '@material-ui/core'\nimport './style.css'\nimport { apiCall } from '../../utility'\nimport { useHistory } from 'react-router-dom'\n\nexport default function Register() {\n\tconst [email, setEmail] = useState('')\n\tconst [password, setPassword] = useState('')\n\n\tconst history = useHistory()\n\n\tasync function loginUser() {\n\t\tconst res = await apiCall('/api/login', { email, password })\n\n\t\tif (res.status === 'ok') {\n\t\t\t// TODO: Bad practice -> refresh tokens\n\t\t\tlocalStorage.setItem('token', res.data)\n\t\t\talert('You are logged in')\n\t\t\thistory.push('/chat')\n\t\t} else {\n\t\t\talert(res.error)\n\t\t}\n\t}\n\n\treturn (\n\t\t
\n\t\t\t

Login

\n\t\t\t
\n\t\t\t\t setEmail(e.target.value)}\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t/>\n\t\t\t\t setPassword(e.target.value)}\n\t\t\t\t\tplaceholder=\"p@$$w0rd\"\n\t\t\t\t\tlabel=\"Password\"\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t
\n\t)\n}\n","import React, { useState } from 'react'\nimport { TextField, Button } from '@material-ui/core'\nimport './style.css'\nimport { apiCall } from '../../utility'\n\nexport default function Register() {\n\tconst [email, setEmail] = useState('')\n\tconst [password, setPassword] = useState('')\n\n\tasync function registerUser() {\n\t\tconst res = await apiCall('/api/register', { email, password })\n\t\tconsole.log(res)\n\t}\n\n\treturn (\n\t\t
\n\t\t\t

Register

\n\t\t\t
\n\t\t\t\t setEmail(e.target.value)}\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t/>\n\t\t\t\t setPassword(e.target.value)}\n\t\t\t\t\tplaceholder=\"p@$$w0rd\"\n\t\t\t\t\tlabel=\"Password\"\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t
\n\t)\n}\n","import React, { useEffect, useState } from 'react'\nimport {\n\tTextField,\n\tButton,\n\tListItem,\n\tListItemAvatar,\n\tAvatar,\n\tListItemText,\n\tTypography\n} from '@material-ui/core'\nimport { useHistory } from 'react-router-dom'\n\ntype Message = {\n\tuser: string\n\tmessage: string\n\tintent: 'chat'\n}\n\nfunction processMessage(payload: string) {\n\ttry {\n\t\treturn JSON.parse(payload)\n\t} catch (error) {\n\t\treturn null\n\t}\n}\n\nexport default function Chat() {\n\tconst [chatMessage, setChatMessage] = useState('')\n\tconst [chatMessages, setChatMessages] = useState([])\n\tconst [wsRef, setWSRef] = useState(null)\n\n\tconst history = useHistory()\n\n\tfunction sendMessage() {\n\t\tif (wsRef?.readyState !== WebSocket.OPEN) {\n\t\t\t// websocket not connected\n\t\t\treturn\n\t\t}\n\n\t\twsRef.send(JSON.stringify({ message: chatMessage, intent: 'chat' }))\n\t\tsetChatMessage('')\n\t}\n\n\tuseEffect(() => {\n\t\tconst ws = new WebSocket('ws://localhost:1338/' + localStorage.getItem('token'))\n\n\t\tws.addEventListener(\n\t\t\t'open',\n\t\t\t() => {\n\t\t\t\tws.send(\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tintent: 'old-messages',\n\t\t\t\t\t\tcount: 10\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t},\n\t\t\t{ once: true }\n\t\t)\n\n\t\tws.addEventListener('error', () => {\n\t\t\talert('Please login first')\n\t\t\thistory.replace('/login')\n\t\t})\n\n\t\tws.addEventListener('message', (event) => {\n\t\t\tconst data = event.data\n\n\t\t\tconst message: any = processMessage(data)\n\n\t\t\tif (!message) return\n\n\t\t\tif (message.intent === 'chat') {\n\t\t\t\tsetChatMessages((oldMessages) => {\n\t\t\t\t\treturn [...oldMessages, message as Message]\n\t\t\t\t})\n\t\t\t} else if (message.intent === 'old-messages') {\n\t\t\t\tconsole.log(message.data, 'are the older messages')\n\t\t\t\tsetChatMessages(\n\t\t\t\t\tmessage.data\n\t\t\t\t\t\t.map((item: any) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tuser: item.email,\n\t\t\t\t\t\t\t\tmessage: item.message\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.reverse()\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\n\t\tsetWSRef(ws)\n\n\t\treturn () => {\n\t\t\tws.close()\n\t\t}\n\t}, [])\n\n\t// TODO: Add another action which loads more messages\n\n\t// 1. another click handler for that button\n\t// 2. Should extract the smallest date of current messages\n\t// 3. Should send a new websocket request with old-messages but with date as the property // date as well as count\n\n\treturn (\n\t\t
\n\t\t\t

Chat Page

\n\t\t\t
\n\t\t\t\t{chatMessages.map((message, index) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{message.message}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t//
\n\t\t\t\t\t\t// \t
{message.user}
\n\t\t\t\t\t\t// \t
{message.message}
\n\t\t\t\t\t\t//
\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t
\n\n\t\t\t setChatMessage(e.target.value)}\n\t\t\t\tvalue={chatMessage}\n\t\t\t\tmultiline\n\t\t\t\trows={2}\n\t\t\t\tvariant=\"outlined\"\n\t\t\t\tcolor=\"primary\"\n\t\t\t/>\n\n\t\t\t\n\t\t
\n\t)\n}\n","import React from 'react'\nimport { BrowserRouter as Router, Switch, Route } from 'react-router-dom'\nimport Home from './Home'\nimport Login from './Login'\nimport Register from './Register'\nimport Chat from './Chat'\n\nfunction App() {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t)\n}\n\nexport default App\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './components'\n\nReactDOM.render(\n\t\n\t\t\n\t,\n\tdocument.getElementById('root')\n)\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /client/build/static/js/runtime-main.09b85ec0.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(t){for(var n,l,i=t[0],f=t[1],a=t[2],p=0,s=[];p0.2%", 32 | "not dead", 33 | "not op_mini all" 34 | ], 35 | "development": [ 36 | "last 1 chrome version", 37 | "last 1 firefox version", 38 | "last 1 safari version" 39 | ] 40 | }, 41 | "devDependencies": { 42 | "@types/react-router-dom": "^5.1.5" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehulmpt/codedamn-live-project/d4aae7e430d76882c9b01faee1acb90396b47155/client/public/favicon.ico -------------------------------------------------------------------------------- /client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehulmpt/codedamn-live-project/d4aae7e430d76882c9b01faee1acb90396b47155/client/public/logo192.png -------------------------------------------------------------------------------- /client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehulmpt/codedamn-live-project/d4aae7e430d76882c9b01faee1acb90396b47155/client/public/logo512.png -------------------------------------------------------------------------------- /client/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 | -------------------------------------------------------------------------------- /client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /client/src/components/Chat/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | import { 3 | TextField, 4 | Button, 5 | ListItem, 6 | ListItemAvatar, 7 | Avatar, 8 | ListItemText, 9 | Typography 10 | } from '@material-ui/core' 11 | import { useHistory } from 'react-router-dom' 12 | 13 | type Message = { 14 | user: string 15 | message: string 16 | intent: 'chat' 17 | } 18 | 19 | function processMessage(payload: string) { 20 | try { 21 | return JSON.parse(payload) 22 | } catch (error) { 23 | return null 24 | } 25 | } 26 | 27 | const HOST = window.location.hostname + ':1338' 28 | 29 | export default function Chat() { 30 | const [chatMessage, setChatMessage] = useState('') 31 | const [chatMessages, setChatMessages] = useState([]) 32 | const [wsRef, setWSRef] = useState(null) 33 | 34 | const history = useHistory() 35 | 36 | function sendMessage() { 37 | if (wsRef?.readyState !== WebSocket.OPEN) { 38 | // websocket not connected 39 | return 40 | } 41 | 42 | wsRef.send(JSON.stringify({ message: chatMessage, intent: 'chat' })) 43 | setChatMessage('') 44 | } 45 | 46 | useEffect(() => { 47 | const ws = new WebSocket(`ws://${HOST}/` + localStorage.getItem('token')) 48 | 49 | ws.addEventListener( 50 | 'open', 51 | () => { 52 | ws.send( 53 | JSON.stringify({ 54 | intent: 'old-messages', 55 | count: 10 56 | }) 57 | ) 58 | }, 59 | { once: true } 60 | ) 61 | 62 | ws.addEventListener('error', () => { 63 | alert('Please login first') 64 | history.replace('/login') 65 | }) 66 | 67 | ws.addEventListener('message', (event) => { 68 | const data = event.data 69 | 70 | const message: any = processMessage(data) 71 | 72 | if (!message) return 73 | 74 | if (message.intent === 'chat') { 75 | setChatMessages((oldMessages) => { 76 | return [...oldMessages, message as Message] 77 | }) 78 | } else if (message.intent === 'old-messages') { 79 | console.log(message.data, 'are the older messages') 80 | setChatMessages( 81 | message.data 82 | .map((item: any) => { 83 | return { 84 | user: item.email, 85 | message: item.message 86 | } 87 | }) 88 | .reverse() 89 | ) 90 | } 91 | }) 92 | 93 | setWSRef(ws) 94 | 95 | return () => { 96 | ws.close() 97 | } 98 | }, [history]) 99 | 100 | // TODO: Add another action which loads more messages 101 | 102 | // 1. another click handler for that button 103 | // 2. Should extract the smallest date of current messages 104 | // 3. Should send a new websocket request with old-messages but with date as the property // date as well as count 105 | 106 | return ( 107 |
108 |

Chat Page

109 |
110 | {chatMessages.map((message, index) => { 111 | return ( 112 | 113 | 114 | 115 | 116 | 120 | 125 | {message.message} 126 | 127 | 128 | } 129 | /> 130 | 131 | 132 | //
133 | //
{message.user}
134 | //
{message.message}
135 | //
136 | ) 137 | })} 138 |
139 | 140 | setChatMessage(e.target.value)} 142 | value={chatMessage} 143 | multiline 144 | rows={2} 145 | variant="outlined" 146 | color="primary" 147 | /> 148 | 149 | 152 |
153 | ) 154 | } 155 | -------------------------------------------------------------------------------- /client/src/components/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Button } from '@material-ui/core' 3 | import { Link } from 'react-router-dom' 4 | import './style.css' 5 | 6 | export default function Home() { 7 | return ( 8 |
9 |
10 |

Simple Chat Room App

11 |
12 | 15 | 18 |
19 |
20 |
21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /client/src/components/Home/style.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | height: 100vh; 4 | width: 100vw; 5 | justify-content: center; 6 | align-items: center; 7 | text-align: center; 8 | } 9 | 10 | .buttons { 11 | width: 480px; 12 | display: flex; 13 | justify-content: space-between; 14 | } 15 | -------------------------------------------------------------------------------- /client/src/components/Login/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import { TextField, Button } from '@material-ui/core' 3 | import './style.css' 4 | import { apiCall } from '../../utility' 5 | import { useHistory } from 'react-router-dom' 6 | 7 | export default function Register() { 8 | const [email, setEmail] = useState('') 9 | const [password, setPassword] = useState('') 10 | 11 | const history = useHistory() 12 | 13 | async function loginUser() { 14 | const res = await apiCall('/api/login', { email, password }) 15 | 16 | if (res.status === 'ok') { 17 | // TODO: Bad practice -> refresh tokens 18 | localStorage.setItem('token', res.data) 19 | alert('You are logged in') 20 | history.push('/chat') 21 | } else { 22 | alert(res.error) 23 | } 24 | } 25 | 26 | return ( 27 |
28 |

Login

29 |
30 | setEmail(e.target.value)} 36 | variant="outlined" 37 | /> 38 | setPassword(e.target.value)} 42 | placeholder="p@$$w0rd" 43 | label="Password" 44 | variant="outlined" 45 | /> 46 | 49 | 50 |
51 | ) 52 | } 53 | -------------------------------------------------------------------------------- /client/src/components/Login/style.css: -------------------------------------------------------------------------------- 1 | .form { 2 | display: flex; 3 | height: 100vh; 4 | width: 100vw; 5 | justify-content: center; 6 | align-items: center; 7 | text-align: center; 8 | flex-direction: column; 9 | } 10 | 11 | .register-fields { 12 | display: flex; 13 | width: 480px; 14 | flex-direction: column; 15 | } 16 | 17 | .register-fields > div { 18 | margin-bottom: 20px; 19 | } 20 | -------------------------------------------------------------------------------- /client/src/components/Register/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import { TextField, Button } from '@material-ui/core' 3 | import './style.css' 4 | import { apiCall } from '../../utility' 5 | 6 | export default function Register() { 7 | const [email, setEmail] = useState('') 8 | const [password, setPassword] = useState('') 9 | 10 | async function registerUser() { 11 | const res = await apiCall('/api/register', { email, password }) 12 | console.log(res) 13 | } 14 | 15 | return ( 16 |
17 |

Register

18 |
19 | setEmail(e.target.value)} 25 | variant="outlined" 26 | /> 27 | setPassword(e.target.value)} 31 | placeholder="p@$$w0rd" 32 | label="Password" 33 | variant="outlined" 34 | /> 35 | 38 | 39 |
40 | ) 41 | } 42 | -------------------------------------------------------------------------------- /client/src/components/Register/style.css: -------------------------------------------------------------------------------- 1 | .form { 2 | display: flex; 3 | height: 100vh; 4 | width: 100vw; 5 | justify-content: center; 6 | align-items: center; 7 | text-align: center; 8 | flex-direction: column; 9 | } 10 | 11 | .register-fields { 12 | display: flex; 13 | width: 480px; 14 | flex-direction: column; 15 | } 16 | 17 | .register-fields > div { 18 | margin-bottom: 20px; 19 | } 20 | -------------------------------------------------------------------------------- /client/src/components/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { BrowserRouter as Router, Switch, Route } from 'react-router-dom' 3 | import Home from './Home' 4 | import Login from './Login' 5 | import Register from './Register' 6 | import Chat from './Chat' 7 | 8 | function App() { 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ) 19 | } 20 | 21 | export default App 22 | -------------------------------------------------------------------------------- /client/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 | -------------------------------------------------------------------------------- /client/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import './index.css' 4 | import App from './components' 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ) 12 | -------------------------------------------------------------------------------- /client/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /client/src/utility.ts: -------------------------------------------------------------------------------- 1 | export const IS_DEVELOPMENT = window.location.hostname === 'localhost' 2 | export const IS_PRODUCTION = !IS_DEVELOPMENT 3 | 4 | const API_URL = IS_PRODUCTION ? '' : 'http://localhost:1337' 5 | 6 | export async function apiCall(path: string, payload: { [key: string]: any }) { 7 | const res = await fetch(`${API_URL}${path}`, { 8 | method: 'POST', 9 | headers: { 10 | 'Content-Type': 'application/json', 11 | 'x-access-token': localStorage.getItem('token') || '' 12 | }, 13 | body: JSON.stringify(payload) 14 | }).then((t) => t.json()) 15 | 16 | return res 17 | } 18 | -------------------------------------------------------------------------------- /client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "noEmit": true, 20 | "jsx": "react" 21 | }, 22 | "include": [ 23 | "src" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /server/build/models/messages.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const mongoose_1 = __importDefault(require("mongoose")); 7 | const MessageModel = new mongoose_1.default.Schema({ 8 | email: { type: String, required: true }, 9 | message: { type: String, required: true }, 10 | date: { type: Number, required: true } 11 | }, { collection: 'messages' }); 12 | const model = mongoose_1.default.model('MessageModel', MessageModel); 13 | exports.default = model; 14 | -------------------------------------------------------------------------------- /server/build/models/user.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const mongoose_1 = __importDefault(require("mongoose")); 7 | const UserModel = new mongoose_1.default.Schema({ 8 | email: { type: String, required: true, unique: true }, 9 | password: { type: String, required: true } 10 | }, { collection: 'users' }); 11 | const model = mongoose_1.default.model('UserModel', UserModel); 12 | exports.default = model; 13 | -------------------------------------------------------------------------------- /server/build/server.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const express_1 = __importDefault(require("express")); // ts 7 | const body_parser_1 = __importDefault(require("body-parser")); 8 | const cors_1 = __importDefault(require("cors")); 9 | // const express = require('express') // js 10 | const mongoose_1 = __importDefault(require("mongoose")); 11 | const user_1 = __importDefault(require("./models/user")); 12 | const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); 13 | // initializes websocket server 14 | require("./websocket"); 15 | const utilities_1 = require("./utilities"); 16 | const app = express_1.default(); 17 | const PRODUCTION = process.env.NODE_ENV === 'production'; 18 | if (PRODUCTION) { 19 | app.use(express_1.default.static('/home/ubuntu/webapp/client/build')); 20 | mongoose_1.default.connect('mongodb://localhost:27017/codedamn-live'); 21 | } 22 | else { 23 | mongoose_1.default.connect('mongodb://admin:0O3lP2MRRmIVZ2WPlUaOPvIiNVDpZZh0aDBisdB2nQtPXB9Ao2oTgRMvG1F4Z6ayDcbj0W0wdkMh4tO25TF7XO7Y@localhost:27017/codedamn-live?authSource=admin'); 24 | } 25 | if (process.env.NODE_ENV !== 'production') { 26 | app.use(cors_1.default()); 27 | } 28 | app.use(body_parser_1.default.json()); 29 | app.post('/api/register', async (req, res) => { 30 | console.log(req.body); 31 | const { email, password } = req.body; 32 | if (!email || !password) { 33 | return res.json({ status: 'error', error: 'Invalid email/password' }); 34 | } 35 | // TODO: Hashing the password 36 | // bcrypt 37 | try { 38 | const user = new user_1.default({ email, password }); 39 | await user.save(); 40 | } 41 | catch (error) { 42 | console.log('Error', error); 43 | res.json({ status: 'error', error: 'Duplicate email' }); 44 | } 45 | res.json({ status: 'ok' }); 46 | }); 47 | app.post('/api/login', async (req, res) => { 48 | console.log(req.body); 49 | const { email, password } = req.body; 50 | const user = await user_1.default.findOne({ email, password }).lean(); 51 | if (!user) { 52 | return res.json({ status: 'error', error: 'User Not Found' }); 53 | } 54 | // TODO: 55 | // 1. Refresh tokens XX 56 | // 2. Storing JWT in memory instead of localStorage XX 57 | // Right now: 58 | // 1. JWT tokens directly 59 | // 2. localStorage 60 | // Refresh token -> httpOnly cookie 61 | const payload = jsonwebtoken_1.default.sign({ email }, utilities_1.JWT_SECRET_TOKEN); // 10-15 minutes 62 | return res.json({ status: 'ok', data: payload }); 63 | }); 64 | app.listen(1337); 65 | -------------------------------------------------------------------------------- /server/build/utilities.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.JWT_SECRET_TOKEN = 'sdifHghghdgfhjg&%^@#&^!*@&*@#&^&#^&ysduytruweiyhjfkhdsfjsdgfhjsdgqwuejgdbdshjfgj32234'; 4 | function processMessage(payload) { 5 | try { 6 | return JSON.parse(payload); 7 | } 8 | catch (error) { 9 | return null; 10 | } 11 | } 12 | exports.processMessage = processMessage; 13 | -------------------------------------------------------------------------------- /server/build/websocket.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const ws_1 = __importDefault(require("ws")); 7 | const utilities_1 = require("./utilities"); 8 | const http_1 = __importDefault(require("http")); 9 | const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); 10 | const wsfunc_1 = require("./wsfunc"); 11 | const server = http_1.default.createServer(); 12 | const wss = new ws_1.default.Server({ noServer: true }); 13 | wss.on('connection', function connection(ws) { 14 | // a single client has joined 15 | wsfunc_1.clients.push(ws); 16 | ws.on('close', () => { 17 | wsfunc_1.setClients(wsfunc_1.clients.filter((generalSocket) => generalSocket.connectionID !== ws.connectionID)); 18 | }); 19 | ws.on('message', function incoming(payload) { 20 | const message = utilities_1.processMessage(payload.toString()); 21 | if (!message) { 22 | // corrupted message from client 23 | // ignore 24 | return; 25 | } 26 | console.log(message, 'is the message'); 27 | if (message.intent === 'chat') { 28 | wsfunc_1.broadCastMessage(message, ws); 29 | } 30 | else if (message.intent === 'old-messages') { 31 | const count = message.count; 32 | if (!count) 33 | return; 34 | wsfunc_1.retrieveAndSendMessages(ws, count); 35 | } 36 | }); 37 | }); 38 | server.on('upgrade', function upgrade(request, socket, head) { 39 | // This function is not defined on purpose. Implement it with your own logic. 40 | const token = request.url.slice(1); // / + jwt token 41 | let email = ''; 42 | try { 43 | const payload = jsonwebtoken_1.default.verify(token, utilities_1.JWT_SECRET_TOKEN); 44 | email = payload.email; 45 | } 46 | catch (error) { 47 | // 48 | socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n'); 49 | socket.destroy(); 50 | return; 51 | } 52 | wss.handleUpgrade(request, socket, head, function done(ws) { 53 | const _ws = ws; 54 | _ws.connectionID = email; 55 | wss.emit('connection', _ws, request); 56 | }); 57 | // }) 58 | }); 59 | server.listen(1338); 60 | -------------------------------------------------------------------------------- /server/build/wsfunc.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const messages_1 = __importDefault(require("./models/messages")); 7 | exports.clients = []; 8 | function setClients(newClients) { 9 | exports.clients = newClients; 10 | } 11 | exports.setClients = setClients; 12 | function broadCastMessage(message, ws) { 13 | const newMessage = new messages_1.default({ 14 | email: ws.connectionID, 15 | message: message.message, 16 | date: Date.now() 17 | }); 18 | newMessage.save(); 19 | // broadcast it to all clients 20 | for (let i = 0; i < exports.clients.length; i++) { 21 | const client = exports.clients[i]; 22 | client.send(JSON.stringify({ 23 | message: message.message, 24 | user: ws.connectionID, 25 | intent: 'chat' 26 | })); 27 | } 28 | } 29 | exports.broadCastMessage = broadCastMessage; 30 | async function retrieveAndSendMessages(ws, count) { 31 | const messages = await messages_1.default.find({}, { email: 1, message: 1 }) 32 | .sort({ date: -1 }) 33 | .limit(count) 34 | .lean(); 35 | ws.send(JSON.stringify({ 36 | intent: 'old-messages', 37 | data: messages 38 | })); 39 | } 40 | exports.retrieveAndSendMessages = retrieveAndSendMessages; 41 | -------------------------------------------------------------------------------- /server/models/messages.ts: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose' 2 | 3 | const MessageModel = new mongoose.Schema( 4 | { 5 | email: { type: String, required: true }, 6 | message: { type: String, required: true }, 7 | date: { type: Number, required: true } 8 | }, 9 | { collection: 'messages' } 10 | ) 11 | 12 | const model = mongoose.model('MessageModel', MessageModel) 13 | 14 | export default model 15 | -------------------------------------------------------------------------------- /server/models/user.ts: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose' 2 | 3 | const UserModel = new mongoose.Schema( 4 | { 5 | email: { type: String, required: true, unique: true }, 6 | password: { type: String, required: true } 7 | }, 8 | { collection: 'users' } 9 | ) 10 | 11 | const model = mongoose.model('UserModel', UserModel) 12 | 13 | export default model 14 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "body-parser": "^1.19.0", 8 | "cors": "^2.8.5", 9 | "express": "^4.17.1", 10 | "jsonwebtoken": "^8.5.1", 11 | "mongoose": "^5.10.3", 12 | "uuid": "^8.3.0", 13 | "ws": "^7.3.1" 14 | }, 15 | "devDependencies": { 16 | "@types/cors": "^2.8.7", 17 | "@types/express": "^4.17.8", 18 | "@types/jsonwebtoken": "^8.5.0", 19 | "@types/mongoose": "^5.7.36", 20 | "@types/node": "^14.6.4", 21 | "@types/ws": "^7.2.6" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /server/server.ts: -------------------------------------------------------------------------------- 1 | import express from 'express' // ts 2 | import bodyParser from 'body-parser' 3 | import cors from 'cors' 4 | // const express = require('express') // js 5 | import mongoose from 'mongoose' 6 | import User from './models/user' 7 | import jwt from 'jsonwebtoken' 8 | 9 | // initializes websocket server 10 | import './websocket' 11 | import { JWT_SECRET_TOKEN } from './utilities' 12 | const app = express() 13 | const PRODUCTION = process.env.NODE_ENV === 'production' 14 | 15 | if (PRODUCTION) { 16 | app.use(express.static('/home/ubuntu/webapp/client/build')) 17 | mongoose.connect('mongodb://localhost:27017/codedamn-live') 18 | } else { 19 | mongoose.connect( 20 | 'mongodb://admin:0O3lP2MRRmIVZ2WPlUaOPvIiNVDpZZh0aDBisdB2nQtPXB9Ao2oTgRMvG1F4Z6ayDcbj0W0wdkMh4tO25TF7XO7Y@localhost:27017/codedamn-live?authSource=admin' 21 | ) 22 | } 23 | 24 | if (process.env.NODE_ENV !== 'production') { 25 | app.use(cors()) 26 | } 27 | 28 | app.use(bodyParser.json()) 29 | 30 | app.post('/api/register', async (req, res) => { 31 | console.log(req.body) 32 | 33 | const { email, password } = req.body 34 | 35 | if (!email || !password) { 36 | return res.json({ status: 'error', error: 'Invalid email/password' }) 37 | } 38 | 39 | // TODO: Hashing the password 40 | // bcrypt 41 | 42 | try { 43 | const user = new User({ email, password }) 44 | await user.save() 45 | } catch (error) { 46 | console.log('Error', error) 47 | res.json({ status: 'error', error: 'Duplicate email' }) 48 | } 49 | 50 | res.json({ status: 'ok' }) 51 | }) 52 | 53 | app.post('/api/login', async (req, res) => { 54 | console.log(req.body) 55 | 56 | const { email, password } = req.body 57 | 58 | const user = await User.findOne({ email, password }).lean() 59 | 60 | if (!user) { 61 | return res.json({ status: 'error', error: 'User Not Found' }) 62 | } 63 | 64 | // TODO: 65 | // 1. Refresh tokens XX 66 | // 2. Storing JWT in memory instead of localStorage XX 67 | 68 | // Right now: 69 | // 1. JWT tokens directly 70 | // 2. localStorage 71 | 72 | // Refresh token -> httpOnly cookie 73 | 74 | const payload = jwt.sign({ email }, JWT_SECRET_TOKEN) // 10-15 minutes 75 | 76 | return res.json({ status: 'ok', data: payload }) 77 | }) 78 | 79 | app.listen(1337) 80 | -------------------------------------------------------------------------------- /server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2017", 4 | "outDir": "build", 5 | "module": "commonjs", 6 | "esModuleInterop": true, 7 | "noImplicitAny": false, 8 | "forceConsistentCasingInFileNames": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /server/utilities.ts: -------------------------------------------------------------------------------- 1 | import WebSocket from 'ws' 2 | 3 | export const JWT_SECRET_TOKEN = 4 | 'sdifHghghdgfhjg&%^@#&^!*@&*@#&^&#^&ysduytruweiyhjfkhdsfjsdgfhjsdgqwuejgdbdshjfgj32234' 5 | 6 | export function processMessage(payload: string) { 7 | try { 8 | return JSON.parse(payload) 9 | } catch (error) { 10 | return null 11 | } 12 | } 13 | 14 | export interface CustomWebSocket extends WebSocket { 15 | connectionID: string 16 | } 17 | -------------------------------------------------------------------------------- /server/websocket.ts: -------------------------------------------------------------------------------- 1 | import WebSocket from 'ws' 2 | import { processMessage, CustomWebSocket, JWT_SECRET_TOKEN } from './utilities' 3 | import http from 'http' 4 | import jwt from 'jsonwebtoken' 5 | import { clients, setClients, broadCastMessage, retrieveAndSendMessages } from './wsfunc' 6 | 7 | const server = http.createServer() 8 | const wss = new WebSocket.Server({ noServer: true }) 9 | 10 | wss.on('connection', function connection(ws: CustomWebSocket) { 11 | // a single client has joined 12 | 13 | clients.push(ws) 14 | 15 | ws.on('close', () => { 16 | setClients( 17 | clients.filter((generalSocket) => generalSocket.connectionID !== ws.connectionID) 18 | ) 19 | }) 20 | 21 | ws.on('message', function incoming(payload) { 22 | const message = processMessage(payload.toString()) 23 | if (!message) { 24 | // corrupted message from client 25 | // ignore 26 | return 27 | } 28 | 29 | console.log(message, 'is the message') 30 | 31 | if (message.intent === 'chat') { 32 | broadCastMessage(message, ws) 33 | } else if (message.intent === 'old-messages') { 34 | const count = message.count 35 | if (!count) return 36 | 37 | retrieveAndSendMessages(ws, count) 38 | } 39 | }) 40 | }) 41 | 42 | server.on('upgrade', function upgrade(request, socket, head) { 43 | // This function is not defined on purpose. Implement it with your own logic. 44 | 45 | const token = request.url.slice(1) // / + jwt token 46 | 47 | let email: string = '' 48 | 49 | try { 50 | const payload: any = jwt.verify(token, JWT_SECRET_TOKEN) 51 | email = payload.email 52 | } catch (error) { 53 | // 54 | socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n') 55 | socket.destroy() 56 | return 57 | } 58 | 59 | wss.handleUpgrade(request, socket, head, function done(ws) { 60 | const _ws = ws as CustomWebSocket 61 | 62 | _ws.connectionID = email 63 | 64 | wss.emit('connection', _ws, request) 65 | }) 66 | // }) 67 | }) 68 | 69 | server.listen(1338) 70 | -------------------------------------------------------------------------------- /server/wsfunc.ts: -------------------------------------------------------------------------------- 1 | import { CustomWebSocket } from './utilities' 2 | import Message from './models/messages' 3 | import { v4 as uuid } from 'uuid' 4 | 5 | export let clients: CustomWebSocket[] = [] 6 | 7 | export function setClients(newClients: CustomWebSocket[]) { 8 | clients = newClients 9 | } 10 | 11 | export function broadCastMessage(message: any, ws: CustomWebSocket) { 12 | const newMessage = new Message({ 13 | email: ws.connectionID, 14 | message: message.message, 15 | date: Date.now() 16 | }) 17 | 18 | newMessage.save() 19 | 20 | // broadcast it to all clients 21 | for (let i = 0; i < clients.length; i++) { 22 | const client = clients[i] 23 | client.send( 24 | JSON.stringify({ 25 | message: message.message, 26 | user: ws.connectionID, 27 | intent: 'chat' 28 | }) 29 | ) 30 | } 31 | } 32 | 33 | export async function retrieveAndSendMessages(ws: CustomWebSocket, count: number) { 34 | const messages = await Message.find({}, { email: 1, message: 1 }) 35 | .sort({ date: -1 }) 36 | .limit(count) 37 | .lean() 38 | 39 | ws.send( 40 | JSON.stringify({ 41 | intent: 'old-messages', 42 | data: messages 43 | }) 44 | ) 45 | } 46 | -------------------------------------------------------------------------------- /server/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/body-parser@*": 6 | version "1.19.0" 7 | resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f" 8 | integrity sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ== 9 | dependencies: 10 | "@types/connect" "*" 11 | "@types/node" "*" 12 | 13 | "@types/bson@*": 14 | version "4.0.2" 15 | resolved "https://registry.yarnpkg.com/@types/bson/-/bson-4.0.2.tgz#7accb85942fc39bbdb7515d4de437c04f698115f" 16 | integrity sha512-+uWmsejEHfmSjyyM/LkrP0orfE2m5Mx9Xel4tXNeqi1ldK5XMQcDsFkBmLDtuyKUbxj2jGDo0H240fbCRJZo7Q== 17 | dependencies: 18 | "@types/node" "*" 19 | 20 | "@types/connect@*": 21 | version "3.4.33" 22 | resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.33.tgz#31610c901eca573b8713c3330abc6e6b9f588546" 23 | integrity sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A== 24 | dependencies: 25 | "@types/node" "*" 26 | 27 | "@types/cors@^2.8.7": 28 | version "2.8.7" 29 | resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.7.tgz#ab2f47f1cba93bce27dfd3639b006cc0e5600889" 30 | integrity sha512-sOdDRU3oRS7LBNTIqwDkPJyq0lpHYcbMTt0TrjzsXbk/e37hcLTH6eZX7CdbDeN0yJJvzw9hFBZkbtCSbk/jAQ== 31 | dependencies: 32 | "@types/express" "*" 33 | 34 | "@types/express-serve-static-core@*": 35 | version "4.17.12" 36 | resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.12.tgz#9a487da757425e4f267e7d1c5720226af7f89591" 37 | integrity sha512-EaEdY+Dty1jEU7U6J4CUWwxL+hyEGMkO5jan5gplfegUgCUsIUWqXxqw47uGjimeT4Qgkz/XUfwoau08+fgvKA== 38 | dependencies: 39 | "@types/node" "*" 40 | "@types/qs" "*" 41 | "@types/range-parser" "*" 42 | 43 | "@types/express@*", "@types/express@^4.17.8": 44 | version "4.17.8" 45 | resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.8.tgz#3df4293293317e61c60137d273a2e96cd8d5f27a" 46 | integrity sha512-wLhcKh3PMlyA2cNAB9sjM1BntnhPMiM0JOBwPBqttjHev2428MLEB4AYVN+d8s2iyCVZac+o41Pflm/ZH5vLXQ== 47 | dependencies: 48 | "@types/body-parser" "*" 49 | "@types/express-serve-static-core" "*" 50 | "@types/qs" "*" 51 | "@types/serve-static" "*" 52 | 53 | "@types/jsonwebtoken@^8.5.0": 54 | version "8.5.0" 55 | resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz#2531d5e300803aa63279b232c014acf780c981c5" 56 | integrity sha512-9bVao7LvyorRGZCw0VmH/dr7Og+NdjYSsKAxB43OQoComFbBgsEpoR9JW6+qSq/ogwVBg8GI2MfAlk4SYI4OLg== 57 | dependencies: 58 | "@types/node" "*" 59 | 60 | "@types/mime@*": 61 | version "2.0.3" 62 | resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.3.tgz#c893b73721db73699943bfc3653b1deb7faa4a3a" 63 | integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== 64 | 65 | "@types/mongodb@*": 66 | version "3.5.27" 67 | resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.5.27.tgz#158a7a43ce25ef3592ac8a62e62ab38bebf661f2" 68 | integrity sha512-1jxKDgdfJEOO9zp+lv43p8jOqRs02xPrdUTzAZIVK9tVEySfCEmktL2jEu9A3wOBEOs18yKzpVIKUh8b8ALk3w== 69 | dependencies: 70 | "@types/bson" "*" 71 | "@types/node" "*" 72 | 73 | "@types/mongoose@^5.7.36": 74 | version "5.7.36" 75 | resolved "https://registry.yarnpkg.com/@types/mongoose/-/mongoose-5.7.36.tgz#2dae28c63041c6afba8a83ea02969f463b3f1021" 76 | integrity sha512-ggFXgvkHgCNlT35B9d/heDYfSqOSwTmQjkRoR32sObGV5Xjd0N0WWuYlLzqeCg94j4hYN/OZxZ1VNNLltX/IVQ== 77 | dependencies: 78 | "@types/mongodb" "*" 79 | "@types/node" "*" 80 | 81 | "@types/node@*", "@types/node@^14.6.4": 82 | version "14.6.4" 83 | resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.4.tgz#a145cc0bb14ef9c4777361b7bbafa5cf8e3acb5a" 84 | integrity sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ== 85 | 86 | "@types/qs@*": 87 | version "6.9.4" 88 | resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.4.tgz#a59e851c1ba16c0513ea123830dd639a0a15cb6a" 89 | integrity sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ== 90 | 91 | "@types/range-parser@*": 92 | version "1.2.3" 93 | resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" 94 | integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== 95 | 96 | "@types/serve-static@*": 97 | version "1.13.5" 98 | resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.5.tgz#3d25d941a18415d3ab092def846e135a08bbcf53" 99 | integrity sha512-6M64P58N+OXjU432WoLLBQxbA0LRGBCRm7aAGQJ+SMC1IMl0dgRVi9EFfoDcS2a7Xogygk/eGN94CfwU9UF7UQ== 100 | dependencies: 101 | "@types/express-serve-static-core" "*" 102 | "@types/mime" "*" 103 | 104 | "@types/ws@^7.2.6": 105 | version "7.2.6" 106 | resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.2.6.tgz#516cbfb818310f87b43940460e065eb912a4178d" 107 | integrity sha512-Q07IrQUSNpr+cXU4E4LtkSIBPie5GLZyyMC1QtQYRLWz701+XcoVygGUZgvLqElq1nU4ICldMYPnexlBsg3dqQ== 108 | dependencies: 109 | "@types/node" "*" 110 | 111 | accepts@~1.3.7: 112 | version "1.3.7" 113 | resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" 114 | integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== 115 | dependencies: 116 | mime-types "~2.1.24" 117 | negotiator "0.6.2" 118 | 119 | array-flatten@1.1.1: 120 | version "1.1.1" 121 | resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" 122 | integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= 123 | 124 | bl@^2.2.0: 125 | version "2.2.1" 126 | resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5" 127 | integrity sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g== 128 | dependencies: 129 | readable-stream "^2.3.5" 130 | safe-buffer "^5.1.1" 131 | 132 | bluebird@3.5.1: 133 | version "3.5.1" 134 | resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" 135 | integrity sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== 136 | 137 | body-parser@1.19.0, body-parser@^1.19.0: 138 | version "1.19.0" 139 | resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" 140 | integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== 141 | dependencies: 142 | bytes "3.1.0" 143 | content-type "~1.0.4" 144 | debug "2.6.9" 145 | depd "~1.1.2" 146 | http-errors "1.7.2" 147 | iconv-lite "0.4.24" 148 | on-finished "~2.3.0" 149 | qs "6.7.0" 150 | raw-body "2.4.0" 151 | type-is "~1.6.17" 152 | 153 | bson@^1.1.4: 154 | version "1.1.5" 155 | resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.5.tgz#2aaae98fcdf6750c0848b0cba1ddec3c73060a34" 156 | integrity sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg== 157 | 158 | buffer-equal-constant-time@1.0.1: 159 | version "1.0.1" 160 | resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" 161 | integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= 162 | 163 | bytes@3.1.0: 164 | version "3.1.0" 165 | resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" 166 | integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== 167 | 168 | content-disposition@0.5.3: 169 | version "0.5.3" 170 | resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" 171 | integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== 172 | dependencies: 173 | safe-buffer "5.1.2" 174 | 175 | content-type@~1.0.4: 176 | version "1.0.4" 177 | resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" 178 | integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== 179 | 180 | cookie-signature@1.0.6: 181 | version "1.0.6" 182 | resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" 183 | integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= 184 | 185 | cookie@0.4.0: 186 | version "0.4.0" 187 | resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" 188 | integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== 189 | 190 | core-util-is@~1.0.0: 191 | version "1.0.2" 192 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 193 | integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= 194 | 195 | cors@^2.8.5: 196 | version "2.8.5" 197 | resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" 198 | integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== 199 | dependencies: 200 | object-assign "^4" 201 | vary "^1" 202 | 203 | debug@2.6.9: 204 | version "2.6.9" 205 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" 206 | integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== 207 | dependencies: 208 | ms "2.0.0" 209 | 210 | debug@3.1.0: 211 | version "3.1.0" 212 | resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" 213 | integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== 214 | dependencies: 215 | ms "2.0.0" 216 | 217 | denque@^1.4.1: 218 | version "1.4.1" 219 | resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf" 220 | integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ== 221 | 222 | depd@~1.1.2: 223 | version "1.1.2" 224 | resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" 225 | integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= 226 | 227 | destroy@~1.0.4: 228 | version "1.0.4" 229 | resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" 230 | integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= 231 | 232 | ecdsa-sig-formatter@1.0.11: 233 | version "1.0.11" 234 | resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" 235 | integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== 236 | dependencies: 237 | safe-buffer "^5.0.1" 238 | 239 | ee-first@1.1.1: 240 | version "1.1.1" 241 | resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" 242 | integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= 243 | 244 | encodeurl@~1.0.2: 245 | version "1.0.2" 246 | resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" 247 | integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= 248 | 249 | escape-html@~1.0.3: 250 | version "1.0.3" 251 | resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" 252 | integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= 253 | 254 | etag@~1.8.1: 255 | version "1.8.1" 256 | resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" 257 | integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= 258 | 259 | express@^4.17.1: 260 | version "4.17.1" 261 | resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" 262 | integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== 263 | dependencies: 264 | accepts "~1.3.7" 265 | array-flatten "1.1.1" 266 | body-parser "1.19.0" 267 | content-disposition "0.5.3" 268 | content-type "~1.0.4" 269 | cookie "0.4.0" 270 | cookie-signature "1.0.6" 271 | debug "2.6.9" 272 | depd "~1.1.2" 273 | encodeurl "~1.0.2" 274 | escape-html "~1.0.3" 275 | etag "~1.8.1" 276 | finalhandler "~1.1.2" 277 | fresh "0.5.2" 278 | merge-descriptors "1.0.1" 279 | methods "~1.1.2" 280 | on-finished "~2.3.0" 281 | parseurl "~1.3.3" 282 | path-to-regexp "0.1.7" 283 | proxy-addr "~2.0.5" 284 | qs "6.7.0" 285 | range-parser "~1.2.1" 286 | safe-buffer "5.1.2" 287 | send "0.17.1" 288 | serve-static "1.14.1" 289 | setprototypeof "1.1.1" 290 | statuses "~1.5.0" 291 | type-is "~1.6.18" 292 | utils-merge "1.0.1" 293 | vary "~1.1.2" 294 | 295 | finalhandler@~1.1.2: 296 | version "1.1.2" 297 | resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" 298 | integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== 299 | dependencies: 300 | debug "2.6.9" 301 | encodeurl "~1.0.2" 302 | escape-html "~1.0.3" 303 | on-finished "~2.3.0" 304 | parseurl "~1.3.3" 305 | statuses "~1.5.0" 306 | unpipe "~1.0.0" 307 | 308 | forwarded@~0.1.2: 309 | version "0.1.2" 310 | resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" 311 | integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= 312 | 313 | fresh@0.5.2: 314 | version "0.5.2" 315 | resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" 316 | integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= 317 | 318 | http-errors@1.7.2: 319 | version "1.7.2" 320 | resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" 321 | integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== 322 | dependencies: 323 | depd "~1.1.2" 324 | inherits "2.0.3" 325 | setprototypeof "1.1.1" 326 | statuses ">= 1.5.0 < 2" 327 | toidentifier "1.0.0" 328 | 329 | http-errors@~1.7.2: 330 | version "1.7.3" 331 | resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" 332 | integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== 333 | dependencies: 334 | depd "~1.1.2" 335 | inherits "2.0.4" 336 | setprototypeof "1.1.1" 337 | statuses ">= 1.5.0 < 2" 338 | toidentifier "1.0.0" 339 | 340 | iconv-lite@0.4.24: 341 | version "0.4.24" 342 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" 343 | integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== 344 | dependencies: 345 | safer-buffer ">= 2.1.2 < 3" 346 | 347 | inherits@2.0.3: 348 | version "2.0.3" 349 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 350 | integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= 351 | 352 | inherits@2.0.4, inherits@~2.0.3: 353 | version "2.0.4" 354 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 355 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 356 | 357 | ipaddr.js@1.9.1: 358 | version "1.9.1" 359 | resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" 360 | integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== 361 | 362 | isarray@~1.0.0: 363 | version "1.0.0" 364 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 365 | integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= 366 | 367 | jsonwebtoken@^8.5.1: 368 | version "8.5.1" 369 | resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d" 370 | integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w== 371 | dependencies: 372 | jws "^3.2.2" 373 | lodash.includes "^4.3.0" 374 | lodash.isboolean "^3.0.3" 375 | lodash.isinteger "^4.0.4" 376 | lodash.isnumber "^3.0.3" 377 | lodash.isplainobject "^4.0.6" 378 | lodash.isstring "^4.0.1" 379 | lodash.once "^4.0.0" 380 | ms "^2.1.1" 381 | semver "^5.6.0" 382 | 383 | jwa@^1.4.1: 384 | version "1.4.1" 385 | resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" 386 | integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== 387 | dependencies: 388 | buffer-equal-constant-time "1.0.1" 389 | ecdsa-sig-formatter "1.0.11" 390 | safe-buffer "^5.0.1" 391 | 392 | jws@^3.2.2: 393 | version "3.2.2" 394 | resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" 395 | integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== 396 | dependencies: 397 | jwa "^1.4.1" 398 | safe-buffer "^5.0.1" 399 | 400 | kareem@2.3.1: 401 | version "2.3.1" 402 | resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.1.tgz#def12d9c941017fabfb00f873af95e9c99e1be87" 403 | integrity sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw== 404 | 405 | lodash.includes@^4.3.0: 406 | version "4.3.0" 407 | resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" 408 | integrity sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8= 409 | 410 | lodash.isboolean@^3.0.3: 411 | version "3.0.3" 412 | resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" 413 | integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= 414 | 415 | lodash.isinteger@^4.0.4: 416 | version "4.0.4" 417 | resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" 418 | integrity sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= 419 | 420 | lodash.isnumber@^3.0.3: 421 | version "3.0.3" 422 | resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" 423 | integrity sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w= 424 | 425 | lodash.isplainobject@^4.0.6: 426 | version "4.0.6" 427 | resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" 428 | integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= 429 | 430 | lodash.isstring@^4.0.1: 431 | version "4.0.1" 432 | resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" 433 | integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= 434 | 435 | lodash.once@^4.0.0: 436 | version "4.1.1" 437 | resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" 438 | integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= 439 | 440 | media-typer@0.3.0: 441 | version "0.3.0" 442 | resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" 443 | integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= 444 | 445 | memory-pager@^1.0.2: 446 | version "1.5.0" 447 | resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" 448 | integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg== 449 | 450 | merge-descriptors@1.0.1: 451 | version "1.0.1" 452 | resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" 453 | integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= 454 | 455 | methods@~1.1.2: 456 | version "1.1.2" 457 | resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" 458 | integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= 459 | 460 | mime-db@1.44.0: 461 | version "1.44.0" 462 | resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" 463 | integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== 464 | 465 | mime-types@~2.1.24: 466 | version "2.1.27" 467 | resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" 468 | integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== 469 | dependencies: 470 | mime-db "1.44.0" 471 | 472 | mime@1.6.0: 473 | version "1.6.0" 474 | resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" 475 | integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== 476 | 477 | mongodb@3.6.1: 478 | version "3.6.1" 479 | resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.1.tgz#2c5cc2a81456ba183e8c432d80e78732cc72dabd" 480 | integrity sha512-uH76Zzr5wPptnjEKJRQnwTsomtFOU/kQEU8a9hKHr2M7y9qVk7Q4Pkv0EQVp88742z9+RwvsdTw6dRjDZCNu1g== 481 | dependencies: 482 | bl "^2.2.0" 483 | bson "^1.1.4" 484 | denque "^1.4.1" 485 | require_optional "^1.0.1" 486 | safe-buffer "^5.1.2" 487 | optionalDependencies: 488 | saslprep "^1.0.0" 489 | 490 | mongoose-legacy-pluralize@1.0.2: 491 | version "1.0.2" 492 | resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4" 493 | integrity sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ== 494 | 495 | mongoose@^5.10.3: 496 | version "5.10.3" 497 | resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.10.3.tgz#ef28cda3f11e5bf75a309a25e9899f856a5a5370" 498 | integrity sha512-FLemltuzcsCHlFpEZ3bYOiNhJfHful+GoS+3uRgdEWGlY0HKfOjm9xsISM/tql8vRvhjr7qveuRfoBBGO3xNtw== 499 | dependencies: 500 | bson "^1.1.4" 501 | kareem "2.3.1" 502 | mongodb "3.6.1" 503 | mongoose-legacy-pluralize "1.0.2" 504 | mpath "0.7.0" 505 | mquery "3.2.2" 506 | ms "2.1.2" 507 | regexp-clone "1.0.0" 508 | safe-buffer "5.2.1" 509 | sift "7.0.1" 510 | sliced "1.0.1" 511 | 512 | mpath@0.7.0: 513 | version "0.7.0" 514 | resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.7.0.tgz#20e8102e276b71709d6e07e9f8d4d0f641afbfb8" 515 | integrity sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg== 516 | 517 | mquery@3.2.2: 518 | version "3.2.2" 519 | resolved "https://registry.yarnpkg.com/mquery/-/mquery-3.2.2.tgz#e1383a3951852ce23e37f619a9b350f1fb3664e7" 520 | integrity sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q== 521 | dependencies: 522 | bluebird "3.5.1" 523 | debug "3.1.0" 524 | regexp-clone "^1.0.0" 525 | safe-buffer "5.1.2" 526 | sliced "1.0.1" 527 | 528 | ms@2.0.0: 529 | version "2.0.0" 530 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 531 | integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= 532 | 533 | ms@2.1.1: 534 | version "2.1.1" 535 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" 536 | integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== 537 | 538 | ms@2.1.2, ms@^2.1.1: 539 | version "2.1.2" 540 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" 541 | integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== 542 | 543 | negotiator@0.6.2: 544 | version "0.6.2" 545 | resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" 546 | integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== 547 | 548 | object-assign@^4: 549 | version "4.1.1" 550 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 551 | integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= 552 | 553 | on-finished@~2.3.0: 554 | version "2.3.0" 555 | resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" 556 | integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= 557 | dependencies: 558 | ee-first "1.1.1" 559 | 560 | parseurl@~1.3.3: 561 | version "1.3.3" 562 | resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" 563 | integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== 564 | 565 | path-to-regexp@0.1.7: 566 | version "0.1.7" 567 | resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" 568 | integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= 569 | 570 | process-nextick-args@~2.0.0: 571 | version "2.0.1" 572 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" 573 | integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== 574 | 575 | proxy-addr@~2.0.5: 576 | version "2.0.6" 577 | resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" 578 | integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== 579 | dependencies: 580 | forwarded "~0.1.2" 581 | ipaddr.js "1.9.1" 582 | 583 | qs@6.7.0: 584 | version "6.7.0" 585 | resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" 586 | integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== 587 | 588 | range-parser@~1.2.1: 589 | version "1.2.1" 590 | resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" 591 | integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== 592 | 593 | raw-body@2.4.0: 594 | version "2.4.0" 595 | resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" 596 | integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== 597 | dependencies: 598 | bytes "3.1.0" 599 | http-errors "1.7.2" 600 | iconv-lite "0.4.24" 601 | unpipe "1.0.0" 602 | 603 | readable-stream@^2.3.5: 604 | version "2.3.7" 605 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" 606 | integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== 607 | dependencies: 608 | core-util-is "~1.0.0" 609 | inherits "~2.0.3" 610 | isarray "~1.0.0" 611 | process-nextick-args "~2.0.0" 612 | safe-buffer "~5.1.1" 613 | string_decoder "~1.1.1" 614 | util-deprecate "~1.0.1" 615 | 616 | regexp-clone@1.0.0, regexp-clone@^1.0.0: 617 | version "1.0.0" 618 | resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63" 619 | integrity sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw== 620 | 621 | require_optional@^1.0.1: 622 | version "1.0.1" 623 | resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e" 624 | integrity sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g== 625 | dependencies: 626 | resolve-from "^2.0.0" 627 | semver "^5.1.0" 628 | 629 | resolve-from@^2.0.0: 630 | version "2.0.0" 631 | resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" 632 | integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= 633 | 634 | safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: 635 | version "5.1.2" 636 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" 637 | integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== 638 | 639 | safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2: 640 | version "5.2.1" 641 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" 642 | integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== 643 | 644 | "safer-buffer@>= 2.1.2 < 3": 645 | version "2.1.2" 646 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 647 | integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== 648 | 649 | saslprep@^1.0.0: 650 | version "1.0.3" 651 | resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226" 652 | integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag== 653 | dependencies: 654 | sparse-bitfield "^3.0.3" 655 | 656 | semver@^5.1.0, semver@^5.6.0: 657 | version "5.7.1" 658 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" 659 | integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== 660 | 661 | send@0.17.1: 662 | version "0.17.1" 663 | resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" 664 | integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== 665 | dependencies: 666 | debug "2.6.9" 667 | depd "~1.1.2" 668 | destroy "~1.0.4" 669 | encodeurl "~1.0.2" 670 | escape-html "~1.0.3" 671 | etag "~1.8.1" 672 | fresh "0.5.2" 673 | http-errors "~1.7.2" 674 | mime "1.6.0" 675 | ms "2.1.1" 676 | on-finished "~2.3.0" 677 | range-parser "~1.2.1" 678 | statuses "~1.5.0" 679 | 680 | serve-static@1.14.1: 681 | version "1.14.1" 682 | resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" 683 | integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== 684 | dependencies: 685 | encodeurl "~1.0.2" 686 | escape-html "~1.0.3" 687 | parseurl "~1.3.3" 688 | send "0.17.1" 689 | 690 | setprototypeof@1.1.1: 691 | version "1.1.1" 692 | resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" 693 | integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== 694 | 695 | sift@7.0.1: 696 | version "7.0.1" 697 | resolved "https://registry.yarnpkg.com/sift/-/sift-7.0.1.tgz#47d62c50b159d316f1372f8b53f9c10cd21a4b08" 698 | integrity sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g== 699 | 700 | sliced@1.0.1: 701 | version "1.0.1" 702 | resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" 703 | integrity sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E= 704 | 705 | sparse-bitfield@^3.0.3: 706 | version "3.0.3" 707 | resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11" 708 | integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE= 709 | dependencies: 710 | memory-pager "^1.0.2" 711 | 712 | "statuses@>= 1.5.0 < 2", statuses@~1.5.0: 713 | version "1.5.0" 714 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" 715 | integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= 716 | 717 | string_decoder@~1.1.1: 718 | version "1.1.1" 719 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" 720 | integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== 721 | dependencies: 722 | safe-buffer "~5.1.0" 723 | 724 | toidentifier@1.0.0: 725 | version "1.0.0" 726 | resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" 727 | integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== 728 | 729 | type-is@~1.6.17, type-is@~1.6.18: 730 | version "1.6.18" 731 | resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" 732 | integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== 733 | dependencies: 734 | media-typer "0.3.0" 735 | mime-types "~2.1.24" 736 | 737 | unpipe@1.0.0, unpipe@~1.0.0: 738 | version "1.0.0" 739 | resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" 740 | integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= 741 | 742 | util-deprecate@~1.0.1: 743 | version "1.0.2" 744 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 745 | integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= 746 | 747 | utils-merge@1.0.1: 748 | version "1.0.1" 749 | resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" 750 | integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= 751 | 752 | uuid@^8.3.0: 753 | version "8.3.0" 754 | resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" 755 | integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== 756 | 757 | vary@^1, vary@~1.1.2: 758 | version "1.1.2" 759 | resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" 760 | integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= 761 | 762 | ws@^7.3.1: 763 | version "7.3.1" 764 | resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" 765 | integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== 766 | --------------------------------------------------------------------------------