Skip to content
Snippets Groups Projects
Commit 59c42525 authored by 김승준's avatar 김승준
Browse files

1

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #5008 failed
[{"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\index.js":"1","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\App.js":"2","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\serviceWorker.js":"3","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\app\\store.js":"4","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\features\\counter\\counterSlice.js":"5","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\features\\counter\\Counter.js":"6","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\reducers\\info.js":"7","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\Navbar.js":"8","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\pages\\Home.js":"9","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\pages\\Daily.js":"10","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\pages\\Monthly.js":"11","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\Today.js":"12","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\ButtonsHome.js":"13","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\ThisMonth.js":"14","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\Form.js":"15","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\features\\getFormatDate.js":"16"},{"size":644,"mtime":499162500000,"results":"17","hashOfConfig":"18"},{"size":1158,"mtime":1608043061085,"results":"19","hashOfConfig":"18"},{"size":5141,"mtime":499162500000,"results":"20","hashOfConfig":"18"},{"size":251,"mtime":1607957042030,"results":"21","hashOfConfig":"18"},{"size":1551,"mtime":499162500000,"results":"22","hashOfConfig":"18"},{"size":1626,"mtime":499162500000,"results":"23","hashOfConfig":"18"},{"size":959,"mtime":1607950509992,"results":"24","hashOfConfig":"18"},{"size":429,"mtime":1608043069970,"results":"25","hashOfConfig":"18"},{"size":410,"mtime":1608041181660,"results":"26","hashOfConfig":"18"},{"size":3215,"mtime":1608042928766,"results":"27","hashOfConfig":"18"},{"size":318,"mtime":1608037822290,"results":"28","hashOfConfig":"18"},{"size":1593,"mtime":1608041587794,"results":"29","hashOfConfig":"18"},{"size":319,"mtime":1607971209114,"results":"30","hashOfConfig":"18"},{"size":1670,"mtime":1608041564408,"results":"31","hashOfConfig":"18"},{"size":3098,"mtime":1608037591978,"results":"32","hashOfConfig":"18"},{"size":748,"mtime":1608037994906,"results":"33","hashOfConfig":"18"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},"fx2s6p",{"filePath":"37","messages":"38","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"39","usedDeprecatedRules":"36"},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"44","usedDeprecatedRules":"36"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"51","usedDeprecatedRules":"36"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"58","usedDeprecatedRules":"36"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"61","usedDeprecatedRules":"36"},{"filePath":"62","messages":"63","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"64","usedDeprecatedRules":"36"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"67","usedDeprecatedRules":"68"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"71","usedDeprecatedRules":"36"},{"filePath":"72","messages":"73","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"74","messages":"75","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"76","usedDeprecatedRules":"36"},"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\index.js",[],["77","78"],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\App.js",["79","80","81","82","83"],"import React, {Component, useState} from 'react';\r\nimport {Route, BrowserRouter, Switch} from 'react-router-dom'\r\nimport logo from './logo.svg';\r\nimport axios from 'axios'\r\nimport {Navbar} from './components/Navbar'\r\nimport {Home} from './pages/Home'\r\nimport {Monthly} from './pages/Monthly'\r\nimport {Daily} from \"./pages/Daily\";\r\nimport './App.css';\r\nimport {Form} from \"./components/Form\";\r\nimport {getFormatDate} from \"./features/getFormatDate\";\r\n\r\nclass App extends Component{\r\n constructor(props) {\r\n super(props);\r\n this.state={\r\n username: \"\",\r\n }\r\n }\r\n\r\n render(){\r\n return (\r\n <div className=\"App\">\r\n <header className=\"App-header\">\r\n <p className='headerText'>Term Project - 201620982</p>\r\n </header>\r\n <BrowserRouter>\r\n <Navbar/>\r\n <Switch>\r\n <Route exact path=\"/\" component={Home}/>\r\n <Route path=\"/Daily\" component={Daily}/>\r\n <Route path=\"/Form\" component={Form}/>\r\n </Switch>\r\n </BrowserRouter>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default App;\r\n","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\serviceWorker.js",[],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\app\\store.js",["84"],"import { configureStore } from '@reduxjs/toolkit';\r\nimport counterReducer from '../features/counter/counterSlice';\r\nimport infoReducer from '../reducers/info';\r\n\r\nexport default configureStore({\r\n reducer: {\r\n counter: counterReducer,\r\n },\r\n});\r\n","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\features\\counter\\counterSlice.js",[],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\features\\counter\\Counter.js",[],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\reducers\\info.js",["85","86","87","88","89"],"import React from \"react\";\r\n\r\nconst initialState = [];\r\nexport function infoReducer(state = initialState, action) {\r\n switch (action) {\r\n case 'CREATE_PAYMENT':\r\n return [\r\n ...state,\r\n {\r\n type: 'payment',\r\n id: action.id,\r\n date: action.date,\r\n category: action.category,\r\n details: action.details\r\n }\r\n ]\r\n break;\r\n case 'CREATE_INCOME':\r\n return [\r\n ...state,\r\n {\r\n type: 'income',\r\n id: action.id,\r\n date: action.date,\r\n category: action.category,\r\n details: action.details\r\n }\r\n ]\r\n break;\r\n case 'DELETE_CONTENT':\r\n return state.filter(content=>content.id != action.id)\r\n }\r\n}","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\Navbar.js",[],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\pages\\Home.js",[],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\pages\\Daily.js",["90","91"],"import React, {Component} from \"react\";\r\nimport axios from 'axios'\r\nimport {getFormatDate} from \"../features/getFormatDate\"\r\nimport {Link} from \"react-router-dom\";\r\n\r\nexport class Daily extends Component{\r\n constructor(props) {\r\n super(props);\r\n let initdate = getFormatDate(new Date());\r\n const search = new URLSearchParams(this.props.location.search);\r\n console.log(\"ahs: \"+ search.has('date'))\r\n if(search.has('date').toString() === 'true'){\r\n initdate = getFormatDate(new Date(search.get('date')))\r\n }\r\n this.state ={\r\n date: initdate,\r\n contents:\"\"\r\n }\r\n\r\n }\r\n\r\n componentDidMount(){\r\n console.log('date in daily: '+ this.state.date);\r\n this.renderContents();\r\n }\r\n\r\n deleteContent = async (id) =>{\r\n console.log('clicked delete '+id)\r\n var result = await axios.delete('/contents/' + id);\r\n if(result.data != 'success'){\r\n console.log('error');\r\n }\r\n this.renderContents();\r\n }\r\n\r\n async renderContents(){\r\n var result = await axios.get('/contents/bydate/' + this.state.date);\r\n const contentData = Array.from(result.data)\r\n this.setState({\r\n contents: contentData.map((content, i) => (\r\n <div >\r\n <li className='dailyElement'>\r\n <div className='dailyElement2'>\r\n <p className='dailyInfo'>{content.poi}({content.category}): {content.amount}</p>\r\n <button className='buttonDelete' onClick={()=>this.deleteContent(content._id)}>삭제</button>\r\n </div>\r\n <p className='dailyDetail'>{content.details}</p>\r\n </li>\r\n <hr className='dailyListHL'/>\r\n </div>\r\n\r\n ))\r\n })\r\n }\r\n\r\n handleYesterday = async () =>{\r\n let today = new Date(this.state.date);\r\n let newDate = new Date()\r\n newDate.setDate(today.getDate() -1);\r\n const yesterdayString = getFormatDate(newDate);\r\n console.log(getFormatDate(newDate));\r\n await this.setState({date:yesterdayString});\r\n this.renderContents();\r\n }\r\n\r\n handleTommorrow = async () =>{\r\n let today = new Date(this.state.date);\r\n let newDate = new Date()\r\n newDate.setDate(today.getDate() +1);\r\n const tommorrowString = getFormatDate(newDate);\r\n console.log(getFormatDate(newDate));\r\n await this.setState({date:tommorrowString});\r\n this.renderContents();\r\n }\r\n\r\n render() {\r\n return (\r\n <div className='dailyContainer'>\r\n <div className='dailyDate'>\r\n <button className='buttonMoveDate' onClick={this.handleYesterday}>이전 날</button>\r\n <p className='dateofDaily'>Daily {this.state.date}</p>\r\n <button className='buttonMoveDate' onClick={this.handleTommorrow}>다음날</button>\r\n </div>\r\n <ul className='dailyList'>\r\n {this.state.contents}\r\n </ul>\r\n </div>\r\n )\r\n }\r\n}","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\pages\\Monthly.js",["92","93","94","95"],"import React, {Component} from \"react\";\r\nimport axios from 'axios'\r\nimport {getFormatDate, getFormatMonth, getDays} from \"../features/getFormatDate\";\r\n\r\nexport class Monthly extends Component{\r\n render() {\r\n return (\r\n <div>\r\n <p>Monthly</p>\r\n </div>\r\n )\r\n }\r\n}","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\Today.js",["96","97","98","99"],"import React, {Component} from \"react\";\r\nimport axios from 'axios'\r\nimport {Link} from \"react-router-dom\";\r\nimport {getFormatDate} from \"../features/getFormatDate\";\r\n\r\nvar today = new Date()\r\n\r\nexport class Today extends Component {\r\n constructor(props){\r\n super(props);\r\n this.state ={\r\n date: getFormatDate(new Date()),\r\n income: \"\",\r\n payment: \"\",\r\n }\r\n }\r\n\r\n getContentToday = () => {\r\n var date = this.state.date;\r\n axios.get('/contents/bydate/' + date)\r\n .then(res=>{\r\n var contents = res.data\r\n var income = 0;\r\n var payment = 0;\r\n for(var i=0; i<res.data.length; i++){\r\n if(contents[i].poi =='payment'){\r\n console.log(contents[i].poi)\r\n payment += contents[i].amount;\r\n }\r\n else if(contents[i].poi =='income'){\r\n income += contents[i].amount;\r\n }\r\n }\r\n this.setState({income: income, payment: payment});\r\n })\r\n }\r\n\r\n componentDidMount() {\r\n console.log(this.state.date);\r\n this.getContentToday();\r\n }\r\n render(){\r\n return (\r\n <div className='today'>\r\n <div className='today2'>\r\n <p>Today</p>\r\n <p>수입: {this.state.income}</p>\r\n <p>지출: {this.state.payment}</p>\r\n </div>\r\n\r\n\r\n </div>\r\n )\r\n }\r\n}","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\ButtonsHome.js",["100"],"import React from \"react\";\r\nimport {Link} from \"react-router-dom\";\r\nimport {Form} from \"./Form\";\r\n\r\nexport function ButtonsHome() {\r\n return(\r\n <div className=\"buttonHome\">\r\n <ul>\r\n <li><Link to='/Form'><button>입력</button></Link></li>\r\n </ul>\r\n </div>\r\n )\r\n}",["101","102"],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\ThisMonth.js",["103","104","105"],"import React, {Component} from \"react\";\r\nimport axios from 'axios'\r\nimport {getFormatDate, getFormatMonth, getDays} from \"../features/getFormatDate\";\r\n\r\nexport class ThisMonth extends Component{\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n month: getFormatMonth(new Date()),\r\n days: getDays(new Date()),\r\n income:0,\r\n payment: 0,\r\n }\r\n }\r\n\r\n getContentThisMonth = () => {\r\n var month = this.state.month;\r\n axios.get('/contents/bymonth/' + month)\r\n .then(res=>{\r\n var contents = res.data\r\n var income = 0;\r\n var payment = 0;\r\n for(var i=0; i<res.data.length; i++){\r\n if(contents[i].poi =='payment'){\r\n console.log(contents[i].poi)\r\n payment += contents[i].amount;\r\n }\r\n else if(contents[i].poi =='income'){\r\n income += contents[i].amount;\r\n }\r\n }\r\n this.setState({income: income, payment: payment});\r\n })\r\n }\r\n\r\n componentDidMount() {\r\n console.log(this.state.date);\r\n this.getContentThisMonth();\r\n }\r\n\r\n render(){\r\n return (\r\n <div className='thisMonth'>\r\n <div className='thisMonth2'>\r\n <p className='thisMonthp1'>ThisMonth</p>\r\n <p className='thisMonthp2'>수입: {this.state.income}</p>\r\n <p>지출: {this.state.payment}</p>\r\n </div>\r\n\r\n </div>\r\n )\r\n }\r\n\r\n}","C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\components\\Form.js",[],"C:\\Users\\goodk\\IdeaProjects\\term_porject_201620982\\src\\features\\getFormatDate.js",["106"],"export function getFormatDate (date){\r\n var year = date.getFullYear();\r\n var month = (1 + date.getMonth());\r\n month = month >= 10 ? month : '0' + month;\r\n var day = date.getDate();\r\n day = day >= 10 ? day : '0' + day;\r\n return year + '-' + month + '-' + day;\r\n}\r\n\r\nexport function getFormatMonth (date){\r\n var year = date.getFullYear();\r\n var month = (1 + date.getMonth());\r\n month = month >= 10 ? month : '0' + month;\r\n var day = date.getDate();\r\n day = day >= 10 ? day : '0' + day;\r\n return year + '-' + month;\r\n}\r\n\r\nexport function getDays(date){\r\n const thisMonth = getFormatMonth(new Date()) + '-00';\r\n const _thisMonth = new Date(thisMonth)\r\n const days = _thisMonth.getDate()\r\n return days;\r\n}",{"ruleId":"107","replacedBy":"108"},{"ruleId":"109","replacedBy":"110"},{"ruleId":"111","severity":1,"message":"112","line":1,"column":27,"nodeType":"113","messageId":"114","endLine":1,"endColumn":35},{"ruleId":"111","severity":1,"message":"115","line":3,"column":8,"nodeType":"113","messageId":"114","endLine":3,"endColumn":12},{"ruleId":"111","severity":1,"message":"116","line":4,"column":8,"nodeType":"113","messageId":"114","endLine":4,"endColumn":13},{"ruleId":"111","severity":1,"message":"117","line":7,"column":9,"nodeType":"113","messageId":"114","endLine":7,"endColumn":16},{"ruleId":"111","severity":1,"message":"118","line":11,"column":9,"nodeType":"113","messageId":"114","endLine":11,"endColumn":22},{"ruleId":"111","severity":1,"message":"119","line":3,"column":8,"nodeType":"113","messageId":"114","endLine":3,"endColumn":19},{"ruleId":"111","severity":1,"message":"120","line":1,"column":8,"nodeType":"113","messageId":"114","endLine":1,"endColumn":13},{"ruleId":"121","severity":1,"message":"122","line":5,"column":5,"nodeType":"123","messageId":"124","endLine":32,"endColumn":6},{"ruleId":"125","severity":1,"message":"126","line":17,"column":9,"nodeType":"127","messageId":"128","endLine":17,"endColumn":15},{"ruleId":"125","severity":1,"message":"126","line":29,"column":9,"nodeType":"127","messageId":"128","endLine":29,"endColumn":15},{"ruleId":"129","severity":1,"message":"130","line":31,"column":53,"nodeType":"131","messageId":"132","endLine":31,"endColumn":55},{"ruleId":"111","severity":1,"message":"133","line":4,"column":9,"nodeType":"113","messageId":"114","endLine":4,"endColumn":13},{"ruleId":"129","severity":1,"message":"130","line":30,"column":24,"nodeType":"131","messageId":"132","endLine":30,"endColumn":26},{"ruleId":"111","severity":1,"message":"116","line":2,"column":8,"nodeType":"113","messageId":"114","endLine":2,"endColumn":13},{"ruleId":"111","severity":1,"message":"118","line":3,"column":9,"nodeType":"113","messageId":"114","endLine":3,"endColumn":22},{"ruleId":"111","severity":1,"message":"134","line":3,"column":24,"nodeType":"113","messageId":"114","endLine":3,"endColumn":38},{"ruleId":"111","severity":1,"message":"135","line":3,"column":40,"nodeType":"113","messageId":"114","endLine":3,"endColumn":47},{"ruleId":"111","severity":1,"message":"133","line":3,"column":9,"nodeType":"113","messageId":"114","endLine":3,"endColumn":13},{"ruleId":"111","severity":1,"message":"136","line":6,"column":5,"nodeType":"113","messageId":"114","endLine":6,"endColumn":10},{"ruleId":"129","severity":1,"message":"137","line":26,"column":40,"nodeType":"131","messageId":"132","endLine":26,"endColumn":42},{"ruleId":"129","severity":1,"message":"137","line":30,"column":45,"nodeType":"131","messageId":"132","endLine":30,"endColumn":47},{"ruleId":"111","severity":1,"message":"138","line":3,"column":9,"nodeType":"113","messageId":"114","endLine":3,"endColumn":13},{"ruleId":"107","replacedBy":"139"},{"ruleId":"109","replacedBy":"140"},{"ruleId":"111","severity":1,"message":"118","line":3,"column":9,"nodeType":"113","messageId":"114","endLine":3,"endColumn":22},{"ruleId":"129","severity":1,"message":"137","line":24,"column":40,"nodeType":"131","messageId":"132","endLine":24,"endColumn":42},{"ruleId":"129","severity":1,"message":"137","line":28,"column":45,"nodeType":"131","messageId":"132","endLine":28,"endColumn":47},{"ruleId":"111","severity":1,"message":"141","line":15,"column":35,"nodeType":"113","messageId":"114","endLine":15,"endColumn":38},"no-native-reassign",["142"],"no-negated-in-lhs",["143"],"no-unused-vars","'useState' is defined but never used.","Identifier","unusedVar","'logo' is defined but never used.","'axios' is defined but never used.","'Monthly' is defined but never used.","'getFormatDate' is defined but never used.","'infoReducer' is defined but never used.","'React' is defined but never used.","default-case","Expected a default case.","SwitchStatement","missingDefaultCase","no-unreachable","Unreachable code.","BreakStatement","unreachableCode","eqeqeq","Expected '!==' and instead saw '!='.","BinaryExpression","unexpected","'Link' is defined but never used.","'getFormatMonth' is defined but never used.","'getDays' is defined but never used.","'today' is assigned a value but never used.","Expected '===' and instead saw '=='.","'Form' is defined but never used.",["142"],["143"],"'day' is assigned a value but never used.","no-global-assign","no-unsafe-negation"]
\ No newline at end of file
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
This diff is collapsed.
{
"name": "term_porject_201620982",
"version": "0.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.5.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.21.0",
"express": "^4.17.1",
"http-proxy-middleware": "^1.0.6",
"mongoose": "^5.11.6",
"mongoose-auto-increment": "^5.0.1",
"morgan": "^1.10.0",
"npm-run-all": "^4.1.5",
"path": "^0.12.7",
"pug": "2.0.0-beta11",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"server": "^1.0.31"
},
"scripts": {
"start": "npm-run-all --parallel start:**",
"start:client": "react-scripts start",
"start:server": "node ./server/server.js",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:3002",
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
public/favicon.ico

3.5 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/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="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Term Project 201620982</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
public/logo192.png

4.06 KiB

public/logo512.png

11.8 KiB

{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
var mongoose = require('mongoose');
var autoInc = require('mongoose-auto-increment');
var Schema = mongoose.Schema;
var contentSchema = new Schema({
poi: {
type: String,
required: true
},
date:{
type: String,
required: true
},
amount: {
type: Number,
required: true
},
category: {
type:String,
required: true
},
details: {
type:String,
default: ""
},
month : {
type:String,
required:true
}
})
contentSchema.plugin(autoInc.plugin, 'content');
module.exports = mongoose.model('content', contentSchema);
var express = require('express');
var router = express.Router();
var Content = require('../models/Content');
router.post('/',function(req,res,next){
console.log(req.body);
var newContent = new Content(
{
poi: req.body.poi,
date: req.body.date,
amount: req.body.amount,
category: req.body.category,
details: req.body.details,
month: req.body.month
}
)
newContent.save()
.then(()=>{
res.json(newContent)
});
})
router.get('/bydate/:date',async function (req,res,next){
console.log("in content router: "+ req.params.date);
var date = req.params.date;
console.log(date);
const result = await Content.find({date: date});
if(!result) return res.status(404).json([]);
res.status(200).json(result);
})
router.get('/bymonth/:month',async function (req,res,next){
console.log("in content router: "+ req.params.month);
var month = req.params.month;
console.log(month);
const result = await Content.find({month: month});
if(!result) return res.status(404).json([]);
res.status(200).json(result);
})
router.get('/',async function (req,res,next){
console.log("in content router: all");
const result = await Content.find({});
if(!result) return res.status(404).json([]);
res.status(200).json(result);
})
router.delete('/:id',async function (req,res,next) {
const result = await Content.findByIdAndDelete(req.params.id);
res.json('success');
})
module.exports = router;
\ No newline at end of file
var express = require('express');
var router = express.Router();
router.get('/hello', (req, res) => {
res.json({username: "Kim"})
})
module.exports = router;
\ No newline at end of file
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser')
var logger = require('morgan')
var mongoose = require('mongoose');
var mongooseAutoInc = require('mongoose-auto-increment');
mongoose.connect('mongodb://localhost:27017/term-project-201620982',{
useFindAndModify: false,
useNewUrlParser: true,
useUnifiedTopology:true,
});
const conn =mongoose.connection;
conn.on('error', console.error.bind(console,'con error'));
conn.once('open',function(){
console.log('connected')
})
mongooseAutoInc.initialize(mongoose.connection);
var indexRouter = require('./routes/index');
var contentRouter = require('./routes/content')
var app = express();
const port = process.env.PORT || 3002;
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(logger('dev'));
app.use(express.json());
app.use(cookieParser());
app.use(express.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname,'..', 'public')));
app.use('/api', indexRouter);
app.use('/contents',contentRouter );
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
app.listen(port, () =>{
console.log("running on " + port);
})
module.exports = app;
extends layout
block content
h1= message
h2= error.status
pre #{error.stack}
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(src='/javascripts/main.js')
body
ul(class='navbar')
li(class='navEl')
a(href='http://localhost:3000') Home
li(class='navEl')
a(href='http://localhost:3000/newmovie') New Movie
li(class='navEl')
a(href='http://localhost:3000/admin') Admin
block content
.App {
text-align: center;
width: 1080px;
height: 800px;
padding-left: 20px;
padding-right: 20px;
background-color: darksalmon;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-float infinite 3s ease-in-out;
}
}
.App-link {
color: rgb(112, 76, 182);
}
.navBarEl {
width: 33%;
text-align: center;
margin: auto;
}
.navLink {
text-decoration: none;
}
.navLink:link{
color: black;
}
.navLink:visited{
color: black;
}
.navLink:active{
color: black;
}
.navLink:hover{
color: forestgreen;
}
.dailyElement{
border: 6px solid;
border-color: sienna;
background-color: bisque;
margin: auto;
width: 300px;
padding-bottom: 15px;
}
.dailyElement2{
padding-top: 10px;
display: inline-flex;
}
.dailyInfo{
padding-right: 20px;
margin: auto;
}
.buttonDelete{
margin: auto;
}
.dailyListHL{
width: 400px;
}
.navBar {
width: 768px;
height: 100px;
background-color: aliceblue;
display: flex;
list-style: none;
text-align: center;
margin: 0 auto;
}
.navBarContainer{
padding-bottom: 30px;
}
ul {
list-style: none;
}
button{
text-align: center;
border: 1px solid black;
}
.thisMonth{
padding-bottom: 10px;
border: 6px solid;
border-color: sienna;
background-color: bisque;
margin: auto;
width: 300px;
height: 180px;
margin-bottom: 30px;
}
.thisMonth2{
padding-top: 5px;
}
.dailyDate{
display: inline-flex;
}
.buttonMoveDate{
margin-top: 40px;
height: 30px;
}
.dateofDaily {
padding-top: 20px;
background-color: saddlebrown;
height: 50px;
width: 200px;
margin-left: 40px;
margin-right: 40px;
}
.headerText{
font-style: initial;
font-size: large;
}
.today{
padding-bottom: 10px;
border: 6px solid;
border-color: sienna;
background-color: bisque;
margin: auto;
width: 300px;
height: 180px;
}
.today2{
padding-top: 5px;
}
@media (max-width: 1080px){
.App{
width: 100%;
}
}
@media (max-width: 768px) {
.navBar {
width: 100%;
height: 100px;
background-color: aliceblue;
display: flex;
list-style: none;
margin: auto;
}
}
@keyframes App-logo-float {
0% {
transform: translateY(0);
}
50% {
transform: translateY(10px)
}
100% {
transform: translateY(0px)
}
}
import React, {Component, useState} from 'react';
import {Route, BrowserRouter, Switch} from 'react-router-dom'
import logo from './logo.svg';
import axios from 'axios'
import {Navbar} from './components/Navbar'
import {Home} from './pages/Home'
import {Monthly} from './pages/Monthly'
import {Daily} from "./pages/Daily";
import './App.css';
import {Form} from "./components/Form";
import {getFormatDate} from "./features/getFormatDate";
class App extends Component{
constructor(props) {
super(props);
this.state={
username: "",
}
}
render(){
return (
<div className="App">
<header className="App-header">
<p className='headerText'>Term Project - 201620982</p>
</header>
<BrowserRouter>
<Navbar/>
<Switch>
<Route exact path="/" component={Home}/>
<Route path="/Daily" component={Daily}/>
<Route path="/Form" component={Form}/>
</Switch>
</BrowserRouter>
</div>
);
}
}
export default App;
import React from 'react';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
import store from './app/store';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(
<Provider store={store}>
<App />
</Provider>
);
expect(getByText(/learn/i)).toBeInTheDocument();
});
export const createContent = (type, date, amount, category, details) => {
var contentID = 0;
const state ={
type: type,
id: contentID++,
date: date,
category: category,
details: details
}
return state;
}
export function deleteContent(id) {
const state = {
type: "DELETE_CONTENT",
id: id
}
return state;
}
export const createPayment = (date, amount, category, details) => {
var paymentID = 0;
const state ={
type: 'CREATE_PAYMENT',
id: paymentID++,
date: date,
category: category,
details: details
}
return state;
}
export const createIncome = (date, amount, category, details) => {
var incomeID = 0;
const state ={
type: 'CREATE_INCOME',
id: incomeID++,
date: date,
category: category,
details: details
}
return state;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment