Eric Whale

fix npm script

...@@ -6,22 +6,23 @@ This web-app project contains 3 functionality. ...@@ -6,22 +6,23 @@ This web-app project contains 3 functionality.
6 6
7 1. Weather Chatbot that doesn't look like a chatting app. 7 1. Weather Chatbot that doesn't look like a chatting app.
8 2. twitter like social network service. 8 2. twitter like social network service.
9 -3. Secure(encrypted) messaging service. 9 +3. Secure(encrypted) messaging service. (not built)
10 10
11 The main goal of this project is not to make something useful but to learn/use as much as possible. 11 The main goal of this project is not to make something useful but to learn/use as much as possible.
12 12
13 -## Getting Started (How to Visit) 13 +## Getting Started (URL)
14 14
15 -[weather-chatbot URL]() 15 +[weather-chatbot URL](www.weatherchatbotproject.site)
16 16
17 ## Roadmap 17 ## Roadmap
18 18
19 * Front End : React 19 * Front End : React
20 * Back End : node.js & expressjs 20 * Back End : node.js & expressjs
21 -* authentication/authorization : JWT 21 +* authentication/authorization : JWT, bcypt
22 +* Domain : domain.com
23 +* Hosting : aws lightsail
22 24
23 ## License 25 ## License
24 26
25 -This web-app uses MIT License 27 +MIT License
26 28
27 -## Contact
......
1 +{
2 + "files": {
3 + "main.css": "/static/css/main.fc5fddbc.css",
4 + "main.js": "/static/js/main.2be8dfae.js",
5 + "static/js/787.c4e7f8f9.chunk.js": "/static/js/787.c4e7f8f9.chunk.js",
6 + "index.html": "/index.html",
7 + "main.fc5fddbc.css.map": "/static/css/main.fc5fddbc.css.map",
8 + "main.2be8dfae.js.map": "/static/js/main.2be8dfae.js.map",
9 + "787.c4e7f8f9.chunk.js.map": "/static/js/787.c4e7f8f9.chunk.js.map"
10 + },
11 + "entrypoints": [
12 + "static/css/main.fc5fddbc.css",
13 + "static/js/main.2be8dfae.js"
14 + ]
15 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="manifest" href="/manifest.json"/><title>Weather Chatbot</title><script defer="defer" src="/static/js/main.2be8dfae.js"></script><link href="/static/css/main.fc5fddbc.css" rel="stylesheet"></head><body style="width:100vw"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root" style="width:100vw;margin:0;padding:0"></div></body></html>
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "short_name": "React App",
3 + "name": "Create React App Sample",
4 + "icons": [{}],
5 + "start_url": ".",
6 + "display": "standalone",
7 + "theme_color": "#000000",
8 + "background_color": "#ffffff"
9 +}
1 +# https://www.robotstxt.org/robotstxt.html
2 +User-agent: *
3 +Disallow:
1 +.bottombar,.topbar{align-items:center;display:flex;flex-direction:row;font-size:3rem;height:9vh;justify-content:space-between;padding:10px;position:fixed;text-align:center;width:99%}.bottombar a,.topbar a{color:#008b8b;height:90%;text-decoration:none;width:45%}.bottombar a:hover,.topbar a:hover{color:#00ced1}.bottombar .logo,.topbar .logo{color:teal;font-size:4rem}.bottombar *,.topbar *{padding:.3rem .5rem}.topbar{border-bottom:4px solid gray;justify-content:space-between;margin-bottom:.5rem;top:0}.topbar a{height:5rem}.topbar .logo{font-size:5rem;text-align:left}.topbar .settings{font-size:4.5rem;text-align:right}.topbar .title{width:65vw}.bottombar{border-top:4px solid gray;bottom:0;height:4rem;margin-top:.5rem}.bottombar .bottomBtn{border:1px solid gray;border-radius:3px;box-shadow:3px 3px 3px 0 gray;margin-left:.4rem;margin-right:.4rem}.bottombar .bottomBtn:hover{box-shadow:1px 1px 3px 0 gray}html{height:100vh}*{background-color:#ffdead;margin:0;padding:0}.container{justify-content:center}.container,.mainBox{display:flex;flex-direction:column}.mainBox{align-items:center;margin-bottom:10vh;margin-top:13vh;min-height:82vh;padding-left:1rem;padding-right:1rem}.mainBox,.mainBox *{font-size:2rem}.mainBox h2{font-size:2.5rem}.authForm{display:flex;flex-direction:column}.authForm input{width:100%}.authForm label{margin-bottom:.2rem;margin-top:.2rem}.submitBtn{border:2px solid green;border-radius:4px;color:green;width:40%}.submitBtn input{background-color:green}.logoutBtn{background-color:red;border-radius:4px;width:35%}.weather-buttons{display:flex;flex-direction:row}.weather-buttons button{background-color:#8a2be2;border-radius:6px;box-shadow:4px 4px 4px 2px gray;color:#fff;margin-left:.5rem;margin-right:.5rem;padding:.3rem}.forecastItemBox{border:2px solid gray;border-radius:4px;margin-bottom:.3rem;padding:.1rem}.forecastItemBox p{font-size:1.5rem}.forecastItemBox small{font-size:1rem}hr{margin-bottom:.3rem;margin-top:.5rem}.tweetBox{border:2px solid gray;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-bottom:1rem;padding:.2rem .4rem;width:55%}.tweetBox small{font-size:1.5rem;margin-top:.3rem}.tweetBox small b{font-size:1.6rem;margin-right:.5rem}.usersBox{margin-top:10vh}.userBox{align-items:center;border:.2rem solid #000;border-radius:10px;display:flex;flex-direction:row;font-size:1.4rem;justify-content:flex-start;margin:1rem}.userBox *{padding:.3rem .5rem}
2 +/*# sourceMappingURL=main.fc5fddbc.css.map*/
...\ No newline at end of file ...\ No newline at end of file
1 +{"version":3,"file":"static/css/main.fc5fddbc.css","mappings":"AAAA,mBAKE,mBAHA,aACA,mBAOA,eAFA,WAJA,8BAGA,aAEA,eAHA,kBAKA,UACA,uBAIE,cAFA,WACA,qBAFA,SAGA,CAEF,mCACE,cAEF,+BACE,WACA,eAGF,uBACE,oBAIJ,QAGE,6BADA,8BADA,oBAGA,MACA,UACE,YAEF,cACE,eACA,gBAEF,kBACE,iBACA,iBAEF,eACE,WAGJ,WAEE,0BACA,SACA,YAHA,gBAGA,CACA,sBAGE,sBACA,kBACA,8BAHA,kBADA,kBAIA,CAEF,4BACE,8BChEJ,KACE,aAEF,EAGE,yBAFA,SACA,SACA,CAGF,WAGE,uBAGF,oBALE,aACA,qBAaA,CATF,SAGE,mBAGA,mBADA,gBADA,gBAGA,kBACA,kBACA,CACA,oBADA,cAEE,CAEF,YACE,iBAIJ,UACE,aACA,sBAEA,gBACE,WAGF,gBAEE,oBADA,gBACA,CAIJ,WAGE,uBACA,kBAFA,YADA,SAGA,CACA,iBACE,uBAIJ,WAGE,qBADA,kBADA,SAEA,CAGF,iBACE,aACA,mBACA,wBAKE,yBADA,kBAGA,gCADA,WALA,kBACA,mBACA,aAIA,CAIJ,iBAGE,sBACA,kBAHA,oBACA,aAEA,CAEA,mBACE,iBAEF,uBACE,eAIJ,GAEE,oBADA,gBACA,CAIF,UAKE,sBACA,kBALA,aAEA,sBADA,uBAKA,mBACA,oBAJA,SAIA,CACA,gBACE,iBACA,iBACA,kBACE,iBACA,mBC/GN,UACE,gBAEF,SAOE,mBALA,wBACA,mBACA,aACA,mBAGA,iBAFA,2BALA,WAOA,CAEA,WACE","sources":["styles/bar.scss","styles/layout.scss","styles/box.scss"],"sourcesContent":[".topbar,\n.bottombar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n padding: 10px;\n height: 9vh;\n position: fixed;\n font-size: 3rem;\n width: 99%;\n a {\n width: 45%;\n height: 90%;\n text-decoration: none;\n color: #008b8b;\n }\n a:hover {\n color: #00ced1;\n }\n .logo {\n color: #008080;\n font-size: 4rem;\n }\n\n * {\n padding: 0.3rem 0.5rem;\n }\n}\n\n.topbar {\n margin-bottom: 0.5rem;\n justify-content: space-between;\n border-bottom: 4px gray solid;\n top: 0;\n a {\n height: 5rem;\n }\n .logo {\n font-size: 5rem;\n text-align: left;\n }\n .settings {\n font-size: 4.5rem;\n text-align: right;\n }\n .title {\n width: 65vw;\n }\n}\n.bottombar {\n margin-top: 0.5rem;\n border-top: 4px gray solid;\n bottom: 0;\n height: 4rem;\n .bottomBtn {\n margin-right: 0.4rem;\n margin-left: 0.4rem;\n border: 1px solid gray;\n border-radius: 3px;\n box-shadow: 3px 3px 3px 0px gray;\n }\n .bottomBtn:hover {\n box-shadow: 1px 1px 3px 0px gray;\n }\n}\n","html {\n height: 100vh;\n}\n* {\n margin: 0;\n padding: 0;\n background-color: #ffdead;\n}\n\n.container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.mainBox {\n display: flex;\n flex-direction: column;\n align-items: center;\n min-height: 82vh;\n margin-top: 13vh;\n margin-bottom: 10vh;\n padding-left: 1rem;\n padding-right: 1rem;\n font-size: 2rem;\n * {\n font-size: 2rem;\n }\n h2 {\n font-size: 2.5rem;\n }\n}\n\n.authForm {\n display: flex;\n flex-direction: column;\n\n input {\n width: 100%;\n }\n\n label {\n margin-top: 0.2rem;\n margin-bottom: 0.2rem;\n }\n}\n\n.submitBtn {\n width: 40%;\n color: green;\n border: green 2px solid;\n border-radius: 4px;\n input {\n background-color: green;\n }\n}\n\n.logoutBtn {\n width: 35%;\n border-radius: 4px;\n background-color: red;\n}\n\n.weather-buttons {\n display: flex;\n flex-direction: row;\n button {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n padding: 0.3rem;\n border-radius: 6px;\n background-color: blueviolet;\n color: white;\n box-shadow: 4px 4px 4px 2px gray;\n }\n}\n\n.forecastItemBox {\n margin-bottom: 0.3rem;\n padding: 0.1rem;\n border: 2px gray solid;\n border-radius: 4px;\n\n p {\n font-size: 1.5rem;\n }\n small {\n font-size: 1rem;\n }\n}\n\nhr {\n margin-top: 0.5rem;\n margin-bottom: 0.3rem;\n}\n\n// tweets\n.tweetBox {\n display: flex;\n justify-content: center;\n flex-direction: column;\n width: 55%;\n border: solid gray 2px;\n border-radius: 4px;\n margin-bottom: 1rem;\n padding: 0.2rem 0.4rem;\n small {\n font-size: 1.5rem;\n margin-top: 0.3rem;\n b {\n font-size: 1.6rem;\n margin-right: 0.5rem;\n }\n }\n}\n",".usersBox {\n margin-top: 10vh;\n}\n.userBox {\n margin: 1rem;\n border: 0.2rem black solid;\n border-radius: 10px;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 1.4rem;\n\n * {\n padding: 0.3rem 0.5rem;\n }\n}\n"],"names":[],"sourceRoot":""}
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([[787],{787:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return g},getFID:function(){return C},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},h=!1,T=-1,y=function(e,t){h||(g((function(e){T=e.value})),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},C=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},d=c("first-input",p);n=m(e,v,t),d&&f((function(){d.takeRecords().map(p),d.disconnect()}),!0),d&&s((function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,F(addEventListener),a=p,o.push(a),S()}))},k={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){k[r.id]||(o.takeRecords().map(a),o.disconnect(),k[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),f(v,!0),s((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,k[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]);
2 +//# sourceMappingURL=787.c4e7f8f9.chunk.js.map
...\ No newline at end of file ...\ No newline at end of file
1 +{"version":3,"file":"static/js/787.c4e7f8f9.chunk.js","mappings":"iQAAA,IAAIA,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,SAASJ,EAAEC,GAAG,MAAM,CAACI,KAAKL,EAAEM,WAAM,IAASL,GAAG,EAAEA,EAAEM,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKC,MAAM,KAAKF,OAAOG,KAAKC,MAAM,cAAcD,KAAKE,UAAU,QAAQC,EAAE,SAAShB,EAAEC,GAAG,IAAI,GAAGgB,oBAAoBC,oBAAoBC,SAASnB,GAAG,CAAC,GAAG,gBAAgBA,KAAK,2BAA2BoB,MAAM,OAAO,IAAIlB,EAAE,IAAIe,qBAAqB,SAASjB,GAAG,OAAOA,EAAEqB,aAAaC,IAAIrB,MAAM,OAAOC,EAAEqB,QAAQ,CAACC,KAAKxB,EAAEyB,UAAS,IAAKvB,GAAG,MAAMF,MAAM0B,EAAE,SAAS1B,EAAEC,GAAG,IAAIC,EAAE,SAASA,EAAEC,GAAG,aAAaA,EAAEqB,MAAM,WAAWG,SAASC,kBAAkB5B,EAAEG,GAAGF,IAAI4B,oBAAoB,mBAAmB3B,GAAE,GAAI2B,oBAAoB,WAAW3B,GAAE,MAAO4B,iBAAiB,mBAAmB5B,GAAE,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,MAAM,GAAGJ,EAAEI,MAAMwC,YAAYlC,MAAM,OAAOV,EAAEM,QAAQ,CAACP,GAAGD,EAAEE,GAAG,MAAMF,MAAM,aAAa2B,SAASmD,WAAWvC,WAAWtC,EAAE,GAAG6B,iBAAiB,QAAQ,WAAW,OAAOS,WAAWtC,EAAE","sources":["../node_modules/web-vitals/dist/web-vitals.js"],"sourcesContent":["var e,t,n,i,r=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v2-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},a=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(\"first-input\"===e&&!(\"PerformanceEventTiming\"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},u=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},c=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=-1,s=function(){return\"hidden\"===document.visibilityState?0:1/0},m=function(){o((function(e){var t=e.timeStamp;f=t}),!0)},v=function(){return f<0&&(f=s(),m(),u((function(){setTimeout((function(){f=s(),m()}),0)}))),{get firstHiddenTime(){return f}}},d=function(e,t){var n,i=v(),o=r(\"FCP\"),f=function(e){\"first-contentful-paint\"===e.name&&(m&&m.disconnect(),e.startTime<i.firstHiddenTime&&(o.value=e.startTime,o.entries.push(e),n(!0)))},s=window.performance&&performance.getEntriesByName&&performance.getEntriesByName(\"first-contentful-paint\")[0],m=s?null:a(\"paint\",f);(s||m)&&(n=c(e,o,t),s&&f(s),u((function(i){o=r(\"FCP\"),n=c(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,n(!0)}))}))})))},p=!1,l=-1,h=function(e,t){p||(d((function(e){l=e.value})),p=!0);var n,i=function(t){l>-1&&e(t)},f=r(\"CLS\",0),s=0,m=[],v=function(e){if(!e.hadRecentInput){var t=m[0],i=m[m.length-1];s&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,m.push(e)):(s=e.value,m=[e]),s>f.value&&(f.value=s,f.entries=m,n())}},h=a(\"layout-shift\",v);h&&(n=c(i,f,t),o((function(){h.takeRecords().map(v),n(!0)})),u((function(){s=0,l=-1,f=r(\"CLS\",0),n=c(i,f,t)})))},T={passive:!0,capture:!0},y=new Date,g=function(i,r){e||(e=r,t=i,n=new Date,w(removeEventListener),E())},E=function(){if(t>=0&&t<n-y){var r={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(r)})),i=[]}},S=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){g(e,t),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",n,T),removeEventListener(\"pointercancel\",i,T)};addEventListener(\"pointerup\",n,T),addEventListener(\"pointercancel\",i,T)}(t,e):g(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,S,T)}))},L=function(n,f){var s,m=v(),d=r(\"FID\"),p=function(e){e.startTime<m.firstHiddenTime&&(d.value=e.processingStart-e.startTime,d.entries.push(e),s(!0))},l=a(\"first-input\",p);s=c(n,d,f),l&&o((function(){l.takeRecords().map(p),l.disconnect()}),!0),l&&u((function(){var a;d=r(\"FID\"),s=c(n,d,f),i=[],t=-1,e=null,w(addEventListener),a=p,i.push(a),E()}))},b={},F=function(e,t){var n,i=v(),f=r(\"LCP\"),s=function(e){var t=e.startTime;t<i.firstHiddenTime&&(f.value=t,f.entries.push(e),n())},m=a(\"largest-contentful-paint\",s);if(m){n=c(e,f,t);var d=function(){b[f.id]||(m.takeRecords().map(s),m.disconnect(),b[f.id]=!0,n(!0))};[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,d,{once:!0,capture:!0})})),o(d,!0),u((function(i){f=r(\"LCP\"),n=c(e,f,t),requestAnimationFrame((function(){requestAnimationFrame((function(){f.value=performance.now()-i.timeStamp,b[f.id]=!0,n(!0)}))}))}))}},P=function(e){var t,n=r(\"TTFB\");t=function(){try{var t=performance.getEntriesByType(\"navigation\")[0]||function(){var e=performance.timing,t={entryType:\"navigation\",startTime:0};for(var n in e)\"navigationStart\"!==n&&\"toJSON\"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"load\",(function(){return setTimeout(t,0)}))};export{h as getCLS,d as getFCP,L as getFID,F as getLCP,P as getTTFB};\n"],"names":["e","t","n","i","r","name","value","delta","entries","id","concat","Date","now","Math","floor","random","a","PerformanceObserver","supportedEntryTypes","includes","self","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","u","persisted","c","f","s","m","timeStamp","v","setTimeout","firstHiddenTime","d","disconnect","startTime","push","window","performance","getEntriesByName","requestAnimationFrame","p","l","h","hadRecentInput","length","takeRecords","T","passive","capture","y","g","w","E","entryType","target","cancelable","processingStart","forEach","S","L","b","F","once","P","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"sourceRoot":""}
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
1 +/**
2 + * @license React
3 + * react-dom.production.min.js
4 + *
5 + * Copyright (c) Facebook, Inc. and its affiliates.
6 + *
7 + * This source code is licensed under the MIT license found in the
8 + * LICENSE file in the root directory of this source tree.
9 + */
10 +
11 +/**
12 + * @license React
13 + * react-jsx-runtime.production.min.js
14 + *
15 + * Copyright (c) Facebook, Inc. and its affiliates.
16 + *
17 + * This source code is licensed under the MIT license found in the
18 + * LICENSE file in the root directory of this source tree.
19 + */
20 +
21 +/**
22 + * @license React
23 + * react.production.min.js
24 + *
25 + * Copyright (c) Facebook, Inc. and its affiliates.
26 + *
27 + * This source code is licensed under the MIT license found in the
28 + * LICENSE file in the root directory of this source tree.
29 + */
30 +
31 +/**
32 + * @license React
33 + * scheduler.production.min.js
34 + *
35 + * Copyright (c) Facebook, Inc. and its affiliates.
36 + *
37 + * This source code is licensed under the MIT license found in the
38 + * LICENSE file in the root directory of this source tree.
39 + */
40 +
41 +/**
42 + * React Router DOM v6.3.0
43 + *
44 + * Copyright (c) Remix Software Inc.
45 + *
46 + * This source code is licensed under the MIT license found in the
47 + * LICENSE.md file in the root directory of this source tree.
48 + *
49 + * @license MIT
50 + */
51 +
52 +/**
53 + * React Router v6.3.0
54 + *
55 + * Copyright (c) Remix Software Inc.
56 + *
57 + * This source code is licensed under the MIT license found in the
58 + * LICENSE.md file in the root directory of this source tree.
59 + *
60 + * @license MIT
61 + */
This diff could not be displayed because it is too large.
1 +const axios = require("axios").default;
2 +const jwt = require("jsonwebtoken");
3 +const Post = require("../models/postModel");
4 +const User = require("../models/userModel");
5 +// handles "exception" inside of async express routes
6 +const asyncHandler = require("express-async-handler");
7 +
8 +// @desc Get all posts
9 +// @route GET /api/posts
10 +// @access Public
11 +const getAllPosts = asyncHandler(async (req, res) => {
12 + const posts = await Post.find();
13 + if (!posts) {
14 + res.status(400);
15 + throw new Error("Post not created");
16 + }
17 +
18 + res.status(200).send(posts);
19 +});
20 +
21 +// @desc Add a post
22 +// @route POST /api/posts/add
23 +// @access Private
24 +const addPost = asyncHandler(async (req, res) => {
25 + const { text, token } = req.body;
26 + const decoded = jwt.decode(token, { complete: true });
27 +
28 + const user = await User.findById(decoded.payload.id).select("-password");
29 +
30 + if (!user) {
31 + res.status(400);
32 + throw new Error("User info not passed");
33 + }
34 + if (!text) {
35 + res.status(400);
36 + throw new Error("Please fill in texts");
37 + }
38 +
39 + const post = await Post.create({
40 + user,
41 + text,
42 + });
43 +
44 + if (!post) {
45 + res.status(400);
46 + throw new Error("Post not created");
47 + }
48 +
49 + res.send("success");
50 +});
51 +
52 +module.exports = {
53 + getAllPosts,
54 + addPost,
55 +};
...@@ -74,19 +74,23 @@ const loginUser = asyncHandler(async (req, res) => { ...@@ -74,19 +74,23 @@ const loginUser = asyncHandler(async (req, res) => {
74 // @route GET /api/users/all 74 // @route GET /api/users/all
75 // @access Public 75 // @access Public
76 const getAllusers = asyncHandler(async (req, res) => { 76 const getAllusers = asyncHandler(async (req, res) => {
77 - const users = await User.find() 77 + const users = await User.find().select("-password");
78 - .select("-password")
79 - .select("-createdAt")
80 - .select("-email");
81 78
82 - res.status(200).json(users); 79 + res.status(200).send(users);
83 }); 80 });
84 81
85 -// @desc Get user 82 +// @desc Get self user info
86 -// @route GET /api/users/self 83 +// @route POST /api/users/self
87 -// @access Private 84 +// @access Public
88 const getSelf = asyncHandler(async (req, res) => { 85 const getSelf = asyncHandler(async (req, res) => {
89 - res.status(200).json(req.user); 86 + const { userId } = req.body;
87 + try {
88 + const user = await User.findById(userId);
89 + res.status(200).json(user);
90 + } catch (err) {
91 + res.status(400);
92 + throw new Error("Get self error");
93 + }
90 }); 94 });
91 95
92 // @desc Edit user 96 // @desc Edit user
......
...@@ -97,5 +97,3 @@ module.exports = { ...@@ -97,5 +97,3 @@ module.exports = {
97 getForecast, 97 getForecast,
98 getAirPollution, 98 getAirPollution,
99 }; 99 };
100 -
101 -// use geocoding
......
1 +const mongoose = require("mongoose");
2 +
3 +const postSchema = mongoose.Schema(
4 + {
5 + user: {
6 + type: mongoose.Schema.Types.ObjectId,
7 + ref: "User",
8 + required: true,
9 + },
10 + text: {
11 + type: String,
12 + required: true,
13 + },
14 + comments: [
15 + {
16 + type: String,
17 + required: true,
18 + },
19 + ],
20 + },
21 + {
22 + timestamps: true,
23 + }
24 +);
25 +
26 +module.exports = mongoose.model("Post", postSchema);
...@@ -8,7 +8,7 @@ const userSchema = mongoose.Schema( ...@@ -8,7 +8,7 @@ const userSchema = mongoose.Schema(
8 }, 8 },
9 country: { 9 country: {
10 type: String, 10 type: String,
11 - required: true, 11 + required: false,
12 }, 12 },
13 city: { 13 city: {
14 type: String, 14 type: String,
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
4 "description": "web-app weather chatbot", 4 "description": "web-app weather chatbot",
5 "main": "server.js", 5 "main": "server.js",
6 "scripts": { 6 "scripts": {
7 - "start": "node server/server.js", 7 + "start": "node server.js",
8 - "server": "nodemon server/server.js", 8 + "server": "nodemon server.js",
9 "client": "npm start --prefix ../client", 9 "client": "npm start --prefix ../client",
10 "dev": "concurrently \"npm run client\" \"npm run server\"" 10 "dev": "concurrently \"npm run client\" \"npm run server\""
11 }, 11 },
......
1 +const express = require("express");
2 +const router = express.Router();
3 +const { getAllPosts, addPost } = require("../actions/postActions");
4 +
5 +// "/api/posts/"
6 +router.get("/", getAllPosts);
7 +router.post("/add", addPost);
8 +
9 +module.exports = router;
...@@ -12,8 +12,8 @@ const { authHandler } = require("../middleware/authMiddleware"); ...@@ -12,8 +12,8 @@ const { authHandler } = require("../middleware/authMiddleware");
12 // "/api/users/" 12 // "/api/users/"
13 router.post("/", signupUser); 13 router.post("/", signupUser);
14 router.post("/login", loginUser); 14 router.post("/login", loginUser);
15 -router.get("/all", authHandler, getAllusers); 15 +router.get("/all", getAllusers);
16 -router.get("/self", authHandler, getSelf); 16 +router.post("/self", getSelf);
17 router.put("/edit", authHandler, editUser); 17 router.put("/edit", authHandler, editUser);
18 18
19 module.exports = router; 19 module.exports = router;
......
1 +const path = require("path");
1 const express = require("express"); 2 const express = require("express");
2 const dotenv = require("dotenv").config(); 3 const dotenv = require("dotenv").config();
3 const cors = require("cors"); 4 const cors = require("cors");
...@@ -14,6 +15,19 @@ app.use(express.urlencoded({ extended: false })); ...@@ -14,6 +15,19 @@ app.use(express.urlencoded({ extended: false }));
14 15
15 app.use("/api/users", require("./routes/userRoutes")); 16 app.use("/api/users", require("./routes/userRoutes"));
16 app.use("/api/weather", require("./routes/weatherRoutes")); 17 app.use("/api/weather", require("./routes/weatherRoutes"));
18 +app.use("/api/posts", require("./routes/postRoutes"));
19 +
20 +// Connect client(frontend)
21 +if (process.env.NODE_ENV === "production") {
22 + app.use(express.static(path.join(__dirname, "../client/build")));
23 + app.get("*", (req, res) =>
24 + res.sendFile(
25 + path.resolve(__dirname, "../", "client", "build", "index.html")
26 + )
27 + );
28 +} else {
29 + app.get("/", (req, res) => res.send("Set env to production"));
30 +}
17 31
18 app.use(errorHandler); 32 app.use(errorHandler);
19 33
......