diff --git a/back-end/index.js b/back-end/index.js index 70af35e..c2a9b28 100644 --- a/back-end/index.js +++ b/back-end/index.js @@ -16,13 +16,82 @@ app.use(express.static('build')) //eases use of json app.use(express.json()) +const bodyParser = require('body-parser') +app.use(bodyParser.urlencoded({ extended: true })); +app.use(bodyParser.json()); + // END POINTS +// app.get('/example', (request, response) => { + +// const title = request.body.title //"kiss the rain" + + +// try{ + +// //chaining + +// axios.get('https://shazam.p.rapidapi.com/search', { +// params: { +// 'term': title, +// 'limit': 1, +// }, +// headers: { +// 'x-rapidapi-key' : '6687921d10msh8ecacb0330016bep1c9c74jsnbdbe105272ca', +// 'x-rapidapi-host' : 'shazam.p.rapidapi.com', +// 'useQueryString' : true, +// } +// }) +// .then(function (res) { +// //response.json(response.data.tracks.hits); + +// const send_data = { +// "title": res.data.tracks.hits[0].track.title, +// } +// response.json(send_data) +// }) + +// }catch(error){ +// console.log(error) +// } + +// //response.json(title) + +// }) + + +// app.get('/get_songs', async (request, response) => { + +// //front end will send you the string "happy" +// const mood = request.body // user input + +// /** +// * request.body is going to be +// * { +// * "mood": "happy" +// * } +// * +// * "happy" <-- +// */ + +// try{ + +// //put code here +// const cityRef = db.collection('moods').doc(); +// const doc = await cityRef.get(); +// if (!doc.exists) { +// console.log('No such document!'); +// } else { +// console.log('Document data:', doc.data()); +// } + +// }catch(error){ +// console.log(error) +// } -app.get('/', (request, response) => { - response.send('

Hello world!

') +// response.send(`

completed

`) -}) +// }) diff --git a/back-end/node_modules/body-parser/package.json b/back-end/node_modules/body-parser/package.json index d308d0e..25016cd 100644 --- a/back-end/node_modules/body-parser/package.json +++ b/back-end/node_modules/body-parser/package.json @@ -1,27 +1,29 @@ { - "_from": "body-parser@1.19.0", + "_from": "body-parser", "_id": "body-parser@1.19.0", "_inBundle": false, "_integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "_location": "/body-parser", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "body-parser@1.19.0", + "raw": "body-parser", "name": "body-parser", "escapedName": "body-parser", - "rawSpec": "1.19.0", + "rawSpec": "", "saveSpec": null, - "fetchSpec": "1.19.0" + "fetchSpec": "latest" }, "_requiredBy": [ + "#USER", + "/", "/express" ], "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", "_shasum": "96b2709e57c9c4e09a6fd66a8fd979844f69f08a", - "_spec": "body-parser@1.19.0", - "_where": "C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\back-end\\node_modules\\express", + "_spec": "body-parser", + "_where": "C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\back-end", "bugs": { "url": "https://github.com/expressjs/body-parser/issues" }, diff --git a/back-end/package.json b/back-end/package.json index a976f07..3d593f0 100644 --- a/back-end/package.json +++ b/back-end/package.json @@ -12,6 +12,7 @@ "license": "ISC", "dependencies": { "axios": "^0.21.0", + "body-parser": "^1.19.0", "cors": "^2.8.5", "express": "^4.17.1", "firebase": "^8.1.2" diff --git a/front-end/.eslintcache b/front-end/.eslintcache index ec8f2c5..1ccb04d 100644 --- a/front-end/.eslintcache +++ b/front-end/.eslintcache @@ -1 +1 @@ -[{"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\App.js":"1","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\index.js":"2","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\library.jsx":"3","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\find.jsx":"4"},{"size":498,"mtime":1607133314479,"results":"5","hashOfConfig":"6"},{"size":198,"mtime":1607132095966,"results":"7","hashOfConfig":"6"},{"size":168,"mtime":1607133043445,"results":"8","hashOfConfig":"6"},{"size":172,"mtime":1607133058478,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"19at9bg",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"16","messages":"17","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\App.js",["18"],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\index.js",[],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\library.jsx",["19"],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\find.jsx",["20"],{"ruleId":"21","severity":1,"message":"22","line":2,"column":17,"nodeType":"23","messageId":"24","endLine":2,"endColumn":21},{"ruleId":"21","severity":1,"message":"25","line":1,"column":17,"nodeType":"23","messageId":"24","endLine":1,"endColumn":25},{"ruleId":"21","severity":1,"message":"25","line":1,"column":17,"nodeType":"23","messageId":"24","endLine":1,"endColumn":25},"no-unused-vars","'Link' is defined but never used.","Identifier","unusedVar","'useState' is defined but never used."] \ No newline at end of file +[{"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\App.js":"1","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\index.js":"2","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\library.jsx":"3","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\find.jsx":"4","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\components\\track.jsx":"5","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\color-data.js":"6","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\share.jsx":"7","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\home.jsx":"8"},{"size":584,"mtime":1607201223631,"results":"9","hashOfConfig":"10"},{"size":198,"mtime":1607132095966,"results":"11","hashOfConfig":"10"},{"size":1619,"mtime":1607222293998,"results":"12","hashOfConfig":"10"},{"size":1932,"mtime":1607222735099,"results":"13","hashOfConfig":"10"},{"size":1147,"mtime":1607222331309,"results":"14","hashOfConfig":"10"},{"size":926,"mtime":1607203966274,"results":"15","hashOfConfig":"10"},{"size":1331,"mtime":1607204374976,"results":"16","hashOfConfig":"10"},{"size":348,"mtime":1607201240926,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"19at9bg",{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"24","messages":"25","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"26"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"33"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"36"},"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\App.js",["37"],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\index.js",[],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\library.jsx",["38","39","40"],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\find.jsx",["41","42","43","44"],"import React, { useState } from \"react\";\r\nimport Track from '../components/track'; \r\nimport data from '../color-data';\r\nimport Container from '@material-ui/core/Container';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Button from '@material-ui/core/Button';\r\nimport InputLabel from '@material-ui/core/InputLabel';\r\nimport MenuItem from '@material-ui/core/MenuItem';\r\nimport FormHelperText from '@material-ui/core/FormHelperText';\r\nimport FormControl from '@material-ui/core/FormControl';\r\nimport Select from '@material-ui/core/Select';\r\n\r\n\r\nexport default function Find(){\r\n const [number, set_number] = useState(0)\r\n const [mood_state, set_mood] = useState(0)\r\n const [arr, set_arr] = useState([])\r\n\r\n\r\n function handleChange(num){\r\n set_mood(num)\r\n set_arr(data[num])\r\n\r\n }\r\n const array = data[1]\r\n\r\n function move_right(){\r\n if (number < array.length-1){\r\n set_number(number + 1)\r\n }\r\n }\r\n\r\n function move_left(){\r\n if (number > 0){\r\n set_number(number - 1)\r\n }\r\n \r\n }\r\n\r\n return(\r\n\r\n \r\n I want to feel: \r\n \r\n Mood\r\n \r\n set_mood(0)}>Happy\r\n set_mood(1)}>Energetic\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n\r\n}","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\components\\track.jsx",[],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\color-data.js",[],"C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\share.jsx",["45","46"],"import React, { useState } from \"react\";\r\nimport Track from '../components/track'; \r\nimport data from '../color-data';\r\nimport Container from '@material-ui/core/Container';\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport TextField from '@material-ui/core/TextField';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Button from '@material-ui/core/Button';\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n '& > *': {\r\n margin: theme.spacing(1),\r\n width: '25ch',\r\n },\r\n },\r\n }));\r\n\r\nexport default function Share(){\r\n const classes = useStyles();\r\n const [search, set_search] = useState(\"\")\r\n\r\n function handleChange(e){\r\n set_search(e.target.value)\r\n }\r\n function test(){\r\n console.log(search)\r\n }\r\n\r\n return(\r\n \r\n
\r\n handleChange(e)}/>\r\n \r\n \r\n {test()}\r\n \r\n \r\n
\r\n )\r\n\r\n}","C:\\Users\\Aliah\\Documents\\projects\\actual\\techtogether-hack\\front-end\\src\\views\\home.jsx",["47","48","49","50"],"import React, { useState } from \"react\";\r\nimport Track from '../components/track'; \r\nimport data from '../color-data';\r\nimport Container from '@material-ui/core/Container';\r\nimport Typography from '@material-ui/core/Typography';\r\n\r\nexport default function Home(){\r\n\r\n return(\r\n\r\n \r\n \r\n \r\n )\r\n\r\n}",{"ruleId":"51","severity":1,"message":"52","line":2,"column":17,"nodeType":"53","messageId":"54","endLine":2,"endColumn":21},{"ruleId":"51","severity":1,"message":"55","line":8,"column":8,"nodeType":"53","messageId":"54","endLine":8,"endColumn":22},{"ruleId":"51","severity":1,"message":"56","line":27,"column":12,"nodeType":"53","messageId":"54","endLine":27,"endColumn":15},{"ruleId":"51","severity":1,"message":"57","line":30,"column":14,"nodeType":"53","messageId":"54","endLine":30,"endColumn":26},{"ruleId":"51","severity":1,"message":"55","line":9,"column":8,"nodeType":"53","messageId":"54","endLine":9,"endColumn":22},{"ruleId":"51","severity":1,"message":"58","line":16,"column":12,"nodeType":"53","messageId":"54","endLine":16,"endColumn":22},{"ruleId":"51","severity":1,"message":"56","line":17,"column":12,"nodeType":"53","messageId":"54","endLine":17,"endColumn":15},{"ruleId":"51","severity":1,"message":"57","line":20,"column":14,"nodeType":"53","messageId":"54","endLine":20,"endColumn":26},{"ruleId":"51","severity":1,"message":"59","line":3,"column":8,"nodeType":"53","messageId":"54","endLine":3,"endColumn":12},{"ruleId":"51","severity":1,"message":"60","line":7,"column":8,"nodeType":"53","messageId":"54","endLine":7,"endColumn":18},{"ruleId":"51","severity":1,"message":"61","line":1,"column":17,"nodeType":"53","messageId":"54","endLine":1,"endColumn":25},{"ruleId":"51","severity":1,"message":"62","line":2,"column":8,"nodeType":"53","messageId":"54","endLine":2,"endColumn":13},{"ruleId":"51","severity":1,"message":"59","line":3,"column":8,"nodeType":"53","messageId":"54","endLine":3,"endColumn":12},{"ruleId":"51","severity":1,"message":"60","line":5,"column":8,"nodeType":"53","messageId":"54","endLine":5,"endColumn":18},"no-unused-vars","'Link' is defined but never used.","Identifier","unusedVar","'FormHelperText' is defined but never used.","'arr' is assigned a value but never used.","'handleChange' is defined but never used.","'mood_state' is assigned a value but never used.","'data' is defined but never used.","'Typography' is defined but never used.","'useState' is defined but never used.","'Track' is defined but never used."] \ No newline at end of file diff --git a/front-end/package-lock.json b/front-end/package-lock.json index 39ed20e..b53487f 100644 --- a/front-end/package-lock.json +++ b/front-end/package-lock.json @@ -1203,6 +1203,11 @@ "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-10.1.0.tgz", "integrity": "sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==" }, + "@emotion/hash": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", + "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" + }, "@eslint/eslintrc": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz", @@ -1577,6 +1582,74 @@ "chalk": "^4.0.0" } }, + "@material-ui/core": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.11.2.tgz", + "integrity": "sha512-/D1+AQQeYX/WhT/FUk78UCRj8ch/RCglsQLYujYTIqPSJlwZHKcvHidNeVhODXeApojeXjkl0tWdk5C9ofwOkQ==", + "requires": { + "@babel/runtime": "^7.4.4", + "@material-ui/styles": "^4.11.2", + "@material-ui/system": "^4.11.2", + "@material-ui/types": "^5.1.0", + "@material-ui/utils": "^4.11.2", + "@types/react-transition-group": "^4.2.0", + "clsx": "^1.0.4", + "hoist-non-react-statics": "^3.3.2", + "popper.js": "1.16.1-lts", + "prop-types": "^15.7.2", + "react-is": "^16.8.0 || ^17.0.0", + "react-transition-group": "^4.4.0" + } + }, + "@material-ui/styles": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.2.tgz", + "integrity": "sha512-xbItf8zkfD3FuGoD9f2vlcyPf9jTEtj9YTJoNNV+NMWaSAHXgrW6geqRoo/IwBuMjqpwqsZhct13e2nUyU9Ljw==", + "requires": { + "@babel/runtime": "^7.4.4", + "@emotion/hash": "^0.8.0", + "@material-ui/types": "^5.1.0", + "@material-ui/utils": "^4.11.2", + "clsx": "^1.0.4", + "csstype": "^2.5.2", + "hoist-non-react-statics": "^3.3.2", + "jss": "^10.0.3", + "jss-plugin-camel-case": "^10.0.3", + "jss-plugin-default-unit": "^10.0.3", + "jss-plugin-global": "^10.0.3", + "jss-plugin-nested": "^10.0.3", + "jss-plugin-props-sort": "^10.0.3", + "jss-plugin-rule-value-function": "^10.0.3", + "jss-plugin-vendor-prefixer": "^10.0.3", + "prop-types": "^15.7.2" + } + }, + "@material-ui/system": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.11.2.tgz", + "integrity": "sha512-BELFJEel5E+5DMiZb6XXT3peWRn6UixRvBtKwSxqntmD0+zwbbfCij6jtGwwdJhN1qX/aXrKu10zX31GBaeR7A==", + "requires": { + "@babel/runtime": "^7.4.4", + "@material-ui/utils": "^4.11.2", + "csstype": "^2.5.2", + "prop-types": "^15.7.2" + } + }, + "@material-ui/types": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", + "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==" + }, + "@material-ui/utils": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.11.2.tgz", + "integrity": "sha512-Uul8w38u+PICe2Fg2pDKCaIG7kOyhowZ9vjiC1FsVwPABTW8vPPKfF6OvxRq3IiBaI1faOJmgdvMG7rMJARBhA==", + "requires": { + "@babel/runtime": "^7.4.4", + "prop-types": "^15.7.2", + "react-is": "^16.8.0 || ^17.0.0" + } + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -1824,6 +1897,8 @@ }, "@testing-library/jest-dom": { "version": "5.11.6", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.11.6.tgz", + "integrity": "sha512-cVZyUNRWwUKI0++yepYpYX7uhrP398I+tGz4zOlLVlUYnZS+Svuxv4fwLeCIy7TnBYKXUaOlQr3vopxL8ZfEnA==", "requires": { "@babel/runtime": "^7.9.2", "@types/testing-library__jest-dom": "^5.9.1", @@ -1848,6 +1923,8 @@ }, "@testing-library/react": { "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-11.2.2.tgz", + "integrity": "sha512-jaxm0hwUjv+hzC+UFEywic7buDC9JQ1q3cDsrWVSDAPmLotfA6E6kUHlYm/zOeGCac6g48DR36tFHxl7Zb+N5A==", "requires": { "@babel/runtime": "^7.12.5", "@testing-library/dom": "^7.28.1" @@ -1855,6 +1932,8 @@ }, "@testing-library/user-event": { "version": "12.5.0", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.5.0.tgz", + "integrity": "sha512-9uXr4+OwjHVUxzdfYZ2yCnF3xlEzr8cZOdqjGnqD8Qb1NoCJrm7UXxG3RUpL2QqcqZ1eqVuxkFJTCky5Yit+XQ==", "requires": { "@babel/runtime": "^7.10.2" } @@ -2007,11 +2086,40 @@ "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==" }, + "@types/prop-types": { + "version": "15.7.3", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", + "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==" + }, "@types/q": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==" }, + "@types/react": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.0.tgz", + "integrity": "sha512-aj/L7RIMsRlWML3YB6KZiXB3fV2t41+5RBGYF8z+tAKU43Px8C3cYUZsDvf1/+Bm4FK21QWBrDutu8ZJ/70qOw==", + "requires": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + }, + "dependencies": { + "csstype": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.5.tgz", + "integrity": "sha512-uVDi8LpBUKQj6sdxNaTetL6FpeCqTjOvAQuQUa/qAqq8oOd4ivkbhgnqayl0dnPal8Tb/yB1tF+gOvCBiicaiQ==" + } + } + }, + "@types/react-transition-group": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.0.tgz", + "integrity": "sha512-/QfLHGpu+2fQOqQaXh8MG9q03bFENooTb/it4jr5kKaZlDQfWvjqWZg48AwzPVMBHlRuTRAY7hRHCEOXz5kV6w==", + "requires": { + "@types/react": "*" + } + }, "@types/resolve": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", @@ -3698,6 +3806,11 @@ "shallow-clone": "^3.0.0" } }, + "clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -4232,6 +4345,15 @@ "source-map": "^0.6.1" } }, + "css-vendor": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/css-vendor/-/css-vendor-2.0.8.tgz", + "integrity": "sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ==", + "requires": { + "@babel/runtime": "^7.8.3", + "is-in-browser": "^1.0.2" + } + }, "css-what": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", @@ -4403,6 +4525,11 @@ } } }, + "csstype": { + "version": "2.6.14", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.14.tgz", + "integrity": "sha512-2mSc+VEpGPblzAxyeR+vZhJKgYg0Og0nnRi7pmRXFYYxSfnOnW8A5wwQb4n4cE2nIOzqKOAzLCaEX6aBmNEv8A==" + }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -4724,6 +4851,22 @@ "utila": "~0.4" } }, + "dom-helpers": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.0.tgz", + "integrity": "sha512-Ru5o9+V8CpunKnz5LGgWXkmrH/20cGKwcHwS4m73zIvs54CN9epEmT/HLqFJW3kXpakAFkEdzgy1hzlJe3E4OQ==", + "requires": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + }, + "dependencies": { + "csstype": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.5.tgz", + "integrity": "sha512-uVDi8LpBUKQj6sdxNaTetL6FpeCqTjOvAQuQUa/qAqq8oOd4ivkbhgnqayl0dnPal8Tb/yB1tF+gOvCBiicaiQ==" + } + } + }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -7002,6 +7145,11 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" }, + "hyphenate-style-name": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", + "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -7102,6 +7250,14 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, + "indefinite-observable": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/indefinite-observable/-/indefinite-observable-2.0.1.tgz", + "integrity": "sha512-G8vgmork+6H9S8lUAg1gtXEj2JxIQTo0g2PbFiYOdjkziSI0F7UYBiVwhZRuixhBCNGczAls34+5HJPyZysvxQ==", + "requires": { + "symbol-observable": "1.2.0" + } + }, "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -7352,6 +7508,11 @@ "is-extglob": "^2.1.1" } }, + "is-in-browser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz", + "integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=" + }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -8423,6 +8584,92 @@ "verror": "1.10.0" } }, + "jss": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss/-/jss-10.5.0.tgz", + "integrity": "sha512-B6151NvG+thUg3murLNHRPLxTLwQ13ep4SH5brj4d8qKtogOx/jupnpfkPGSHPqvcwKJaCLctpj2lEk+5yGwMw==", + "requires": { + "@babel/runtime": "^7.3.1", + "csstype": "^3.0.2", + "indefinite-observable": "^2.0.1", + "is-in-browser": "^1.1.3", + "tiny-warning": "^1.0.2" + }, + "dependencies": { + "csstype": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.5.tgz", + "integrity": "sha512-uVDi8LpBUKQj6sdxNaTetL6FpeCqTjOvAQuQUa/qAqq8oOd4ivkbhgnqayl0dnPal8Tb/yB1tF+gOvCBiicaiQ==" + } + } + }, + "jss-plugin-camel-case": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.5.0.tgz", + "integrity": "sha512-GSjPL0adGAkuoqeYiXTgO7PlIrmjv5v8lA6TTBdfxbNYpxADOdGKJgIEkffhlyuIZHlPuuiFYTwUreLUmSn7rg==", + "requires": { + "@babel/runtime": "^7.3.1", + "hyphenate-style-name": "^1.0.3", + "jss": "10.5.0" + } + }, + "jss-plugin-default-unit": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.5.0.tgz", + "integrity": "sha512-rsbTtZGCMrbcb9beiDd+TwL991NGmsAgVYH0hATrYJtue9e+LH/Gn4yFD1ENwE+3JzF3A+rPnM2JuD9L/SIIWw==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.5.0" + } + }, + "jss-plugin-global": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.5.0.tgz", + "integrity": "sha512-FZd9+JE/3D7HMefEG54fEC0XiQ9rhGtDHAT/ols24y8sKQ1D5KIw6OyXEmIdKFmACgxZV2ARQ5pAUypxkk2IFQ==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.5.0" + } + }, + "jss-plugin-nested": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.5.0.tgz", + "integrity": "sha512-ejPlCLNlEGgx8jmMiDk/zarsCZk+DV0YqXfddpgzbO9Toamo0HweCFuwJ3ZO40UFOfqKwfpKMVH/3HUXgxkTMg==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.5.0", + "tiny-warning": "^1.0.2" + } + }, + "jss-plugin-props-sort": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.5.0.tgz", + "integrity": "sha512-kTLRvrOetFKz5vM88FAhLNeJIxfjhCepnvq65G7xsAQ/Wgy7HwO1BS/2wE5mx8iLaAWC6Rj5h16mhMk9sKdZxg==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.5.0" + } + }, + "jss-plugin-rule-value-function": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.5.0.tgz", + "integrity": "sha512-jXINGr8BSsB13JVuK274oEtk0LoooYSJqTBCGeBu2cG/VJ3+4FPs1gwLgsq24xTgKshtZ+WEQMVL34OprLidRA==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.5.0", + "tiny-warning": "^1.0.2" + } + }, + "jss-plugin-vendor-prefixer": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.5.0.tgz", + "integrity": "sha512-rux3gmfwDdOKCLDx0IQjTwTm03IfBa+Rm/hs747cOw5Q7O3RaTUIMPKjtVfc31Xr/XI9Abz2XEupk1/oMQ7zRA==", + "requires": { + "@babel/runtime": "^7.3.1", + "css-vendor": "^2.0.8", + "jss": "10.5.0" + } + }, "jsx-ast-utils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.1.0.tgz", @@ -9794,6 +10041,11 @@ "ts-pnp": "^1.1.6" } }, + "popper.js": { + "version": "1.16.1-lts", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1-lts.tgz", + "integrity": "sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA==" + }, "portfinder": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", @@ -11081,6 +11333,8 @@ }, "react": { "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.1.tgz", + "integrity": "sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -11219,6 +11473,8 @@ }, "react-dom": { "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.1.tgz", + "integrity": "sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -11288,6 +11544,8 @@ }, "react-scripts": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.1.tgz", + "integrity": "sha512-NnniMSC/wjwhcJAyPJCWtxx6CWONqgvGgV9+QXj1bwoW/JI++YF1eEf3Upf/mQ9KmP57IBdjzWs1XvnPq7qMTQ==", "requires": { "@babel/core": "7.12.3", "@pmmmwh/react-refresh-webpack-plugin": "0.4.2", @@ -11350,6 +11608,17 @@ "workbox-webpack-plugin": "5.1.4" } }, + "react-transition-group": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz", + "integrity": "sha512-Djqr7OQ2aPUiYurhPalTrVy9ddmFCCzwhqQmtN+J3+3DzLO209Fdr70QrN8Z3DsglWql6iY1lDWAfpFiBtuKGw==", + "requires": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + } + }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -13222,6 +13491,11 @@ } } }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -14257,7 +14531,9 @@ } }, "web-vitals": { - "version": "0.2.4" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-0.2.4.tgz", + "integrity": "sha512-6BjspCO9VriYy12z356nL6JBS0GYeEcA457YyRzD+dD6XYCQ75NKhcOHUMHentOE7OcVCIXXDvOm0jKFfQG2Gg==" }, "webidl-conversions": { "version": "6.1.0", diff --git a/front-end/package.json b/front-end/package.json index 4fc61a6..2d43dad 100644 --- a/front-end/package.json +++ b/front-end/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "@material-ui/core": "^4.11.2", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", diff --git a/front-end/src/App.js b/front-end/src/App.js index 0b5cbe8..57336c6 100644 --- a/front-end/src/App.js +++ b/front-end/src/App.js @@ -3,12 +3,14 @@ import { Route, Link, BrowserRouter as Router } from "react-router-dom"; import Find from './views/find' import Library from './views/library' import Share from './views/share' +import Home from './views/home' class App extends React.Component { render() { return ( - + + diff --git a/front-end/src/color-data.js b/front-end/src/color-data.js index e69de29..cb2e943 100644 --- a/front-end/src/color-data.js +++ b/front-end/src/color-data.js @@ -0,0 +1,37 @@ +const data = [ + [ + { + "id": 12312, + "title": "Kiss the rain", + "artist": "Yiruma", + "image" : "https://images.shazam.com/coverart/t418737097-i1384387086_s400.jpg", + } + ], + [ + { + "id": 44212, + "title": "Airplane", + "artist": "Oneus", + "image" : "https://images.shazam.com/coverart/t418737097-i1384387086_s400.jpg", + }, + { + "id": 44212, + "title": "Outro:Tear", + "artist": "BTS", + "image" : "https://images.shazam.com/coverart/t418737097-i1384387086_s400.jpg", + } + ], + [ + { + "id": 44212, + "title": "Hello", + "artist": "Adele", + "image" : "https://images.shazam.com/coverart/t418737097-i1384387086_s400.jpg", + } + ], + +] + +export default data; + + diff --git a/front-end/src/components/mood-menu.jsx b/front-end/src/components/mood-menu.jsx deleted file mode 100644 index 6c7ad97..0000000 --- a/front-end/src/components/mood-menu.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { useState, useEffect } from "react"; - - -export default MoodMenu(props){ - - return( -
-

Mood menu

-
- ) -} \ No newline at end of file diff --git a/front-end/src/components/track.jsx b/front-end/src/components/track.jsx index a837279..6ecf8b7 100644 --- a/front-end/src/components/track.jsx +++ b/front-end/src/components/track.jsx @@ -1,11 +1,42 @@ -import React, { useState, useEffect } from "react"; +import React from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import Card from '@material-ui/core/Card'; +import CardActionArea from '@material-ui/core/CardActionArea'; +import CardActions from '@material-ui/core/CardActions'; +import CardContent from '@material-ui/core/CardContent'; +import CardMedia from '@material-ui/core/CardMedia'; +import Button from '@material-ui/core/Button'; +import Typography from '@material-ui/core/Typography'; -export default Track(props){ +const useStyles = makeStyles({ + root: { + maxWidth: 345, + }, +}); - return( -
-

Tracks

-
- ) +export default function Track(props) { + const classes = useStyles(); + + return ( + + + + thumbnail + + + {props.title} + + + + + + + + + ); } \ No newline at end of file diff --git a/front-end/src/data.js b/front-end/src/data.js new file mode 100644 index 0000000..543da43 --- /dev/null +++ b/front-end/src/data.js @@ -0,0 +1,7 @@ +const mood_data = [ + { 'happy': 'yellow'}, + { 'sad': 'blue'} + +] + +export default mood_data; \ No newline at end of file diff --git a/front-end/src/views/find.jsx b/front-end/src/views/find.jsx index f85de07..a8566c0 100644 --- a/front-end/src/views/find.jsx +++ b/front-end/src/views/find.jsx @@ -1,11 +1,62 @@ import React, { useState } from "react"; +import Track from '../components/track'; +import data from '../color-data'; +import Container from '@material-ui/core/Container'; +import Typography from '@material-ui/core/Typography'; +import Button from '@material-ui/core/Button'; +import InputLabel from '@material-ui/core/InputLabel'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; + export default function Find(){ + const [number, set_number] = useState(0) + const [mood_state, set_mood] = useState(0) + const [arr, set_arr] = useState([]) + + + function handleChange(num){ + set_mood(num) + set_arr(data[num]) + + } + const array = data[1] + + function move_right(){ + if (number < array.length-1){ + set_number(number + 1) + } + } + + function move_left(){ + if (number > 0){ + set_number(number - 1) + } + + } return( -
-

Find interface

-
+ + + I want to feel: + + Mood + + + + + + + ) } \ No newline at end of file diff --git a/front-end/src/views/home.jsx b/front-end/src/views/home.jsx new file mode 100644 index 0000000..4ca557d --- /dev/null +++ b/front-end/src/views/home.jsx @@ -0,0 +1,16 @@ +import React, { useState } from "react"; +import Track from '../components/track'; +import data from '../color-data'; +import Container from '@material-ui/core/Container'; +import Typography from '@material-ui/core/Typography'; + +export default function Home(){ + + return( + + + + + ) + +} \ No newline at end of file diff --git a/front-end/src/views/library.jsx b/front-end/src/views/library.jsx index 6a58b3e..ff2b157 100644 --- a/front-end/src/views/library.jsx +++ b/front-end/src/views/library.jsx @@ -1,11 +1,58 @@ import React, { useState } from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Track from '../components/track'; +import data from '../color-data'; +import Container from '@material-ui/core/Container'; +import InputLabel from '@material-ui/core/InputLabel'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; + + + +const useStyles = makeStyles((theme) => ({ + formControl: { + margin: theme.spacing(1), + minWidth: 120, + }, + selectEmpty: { + marginTop: theme.spacing(2), + }, + })); export default function Library(){ + const classes = useStyles(); + const [mood_state, set_mood] = useState(0) + const [arr, set_arr] = useState([]) + + + function handleChange(num){ + set_mood(num) + set_arr(data[num]) + + } return( -
-

Library

-
+ + + + Mood + + + + {data[mood_state].map((element) => )} + + ) -} \ No newline at end of file +} + +// \ No newline at end of file diff --git a/front-end/src/views/share.jsx b/front-end/src/views/share.jsx index 68e77c5..89e992d 100644 --- a/front-end/src/views/share.jsx +++ b/front-end/src/views/share.jsx @@ -1,11 +1,43 @@ import React, { useState } from "react"; +import Track from '../components/track'; +import data from '../color-data'; +import Container from '@material-ui/core/Container'; +import { makeStyles } from "@material-ui/core/styles"; +import TextField from '@material-ui/core/TextField'; +import Typography from '@material-ui/core/Typography'; +import Button from '@material-ui/core/Button'; + + +const useStyles = makeStyles((theme) => ({ + root: { + '& > *': { + margin: theme.spacing(1), + width: '25ch', + }, + }, + })); export default function Share(){ + const classes = useStyles(); + const [search, set_search] = useState("") + + function handleChange(e){ + set_search(e.target.value) + } + function test(){ + console.log(search) + } return( -
-

Share interface

-
+ +
+ handleChange(e)}/> + + + {test()} + + +
) } \ No newline at end of file