Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 72 additions & 3 deletions back-end/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<h1> Hello world!</h1>')
// response.send(`<h1>completed</h1>`)

})
// })



Expand Down
16 changes: 9 additions & 7 deletions back-end/node_modules/body-parser/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions back-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion front-end/.eslintcache
Original file line number Diff line number Diff line change
@@ -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."]
[{"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 <Container>\r\n <Typography> I want to feel: </Typography>\r\n <FormControl>\r\n <InputLabel id=\"demo-simple-select-label\">Mood</InputLabel>\r\n <Select\r\n labelId=\"demo-simple-select-label\"\r\n id=\"demo-simple-select\"\r\n >\r\n <MenuItem onClick={() => set_mood(0)}>Happy</MenuItem>\r\n <MenuItem onClick={() => set_mood(1)}>Energetic</MenuItem>\r\n\r\n </Select>\r\n </FormControl>\r\n <Track title = {array[number].title} artist = {array[number].artist} image = {array[number].image}>\r\n </Track>\r\n <Button onClick={() => move_left()}> Previous </Button>\r\n <Button onClick={() => move_right()}> Next </Button>\r\n </Container>\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 <Container>\r\n <form className={classes.form} noValidate autoComplete=\"off\">\r\n <TextField id=\"outlined-basic\" label=\"Hello\" variant=\"outlined\" onChange={(e) => handleChange(e)}/>\r\n </form>\r\n <Button variant=\"contained\">Search</Button>\r\n {test()}\r\n <Track title = \"save me\" artist = \"bts\" image = \"https://images.shazam.com/coverart/t418737097-i1384387086_s400.jpg\">\r\n </Track>\r\n </Container>\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 <Container>\r\n \r\n </Container>\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."]
Loading