diff --git a/frontend/.gitignore b/frontend/.gitignore index b5d8811..4d29575 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,23 +1,23 @@ -# 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* \ 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* diff --git a/frontend/README.md b/frontend/README.md index 58beeac..b87cb00 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -9,10 +9,10 @@ In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. +Open [http://localhost:3000](http://localhost:3000) to view it in the browser. -The page will reload when you make changes.\ -You may also see any lint errors in the console. +The page will reload if you make edits.\ +You will also see any lint errors in the console. ### `npm test` @@ -31,40 +31,16 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d ### `npm run eject` -**Note: this is a one-way operation. Once you `eject`, you can't go back!** +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** -If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. +Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. -You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) diff --git a/frontend/package.json b/frontend/package.json index 1955a0d..6a6a9b6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,19 +1,21 @@ { - "name": "my-app", + "name": "temp", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/react": "^18.3.11", + "@types/jest": "^27.5.2", + "@types/node": "^16.18.115", + "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/react-router-dom": "^5.3.3", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.27.0", "react-scripts": "5.0.1", - "typescript": "^5.6.3", + "typescript": "^4.9.5", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index c2c9aef..107ab24 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,11 +1,10 @@ -// src/App.tsx import React from 'react'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; -import Home from './Home'; -import UploadPage from './UploadPage'; -import UpdatePage from './UpdatePage'; -import RatingPage from './RatingPage'; -import DownloadPage from './DownloadPage'; +import Home from './pages/home'; +import UploadPage from './pages/upload'; +import UpdatePage from './pages/update'; +import RatingPage from './pages/rating'; +import DownloadPage from './pages/download'; const App: React.FC = () => { return ( diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 44a711a..b9c1cb9 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -1,4 +1,3 @@ -// src/index.tsx import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; diff --git a/frontend/src/DownloadPage.tsx b/frontend/src/pages/download.tsx similarity index 85% rename from frontend/src/DownloadPage.tsx rename to frontend/src/pages/download.tsx index 15da7a0..791b587 100644 --- a/frontend/src/DownloadPage.tsx +++ b/frontend/src/pages/download.tsx @@ -1,13 +1,12 @@ -// src/DownloadPage.tsx -import React from 'react'; - -const DownloadPage: React.FC = () => { - return ( -
-

Download Page

-

This is the download page. Download files here.

-
- ); -}; - -export default DownloadPage; +import React from 'react'; + +const DownloadPage: React.FC = () => { + return ( +
+

Download Page

+

This is the download page. Download files here.

+
+ ); +}; + +export default DownloadPage; diff --git a/frontend/src/Home.css b/frontend/src/pages/home.css similarity index 93% rename from frontend/src/Home.css rename to frontend/src/pages/home.css index 7613be7..528e38c 100644 --- a/frontend/src/Home.css +++ b/frontend/src/pages/home.css @@ -1,73 +1,73 @@ -/* src/Home.css */ -.home-container { - font-family: Arial, sans-serif; - text-align: center; - padding: 20px; - background-color: #f4f4f4; -} - -.hero { - background-color: #282c34; - color: white; - padding: 50px; - margin-bottom: 30px; - border-radius: 10px; -} - -.hero h1 { - font-size: 2.5rem; - margin-bottom: 10px; -} - -.hero button { - padding: 10px 20px; - background-color: #61dafb; - border: none; - border-radius: 5px; - cursor: pointer; - font-size: 1rem; -} - -.hero button:hover { - background-color: #21a1f1; -} - -.nav-links ul { - list-style-type: none; - padding: 0; - margin: 20px 0; -} - -.nav-links li { - display: inline; - margin: 0 15px; -} - -.nav-links a { - text-decoration: none; - color: blue; - font-weight: bold; -} - -.nav-links a:hover { - text-decoration: underline; -} - -.features { - margin-top: 20px; -} - -.features ul { - list-style-type: none; - padding: 0; -} - -.features li { - margin: 10px 0; - font-size: 1.2rem; -} - -.footer { - margin-top: 30px; - color: #777; -} +/* src/Home.css */ +.home-container { + font-family: Arial, sans-serif; + text-align: center; + padding: 20px; + background-color: #f4f4f4; +} + +.hero { + background-color: #282c34; + color: white; + padding: 50px; + margin-bottom: 30px; + border-radius: 10px; +} + +.hero h1 { + font-size: 2.5rem; + margin-bottom: 10px; +} + +.hero button { + padding: 10px 20px; + background-color: #61dafb; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 1rem; +} + +.hero button:hover { + background-color: #21a1f1; +} + +.nav-links ul { + list-style-type: none; + padding: 0; + margin: 20px 0; +} + +.nav-links li { + display: inline; + margin: 0 15px; +} + +.nav-links a { + text-decoration: none; + color: blue; + font-weight: bold; +} + +.nav-links a:hover { + text-decoration: underline; +} + +.features { + margin-top: 20px; +} + +.features ul { + list-style-type: none; + padding: 0; +} + +.features li { + margin: 10px 0; + font-size: 1.2rem; +} + +.footer { + margin-top: 30px; + color: #777; +} diff --git a/frontend/src/Home.tsx b/frontend/src/pages/home.tsx similarity index 90% rename from frontend/src/Home.tsx rename to frontend/src/pages/home.tsx index b792ac7..0eb253d 100644 --- a/frontend/src/Home.tsx +++ b/frontend/src/pages/home.tsx @@ -1,34 +1,33 @@ -// src/Home.tsx -import React from 'react'; -import { Link } from 'react-router-dom'; -import './Home.css'; // Optional: For styling - -const Home: React.FC = () => { - return ( -
-
-

Cool Website

-

ECE@Purdue's course in Software Engineering, offered by the inimitable Prof. James C. Davis and his colorful cast of quirky teaching assistants.

-
- - - -
- -
- - -
- ); -}; - -export default Home; +import React from 'react'; +import { Link } from 'react-router-dom'; +import './home.css'; // Optional: For styling + +const Home: React.FC = () => { + return ( +
+
+

Cool Website

+

ECE@Purdue's course in Software Engineering, offered by the inimitable Prof. James C. Davis and his colorful cast of quirky teaching assistants.

+
+ + + +
+ +
+ + +
+ ); +}; + +export default Home; diff --git a/frontend/src/RatingPage.tsx b/frontend/src/pages/rating.tsx similarity index 86% rename from frontend/src/RatingPage.tsx rename to frontend/src/pages/rating.tsx index 3b112fb..6a1d1f0 100644 --- a/frontend/src/RatingPage.tsx +++ b/frontend/src/pages/rating.tsx @@ -1,13 +1,12 @@ -// src/RatingPage.tsx -import React from 'react'; - -const RatingPage: React.FC = () => { - return ( -
-

Rating Page

-

This is the rating page. Give your feedback here.

-
- ); -}; - -export default RatingPage; +import React from 'react'; + +const RatingPage: React.FC = () => { + return ( +
+

Rating Page

+

This is the rating page. Give your feedback here.

+
+ ); +}; + +export default RatingPage; diff --git a/frontend/src/UpdatePage.tsx b/frontend/src/pages/update.tsx similarity index 86% rename from frontend/src/UpdatePage.tsx rename to frontend/src/pages/update.tsx index 69619c0..f1d7212 100644 --- a/frontend/src/UpdatePage.tsx +++ b/frontend/src/pages/update.tsx @@ -1,13 +1,12 @@ -// src/UpdatePage.tsx -import React from 'react'; - -const UpdatePage: React.FC = () => { - return ( -
-

Update Page

-

This is the update page. Update your data here.

-
- ); -}; - -export default UpdatePage; +import React from 'react'; + +const UpdatePage: React.FC = () => { + return ( +
+

Update Page

+

This is the update page. Update your data here.

+
+ ); +}; + +export default UpdatePage; diff --git a/frontend/src/UploadPage.tsx b/frontend/src/pages/upload.tsx similarity index 86% rename from frontend/src/UploadPage.tsx rename to frontend/src/pages/upload.tsx index 6acf537..1ea7f12 100644 --- a/frontend/src/UploadPage.tsx +++ b/frontend/src/pages/upload.tsx @@ -1,13 +1,12 @@ -// src/UploadPage.tsx -import React from 'react'; - -const UploadPage: React.FC = () => { - return ( -
-

Upload Page

-

This is the upload page. You can upload files here.

-
- ); -}; - -export default UploadPage; +import React from 'react'; + +const UploadPage: React.FC = () => { + return ( +
+

Upload Page

+

This is the upload page. You can upload files here.

+
+ ); +}; + +export default UploadPage; diff --git a/frontend/src/react-app-env.d.ts b/frontend/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/frontend/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/frontend/src/reportWebVitals.tsx b/frontend/src/reportWebVitals.ts similarity index 84% rename from frontend/src/reportWebVitals.tsx rename to frontend/src/reportWebVitals.ts index eb4be08..49a2a16 100644 --- a/frontend/src/reportWebVitals.tsx +++ b/frontend/src/reportWebVitals.ts @@ -1,6 +1,6 @@ import { ReportHandler } from 'web-vitals'; -const reportWebVitals = (onPerfEntry?: ReportHandler): void => { +const reportWebVitals = (onPerfEntry?: ReportHandler) => { if (onPerfEntry && onPerfEntry instanceof Function) { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { getCLS(onPerfEntry); diff --git a/frontend/test/App.test.js b/frontend/test/App.test.tsx similarity index 90% rename from frontend/test/App.test.js rename to frontend/test/App.test.tsx index bcf2741..a94999b 100644 --- a/frontend/test/App.test.js +++ b/frontend/test/App.test.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { render, screen } from '@testing-library/react'; import App from '../src/App'; diff --git a/frontend/test/setupTests.js b/frontend/test/setupTests.ts similarity index 100% rename from frontend/test/setupTests.js rename to frontend/test/setupTests.ts diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index e2060b2..969dfc8 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,18 +1,26 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "react-jsx" - }, - "include": ["src", "test/App.test.js", "test/setupTests.js"] -} \ No newline at end of file +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + }, + "include": [ + "src" +, "test/App.test.tsx" ] +}