diff --git a/.github/Architecture.md b/.github/Architecture.md index ddb4b76a..5dae829a 100644 --- a/.github/Architecture.md +++ b/.github/Architecture.md @@ -5,163 +5,149 @@ ``` 📦 training | |- 📂 training: +| | |- 📂 core: +| | | |- 📜 optimizer.py : what optimizer to use (ie: SGD or Adam for now) +| | | |- 📜 dl_model.py : torch model based on user specifications from drag and drop +| | | |- 📜 dataset.py : read in the dataset through URL or file upload +| | | |- 📜 authenticator.py +| | | |- 📜 trainer.py +| | | |- 📜 criterion.py +| | | |- 📜 __init__.py | | |- 📂 routes: -| | | |- 📂 tabular: -| | | | |- 📜 __init__.py +| | | |- 📂 image: | | | | |- 📜 schemas.py +| | | | |- 📜 __init__.py +| | | | |- 📜 image.py +| | | |- 📂 tabular: | | | | |- 📜 tabular.py +| | | | |- 📜 schemas.py +| | | | |- 📜 __init__.py | | | |- 📂 datasets: | | | | |- 📂 default: +| | | | | |- 📜 schemas.py | | | | | |- 📜 columns.py | | | | | |- 📜 __init__.py -| | | | | |- 📜 schemas.py | | | | |- 📜 __init__.py -| | | |- 📂 image: -| | | | |- 📜 image.py -| | | | |- 📜 __init__.py -| | | | |- 📜 schemas.py -| | | |- 📜 __init__.py | | | |- 📜 schemas.py -| | |- 📂 core: -| | | |- 📜 dl_model.py : torch model based on user specifications from drag and drop -| | | |- 📜 trainer.py -| | | |- 📜 authenticator.py | | | |- 📜 __init__.py -| | | |- 📜 dataset.py : read in the dataset through URL or file upload -| | | |- 📜 criterion.py -| | | |- 📜 optimizer.py : what optimizer to use (ie: SGD or Adam for now) | | |- 📜 settings.py -| | |- 📜 urls.py -| | |- 📜 wsgi.py | | |- 📜 asgi.py +| | |- 📜 wsgi.py +| | |- 📜 urls.py | | |- 📜 __init__.py -| |- 📜 poetry.lock -| |- 📜 pyproject.toml -| |- 📜 docker-compose.prod.yml +| |- 📜 cli.py +| |- 📜 Dockerfile +| |- 📜 README.md | |- 📜 docker-compose.yml -| |- 📜 Dockerfile.prod -| |- 📜 pytest.ini | |- 📜 manage.py +| |- 📜 poetry.lock +| |- 📜 Dockerfile.prod | |- 📜 environment.yml -| |- 📜 README.md -| |- 📜 Dockerfile -| |- 📜 cli.py +| |- 📜 pytest.ini +| |- 📜 pyproject.toml +| |- 📜 docker-compose.prod.yml ``` ## Frontend Architecture ``` 📦 frontend -| |- 📂 layer_docs: -| | |- 📜 Linear.md : Doc for Linear layer -| | |- 📜 softmax_equation.png : PNG file of Softmax equation -| | |- 📜 Softmax.md : Doc for Softmax layer -| | |- 📜 ReLU.md : Doc for ReLU later -| |- 📂 public: -| | |- 📂 images: -| | | |- 📂 learn_mod_images: -| | | | |- 📜 binarystepactivation.png -| | | | |- 📜 lossExampleEquation.png -| | | | |- 📜 robotImage.jpg -| | | | |- 📜 sigmoidfunction.png -| | | | |- 📜 tanhactivation.png -| | | | |- 📜 lossExampleTable.png -| | | | |- 📜 neuron.png -| | | | |- 📜 sigmoidactivation.png -| | | | |- 📜 ReLUactivation.png -| | | | |- 📜 lossExample.png -| | | | |- 📜 neuralnet.png -| | | | |- 📜 neuronWithEquation.png -| | | | |- 📜 LeakyReLUactivation.png -| | | |- 📂 wiki_images: -| | | | |- 📜 tanh_equation.png -| | | | |- 📜 avgpool_maxpool.gif -| | | | |- 📜 batchnorm_diagram.png -| | | | |- 📜 conv2d.gif -| | | | |- 📜 tanh_plot.png -| | | | |- 📜 softmax_equation.png : PNG file of Softmax equation -| | | | |- 📜 dropout_diagram.png -| | | | |- 📜 sigmoid_equation.png -| | | | |- 📜 conv2d2.gif -| | | | |- 📜 maxpool2d.gif -| | | |- 📂 logos: -| | | | |- 📂 dlp_branding: -| | | | | |- 📜 dlp-logo.png : DLP Logo, duplicate of files in public, but essential as the frontend can't read public -| | | | | |- 📜 dlp-logo.svg : DLP Logo, duplicate of files in public, but essential as the frontend can't read public -| | | | |- 📜 flask-logo.png -| | | | |- 📜 dsgt-logo-white-back.png -| | | | |- 📜 aws-logo.png -| | | | |- 📜 pandas-logo.png -| | | | |- 📜 react-logo.png -| | | | |- 📜 github.png -| | | | |- 📜 google.png -| | | | |- 📜 dsgt-logo-dark.png -| | | | |- 📜 dsgt-logo-light.png -| | | | |- 📜 python-logo.png -| | | | |- 📜 pytorch-logo.png -| | | |- 📜 demo_video.gif : GIF tutorial of a simple classification training session -| | |- 📜 dlp-logo.ico : DLP Logo -| | |- 📜 index.html : Base HTML file that will be initially rendered -| | |- 📜 robots.txt -| | |- 📜 manifest.json : Default React file for choosing icon based on | |- 📂 src: +| | |- 📂 pages: +| | | |- 📂 train: +| | | | |- 📜 [train_space_id].tsx +| | | | |- 📜 index.tsx +| | | |- 📜 wiki.tsx +| | | |- 📜 _app.tsx +| | | |- 📜 learn.tsx +| | | |- 📜 LearnContent.tsx +| | | |- 📜 forgot.tsx +| | | |- 📜 feedback.tsx +| | | |- 📜 about.tsx +| | | |- 📜 dashboard.tsx +| | | |- 📜 login.tsx +| | | |- 📜 _document.tsx +| | | |- 📜 settings.tsx +| | |- 📂 common: +| | | |- 📂 utils: +| | | | |- 📜 dateFormat.ts +| | | | |- 📜 firebase.ts +| | | | |- 📜 dndHelpers.ts +| | | |- 📂 redux: +| | | | |- 📜 hooks.ts +| | | | |- 📜 store.ts +| | | | |- 📜 userLogin.ts +| | | | |- 📜 train.ts +| | | | |- 📜 backendApi.ts +| | | |- 📂 styles: +| | | | |- 📜 globals.css +| | | | |- 📜 Home.module.css +| | | |- 📂 components: +| | | | |- 📜 HtmlTooltip.tsx +| | | | |- 📜 DlpTooltip.tsx +| | | | |- 📜 TitleText.tsx +| | | | |- 📜 ClientOnlyPortal.tsx +| | | | |- 📜 EmailInput.tsx +| | | | |- 📜 Spacer.tsx +| | | | |- 📜 Footer.tsx +| | | | |- 📜 NavBarMain.tsx | | |- 📂 features: -| | | |- 📂 OpenAi: -| | | | |- 📜 openAiUtils.ts -| | | |- 📂 Feedback: -| | | | |- 📂 redux: -| | | | | |- 📜 feedbackApi.ts | | | |- 📂 Train: -| | | | |- 📂 types: -| | | | | |- 📜 trainTypes.ts | | | | |- 📂 features: -| | | | | |- 📂 Image: -| | | | | | |- 📂 types: -| | | | | | | |- 📜 imageTypes.ts +| | | | | |- 📂 Tabular: | | | | | | |- 📂 redux: -| | | | | | | |- 📜 imageApi.ts -| | | | | | | |- 📜 imageActions.ts -| | | | | | |- 📂 components: -| | | | | | | |- 📜 ImageParametersStep.tsx -| | | | | | | |- 📜 ImageFlow.tsx -| | | | | | | |- 📜 ImageDatasetStep.tsx -| | | | | | | |- 📜 ImageReviewStep.tsx -| | | | | | | |- 📜 ImageTrainspace.tsx +| | | | | | | |- 📜 tabularActions.ts +| | | | | | | |- 📜 tabularApi.ts | | | | | | |- 📂 constants: -| | | | | | | |- 📜 imageConstants.ts -| | | | | | |- 📜 index.ts -| | | | | |- 📂 Tabular: +| | | | | | | |- 📜 tabularConstants.ts | | | | | | |- 📂 types: | | | | | | | |- 📜 tabularTypes.ts -| | | | | | |- 📂 redux: -| | | | | | | |- 📜 tabularApi.ts -| | | | | | | |- 📜 tabularActions.ts | | | | | | |- 📂 components: | | | | | | | |- 📜 TabularDatasetStep.tsx -| | | | | | | |- 📜 TabularReviewStep.tsx -| | | | | | | |- 📜 TabularParametersStep.tsx | | | | | | | |- 📜 TabularTrainspace.tsx | | | | | | | |- 📜 TabularFlow.tsx +| | | | | | | |- 📜 TabularParametersStep.tsx +| | | | | | | |- 📜 TabularReviewStep.tsx +| | | | | | |- 📜 index.ts +| | | | | |- 📂 Image: +| | | | | | |- 📂 redux: +| | | | | | | |- 📜 imageActions.ts +| | | | | | | |- 📜 imageApi.ts | | | | | | |- 📂 constants: -| | | | | | | |- 📜 tabularConstants.ts +| | | | | | | |- 📜 imageConstants.ts +| | | | | | |- 📂 types: +| | | | | | | |- 📜 imageTypes.ts +| | | | | | |- 📂 components: +| | | | | | | |- 📜 ImageReviewStep.tsx +| | | | | | | |- 📜 ImageParametersStep.tsx +| | | | | | | |- 📜 ImageDatasetStep.tsx +| | | | | | | |- 📜 ImageTrainspace.tsx +| | | | | | | |- 📜 ImageFlow.tsx | | | | | | |- 📜 index.ts | | | | |- 📂 redux: | | | | | |- 📜 trainspaceApi.ts | | | | | |- 📜 trainspaceSlice.ts +| | | | |- 📂 constants: +| | | | | |- 📜 trainConstants.ts +| | | | |- 📂 types: +| | | | | |- 📜 trainTypes.ts | | | | |- 📂 components: | | | | | |- 📜 CreateTrainspace.tsx -| | | | | |- 📜 DatasetStepLayout.tsx | | | | | |- 📜 TrainspaceLayout.tsx -| | | | |- 📂 constants: -| | | | | |- 📜 trainConstants.ts +| | | | | |- 📜 DatasetStepLayout.tsx +| | | |- 📂 Feedback: +| | | | |- 📂 redux: +| | | | | |- 📜 feedbackApi.ts +| | | |- 📂 OpenAi: +| | | | |- 📜 openAiUtils.ts | | | |- 📂 LearnMod: -| | | | |- 📜 Exercise.tsx | | | | |- 📜 MCQuestion.tsx +| | | | |- 📜 ModulesSideBar.tsx +| | | | |- 📜 ImageComponent.tsx +| | | | |- 📜 LearningModulesContent.tsx | | | | |- 📜 FRQuestion.tsx +| | | | |- 📜 Exercise.tsx | | | | |- 📜 ClassCard.tsx -| | | | |- 📜 LearningModulesContent.tsx -| | | | |- 📜 ImageComponent.tsx -| | | | |- 📜 ModulesSideBar.tsx | | | |- 📂 Dashboard: | | | | |- 📂 redux: | | | | | |- 📜 dashboardApi.ts @@ -169,59 +155,73 @@ | | | | | |- 📜 TrainDoughnutChart.tsx | | | | | |- 📜 TrainBarChart.tsx | | | | | |- 📜 TrainDataGrid.tsx -| | |- 📂 pages: -| | | |- 📂 train: -| | | | |- 📜 [train_space_id].tsx -| | | | |- 📜 index.tsx -| | | |- 📜 about.tsx -| | | |- 📜 dashboard.tsx -| | | |- 📜 _document.tsx -| | | |- 📜 learn.tsx -| | | |- 📜 LearnContent.tsx -| | | |- 📜 wiki.tsx -| | | |- 📜 forgot.tsx -| | | |- 📜 settings.tsx -| | | |- 📜 _app.tsx -| | | |- 📜 feedback.tsx -| | | |- 📜 login.tsx | | |- 📂 backend_outputs: -| | | |- 📜 model.pkl -| | | |- 📜 model.pt : Last model.pt output | | | |- 📜 my_deep_learning_model.onnx : Last ONNX file output -| | |- 📂 common: -| | | |- 📂 redux: -| | | | |- 📜 store.ts -| | | | |- 📜 train.ts -| | | | |- 📜 backendApi.ts -| | | | |- 📜 hooks.ts -| | | | |- 📜 userLogin.ts -| | | |- 📂 components: -| | | | |- 📜 EmailInput.tsx -| | | | |- 📜 TitleText.tsx -| | | | |- 📜 NavBarMain.tsx -| | | | |- 📜 Spacer.tsx -| | | | |- 📜 DlpTooltip.tsx -| | | | |- 📜 Footer.tsx -| | | | |- 📜 HtmlTooltip.tsx -| | | | |- 📜 ClientOnlyPortal.tsx -| | | |- 📂 utils: -| | | | |- 📜 dateFormat.ts -| | | | |- 📜 dndHelpers.ts -| | | | |- 📜 firebase.ts -| | | |- 📂 styles: -| | | | |- 📜 globals.css -| | | | |- 📜 Home.module.css +| | | |- 📜 model.pt : Last model.pt output +| | | |- 📜 model.pkl | | |- 📜 GlobalStyle.ts -| | |- 📜 constants.ts | | |- 📜 iris.csv : Sample CSV data +| | |- 📜 constants.ts | | |- 📜 next-env.d.ts +| |- 📂 public: +| | |- 📂 images: +| | | |- 📂 wiki_images: +| | | | |- 📜 maxpool2d.gif +| | | | |- 📜 tanh_equation.png +| | | | |- 📜 softmax_equation.png : PNG file of Softmax equation +| | | | |- 📜 conv2d2.gif +| | | | |- 📜 dropout_diagram.png +| | | | |- 📜 tanh_plot.png +| | | | |- 📜 avgpool_maxpool.gif +| | | | |- 📜 batchnorm_diagram.png +| | | | |- 📜 conv2d.gif +| | | | |- 📜 sigmoid_equation.png +| | | |- 📂 logos: +| | | | |- 📂 dlp_branding: +| | | | | |- 📜 dlp-logo.svg : DLP Logo, duplicate of files in public, but essential as the frontend can't read public +| | | | | |- 📜 dlp-logo.png : DLP Logo, duplicate of files in public, but essential as the frontend can't read public +| | | | |- 📜 aws-logo.png +| | | | |- 📜 pytorch-logo.png +| | | | |- 📜 python-logo.png +| | | | |- 📜 react-logo.png +| | | | |- 📜 github.png +| | | | |- 📜 pandas-logo.png +| | | | |- 📜 google.png +| | | | |- 📜 dsgt-logo-white-back.png +| | | | |- 📜 dsgt-logo-dark.png +| | | | |- 📜 flask-logo.png +| | | | |- 📜 dsgt-logo-light.png +| | | |- 📂 learn_mod_images: +| | | | |- 📜 lossExample.png +| | | | |- 📜 neuronWithEquation.png +| | | | |- 📜 neuralnet.png +| | | | |- 📜 robotImage.jpg +| | | | |- 📜 sigmoidfunction.png +| | | | |- 📜 lossExampleTable.png +| | | | |- 📜 LeakyReLUactivation.png +| | | | |- 📜 lossExampleEquation.png +| | | | |- 📜 ReLUactivation.png +| | | | |- 📜 neuron.png +| | | | |- 📜 tanhactivation.png +| | | | |- 📜 sigmoidactivation.png +| | | | |- 📜 binarystepactivation.png +| | | |- 📜 demo_video.gif : GIF tutorial of a simple classification training session +| | |- 📜 manifest.json : Default React file for choosing icon based on +| | |- 📜 index.html : Base HTML file that will be initially rendered +| | |- 📜 robots.txt +| | |- 📜 dlp-logo.ico : DLP Logo +| |- 📂 layer_docs: +| | |- 📜 softmax_equation.png : PNG file of Softmax equation +| | |- 📜 Softmax.md : Doc for Softmax layer +| | |- 📜 Linear.md : Doc for Linear layer +| | |- 📜 ReLU.md : Doc for ReLU later | |- 📜 .eslintrc.json -| |- 📜 package.json | |- 📜 .eslintignore -| |- 📜 next.config.js | |- 📜 pnpm-lock.yaml +| |- 📜 next.config.js +| |- 📜 jest.config.js +| |- 📜 package.json | |- 📜 tsconfig.json | |- 📜 next-env.d.ts -| |- 📜 jest.config.js ``` diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 00000000..ba77050f --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,47 @@ +name: Frontend Workflow Check +on: [pull_request, push] + +concurrency: preview-${{ github.ref }} + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + run: npm install -g pnpm + working-directory: ./frontend + + - name: Install + run: pnpm install --frozen-lockfile + id: install + working-directory: ./frontend + + + - name: Run ESLint + run: pnpm run lint + working-directory: ./frontend + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + run: npm install -g pnpm + working-directory: ./frontend + + - name: Install + run: pnpm install --frozen-lockfile + working-directory: ./frontend + + - name: Test + run: echo "pnpm run test should be here" + working-directory: ./frontend + + \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index fe3e789e..2bee4225 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -56,11 +56,13 @@ }, "devDependencies": { "@next/eslint-plugin-next": "^14.0.1", + "@types/react-dom": "^18.2.18", "@typescript-eslint/eslint-plugin": "^6.9.0", "@typescript-eslint/parser": "^6.9.0", "depcheck": "^1.4.7", "eslint": "^8.52.0", "eslint-plugin-react": "^7.33.2", + "prettier": "3.2.2", "typescript": "^5.2.2" } } diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 57e3962e..4722fd7e 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -118,7 +118,7 @@ dependencies: version: 2.6.0(plotly.js@2.27.0)(react@18.2.0) react-redux: specifier: ^8.1.3 - version: 8.1.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + version: 8.1.3(@types/react-dom@18.2.18)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) react-syntax-highlighter: specifier: ^15.5.0 version: 15.5.0(react@18.2.0) @@ -139,6 +139,9 @@ devDependencies: '@next/eslint-plugin-next': specifier: ^14.0.1 version: 14.0.1 + '@types/react-dom': + specifier: ^18.2.18 + version: 18.2.18 '@typescript-eslint/eslint-plugin': specifier: ^6.9.0 version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) @@ -154,6 +157,9 @@ devDependencies: eslint-plugin-react: specifier: ^7.33.2 version: 7.33.2(eslint@8.52.0) + prettier: + specifier: 3.2.2 + version: 3.2.2 typescript: specifier: ^5.2.2 version: 5.2.2 @@ -1649,7 +1655,7 @@ packages: dependencies: immer: 9.0.21 react: 18.2.0 - react-redux: 8.1.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + react-redux: 8.1.3(@types/react-dom@18.2.18)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) redux: 4.2.1 redux-thunk: 2.4.2(redux@4.2.1) reselect: 4.1.8 @@ -1958,7 +1964,11 @@ packages: /@types/prop-types@15.7.9: resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==} - dev: false + + /@types/react-dom@18.2.18: + resolution: {integrity: sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==} + dependencies: + '@types/react': 18.2.33 /@types/react-google-recaptcha@2.1.7: resolution: {integrity: sha512-qAif3VMKgIrT6l3YcCN29F0W0LZR9Q5jxLvH2MANgc2Hm3Pk27goHBwj3Ri4vtFc0jZyFt6npdERdzUtZtJsLQ==} @@ -1991,11 +2001,9 @@ packages: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 csstype: 3.1.2 - dev: false /@types/scheduler@0.16.5: resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==} - dev: false /@types/semver@7.5.4: resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==} @@ -2807,7 +2815,6 @@ packages: /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: false /d3-array@1.2.4: resolution: {integrity: sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==} @@ -5144,6 +5151,12 @@ packages: engines: {node: '>= 0.8.0'} dev: true + /prettier@3.2.2: + resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-bytes@6.1.1: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} @@ -5347,7 +5360,7 @@ packages: react: 18.2.0 dev: false - /react-redux@8.1.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): + /react-redux@8.1.3(@types/react-dom@18.2.18)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): resolution: {integrity: sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==} peerDependencies: '@types/react': ^16.8 || ^17.0 || ^18.0 @@ -5371,6 +5384,7 @@ packages: '@babel/runtime': 7.23.2 '@types/hoist-non-react-statics': 3.3.4 '@types/react': 18.2.33 + '@types/react-dom': 18.2.18 '@types/use-sync-external-store': 0.0.3 hoist-non-react-statics: 3.3.2 react: 18.2.0