From 160b88de433b4c8d1aa6f0f197c883a4759dba13 Mon Sep 17 00:00:00 2001 From: Dami-18 Date: Fri, 12 Jul 2024 18:42:39 +0530 Subject: [PATCH 1/4] remove console logs --- frontend/src/components/Electives.tsx | 2 +- frontend/src/components/RollForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Electives.tsx b/frontend/src/components/Electives.tsx index e128f22..852f6aa 100644 --- a/frontend/src/components/Electives.tsx +++ b/frontend/src/components/Electives.tsx @@ -22,7 +22,7 @@ const Electives: React.FC = () => { if (!res.ok) { toast.error("Some Error Occured. Please Try Again."); - console.log(res.statusText); + // console.log(res.statusText); return; } diff --git a/frontend/src/components/RollForm.tsx b/frontend/src/components/RollForm.tsx index e676038..c40b818 100644 --- a/frontend/src/components/RollForm.tsx +++ b/frontend/src/components/RollForm.tsx @@ -43,7 +43,7 @@ const RollForm: React.FC = () => { }); const resData = await res.json(); - console.log(resData); + if (!res.ok) { toast.error(resData.message); if (res.status == 400) { From 524a9eb83cbe0bf03891e18ffd8c54b9d9783f2d Mon Sep 17 00:00:00 2001 From: Dami-18 Date: Fri, 12 Jul 2024 18:54:48 +0530 Subject: [PATCH 2/4] remove one more --- frontend/src/components/MultiForm.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/MultiForm.tsx b/frontend/src/components/MultiForm.tsx index 06d7b7e..fb84f2e 100644 --- a/frontend/src/components/MultiForm.tsx +++ b/frontend/src/components/MultiForm.tsx @@ -7,7 +7,6 @@ import ErrorPage from "./ErrorPage"; const MultiForm: React.FC = () => { const { currentStep, user } = useAppContext(); - console.log({ currentStep, user }); if (currentStep == 2 && user.sessionToken && user.ssoToken) return ; if (currentStep == 1 && user.sessionToken && user.securityQuestion) From 74cfc3c2b1fe9183bdd7fbd472b6c25460a0c2cf Mon Sep 17 00:00:00 2001 From: Dami-18 Date: Fri, 12 Jul 2024 19:06:03 +0530 Subject: [PATCH 3/4] update frontend readme --- frontend/README.md | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 0d6babe..4271421 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,30 +1,27 @@ -# React + TypeScript + Vite +# Frontend -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +## Get Your Freaking Electives -Currently, two official plugins are available: +GYFE simplifies course selection by providing available depth and breadth electives for the upcoming semester. -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +### Running locally -## Expanding the ESLint configuration +First install [nodejs](https://nodejs.org/en/download/package-manager). Then install `pnpm` by running `npm install -g pnpm`. -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: +Then follow the given steps to launch the frontend: -- Configure the top-level `parserOptions` property like this: +1. Clone the repository + ```sh + git clone https://github.com/metakgp/gyfe.git + ``` +2. Install dependencies + ```sh + cd gyfe/frontend + pnpm install + ``` +3. Start the server + ```sh + pnpm dev + ``` -```js -export default { - // other rules... - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - project: ['./tsconfig.json', './tsconfig.node.json'], - tsconfigRootDir: __dirname, - }, -} -``` - -- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` -- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list +This setup will launch the frontend. To start backend server also, please follow the instructions [here](https://github.com/metakgp/gyfe/blob/main/README.md) \ No newline at end of file From 059cc2de0153fe9aca0625bc569862118c30d263 Mon Sep 17 00:00:00 2001 From: Dami-18 Date: Fri, 12 Jul 2024 19:08:45 +0530 Subject: [PATCH 4/4] delete console log --- frontend/src/components/Electives.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/Electives.tsx b/frontend/src/components/Electives.tsx index 852f6aa..80953d6 100644 --- a/frontend/src/components/Electives.tsx +++ b/frontend/src/components/Electives.tsx @@ -22,7 +22,6 @@ const Electives: React.FC = () => { if (!res.ok) { toast.error("Some Error Occured. Please Try Again."); - // console.log(res.statusText); return; }