Skip to content

Commit 39b1d38

Browse files
committed
Created Drive App
1 parent 7ed9bd5 commit 39b1d38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1593
-5
lines changed

.github/workflows/build-drive-app.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build Drive App
2+
run-name: Build Drive App On Pull Request
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
permissions:
13+
actions: read
14+
contents: read
15+
security-events: write
16+
17+
steps:
18+
- name: 💾 Checking out the repository
19+
uses: actions/checkout@v4
20+
- name: ⚙️ Setting up the MonkJs project
21+
uses: ./.github/actions/monkjs-set-up
22+
- name: 📱 Building the Drive app
23+
run: yarn build:drive-app:staging
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Drive App
2+
run-name: Deploy Drive App To Staging After Merge
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
permissions:
13+
actions: read
14+
contents: read
15+
security-events: write
16+
17+
steps:
18+
- name: 💾 Checking out the repository
19+
uses: actions/checkout@v4
20+
- name: ⚙️ Setting up the MonkJs project
21+
uses: ./.github/actions/monkjs-set-up
22+
- name: 📱 Building the Drive app
23+
run: yarn build:drive-app:staging
24+
- name: 📦 Uploading the artifact
25+
uses: actions/[email protected]
26+
with:
27+
name: build-drive-app-staging
28+
path: apps/drive-app/build
29+
30+
deploy:
31+
name: Deploy
32+
environment: staging
33+
needs:
34+
- build
35+
container:
36+
image: dtzar/helm-kubectl:3.14.2
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: 🔐 Authenticating to Google Cloud
40+
uses: google-github-actions/[email protected]
41+
with:
42+
credentials_json: "${{ secrets.GKE_SA_KEY }}"
43+
- name: 🔐 Obtaining GKE credentials
44+
uses: google-github-actions/[email protected]
45+
with:
46+
cluster_name: ${{ secrets.GKE_CLUSTER }}
47+
location: ${{ secrets.GKE_ZONE }}
48+
project_id: ${{ secrets.GKE_PROJECT }}
49+
- name: 📦 Downloading the artifact
50+
uses: actions/[email protected]
51+
with:
52+
name: build-drive-app-staging
53+
path: drive-staging
54+
- name: 🧹 Cleaning up previous build
55+
run: |-
56+
kubectl -n poc exec -it $(kubectl get pods -n poc -l app.kubernetes.io/instance=poc-spa --no-headers | awk '{print $1}') -- rm -rf drive-staging
57+
- name: 🌐 Deploying app
58+
run: |-
59+
kubectl -n poc cp drive-staging poc/$(kubectl get pods -n poc -l app.kubernetes.io/instance=poc-spa --no-headers | awk '{print $1}'):/app/

apps/drive-app/.env-cmdrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"local": {
3+
"PORT": "17200",
4+
"HTTPS": "true",
5+
"ESLINT_NO_DEV_ERRORS": "true",
6+
"REACT_APP_ENVIRONMENT": "local",
7+
"REACT_APP_API_DOMAIN": "api.preview.monk.ai/v1",
8+
"REACT_APP_AUTH_DOMAIN": "idp.preview.monk.ai",
9+
"REACT_APP_AUTH_AUDIENCE": "https://api.monk.ai/v1/",
10+
"REACT_APP_AUTH_CLIENT_ID": "O7geYcPM6zEJrHw0WvQVzSIzw4WzrAtH",
11+
"REACT_APP_SENTRY_DSN": "https://496e3a7f8e04df38e76d579c27c30e87@o4505669501648896.ingest.us.sentry.io/4507169054326784"
12+
},
13+
"development": {
14+
"REACT_APP_ENVIRONMENT": "development",
15+
"REACT_APP_API_DOMAIN": "api.preview.monk.ai/v1",
16+
"REACT_APP_AUTH_DOMAIN": "idp.preview.monk.ai",
17+
"REACT_APP_AUTH_AUDIENCE": "https://api.monk.ai/v1/",
18+
"REACT_APP_AUTH_CLIENT_ID": "O7geYcPM6zEJrHw0WvQVzSIzw4WzrAtH",
19+
"REACT_APP_SENTRY_DSN": "https://496e3a7f8e04df38e76d579c27c30e87@o4505669501648896.ingest.us.sentry.io/4507169054326784"
20+
},
21+
"staging": {
22+
"REACT_APP_ENVIRONMENT": "staging",
23+
"REACT_APP_API_DOMAIN": "api.preview.monk.ai/v1",
24+
"REACT_APP_AUTH_DOMAIN": "idp.preview.monk.ai",
25+
"REACT_APP_AUTH_AUDIENCE": "https://api.monk.ai/v1/",
26+
"REACT_APP_AUTH_CLIENT_ID": "O7geYcPM6zEJrHw0WvQVzSIzw4WzrAtH",
27+
"REACT_APP_SENTRY_DSN": "https://496e3a7f8e04df38e76d579c27c30e87@o4505669501648896.ingest.us.sentry.io/4507169054326784"
28+
},
29+
"preview": {
30+
"REACT_APP_ENVIRONMENT": "preview",
31+
"REACT_APP_API_DOMAIN": "api.preview.monk.ai/v1",
32+
"REACT_APP_AUTH_DOMAIN": "idp.preview.monk.ai",
33+
"REACT_APP_AUTH_AUDIENCE": "https://api.monk.ai/v1/",
34+
"REACT_APP_AUTH_CLIENT_ID": "O7geYcPM6zEJrHw0WvQVzSIzw4WzrAtH",
35+
"REACT_APP_SENTRY_DSN": "https://496e3a7f8e04df38e76d579c27c30e87@o4505669501648896.ingest.us.sentry.io/4507169054326784"
36+
}
37+
}

apps/drive-app/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

apps/drive-app/.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const OFF = 0;
2+
const WARN = 1;
3+
const ERROR = 2;
4+
5+
module.exports = {
6+
extends: ['@monkvision/eslint-config-typescript-react'],
7+
parserOptions: {
8+
project: ['./tsconfig.json'],
9+
},
10+
rules: {
11+
'import/no-extraneous-dependencies': OFF,
12+
'no-console': OFF,
13+
}
14+
}

apps/drive-app/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# builds
2+
build/
3+
lib/
4+
dist/
5+
module/
6+
commonjs/
7+
typescript/
8+
web-build/
9+
10+
# modules
11+
node_modules/
12+
coverage/
13+
.expo/
14+
.docusaurus/
15+
16+
# logs
17+
npm-debug.*
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
# cache
23+
.eslintcache
24+
25+
# misc
26+
.DS_Store

apps/drive-app/LICENSE

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
The Clear BSD License
2+
3+
Copyright (c) [2022] [Monk](http://monk.ai)
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted (subject to the limitations in the disclaimer
8+
below) provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in the
15+
documentation and/or other materials provided with the distribution.
16+
17+
* Neither the name of the copyright holder nor the names of its
18+
contributors may be used to endorse or promote products derived from this
19+
software without specific prior written permission.
20+
21+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
22+
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
POSSIBILITY OF SUCH DAMAGE.

apps/drive-app/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Drive App
2+
This application is a custom capture app designed for Drive.
3+
4+
# Running the App
5+
In order to run the app, you will need to have [NodeJs](https://nodejs.org/en) >= 16 and
6+
[Yarn 3](https://yarnpkg.com/getting-started/install) installed. Then, you'll need to install the required dependencies
7+
using the following command :
8+
9+
```bash
10+
yarn install
11+
```
12+
13+
You then need to copy the local environment configuration available in the `env.txt` file at the root of the directory
14+
into an env file called `.env` :
15+
16+
```bash
17+
cp env.txt .env
18+
```
19+
20+
You can then start the app by running :
21+
22+
```bash
23+
yarn start
24+
```
25+
26+
The application is by default available at `https://localhost:17200/`.
27+
28+
# Building the App
29+
To build the app, you simply need to run the following command :
30+
31+
```bash
32+
yarn build
33+
```
34+
35+
Don't forget to update the environment variables defined in your `.env` file for the target website.
36+
37+
# Testing
38+
## Running the Tests
39+
To run the tests of the app, simply run the following command :
40+
41+
```bash
42+
yarn test
43+
```
44+
45+
To run the tests as well as collecgt coverage, run the following command :
46+
47+
```bash
48+
yarn test:coverage
49+
```
50+
51+
## Analyzing Bundle Size
52+
After building the app using the `yarn build` command, you can analyze the bundle size using the following command :
53+
54+
```bash
55+
yarn analyze
56+
```
57+
58+
This will open a new window on your desktop browser where you'll be able to see the sizes of each module in the final
59+
app.

apps/drive-app/jest.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { react } = require('@monkvision/jest-config');
2+
3+
module.exports = {
4+
...react,
5+
coverageThreshold: {
6+
global: {
7+
branches: 0,
8+
functions: 0,
9+
lines: 0,
10+
statements: 0,
11+
},
12+
},
13+
};

apps/drive-app/package.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"name": "drive-app",
3+
"version": "4.0.0",
4+
"license": "BSD-3-Clause-Clear",
5+
"packageManager": "[email protected]",
6+
"description": "MonkJs capture app for Drive",
7+
"author": "monkvision",
8+
"private": true,
9+
"scripts": {
10+
"start": "env-cmd -e local react-scripts start",
11+
"build:development": "env-cmd -e development react-scripts build",
12+
"build:staging": "env-cmd -e staging react-scripts build",
13+
"build:preview": "env-cmd -e preview react-scripts build",
14+
"test": "jest",
15+
"test:coverage": "jest --coverage",
16+
"analyze": "source-map-explorer 'build/static/js/*.js'",
17+
"eject": "react-scripts eject",
18+
"prettier": "prettier --check ./src",
19+
"prettier:fix": "prettier --write ./src",
20+
"eslint": "eslint --format=pretty ./src",
21+
"eslint:fix": "eslint --fix --format=pretty ./src",
22+
"lint": "yarn run prettier && yarn run eslint",
23+
"lint:fix": "yarn run prettier:fix && yarn run eslint:fix"
24+
},
25+
"dependencies": {
26+
"@auth0/auth0-react": "^2.2.4",
27+
"@monkvision/common": "4.0.0",
28+
"@monkvision/common-ui-web": "4.0.0",
29+
"@monkvision/inspection-capture-web": "4.0.0",
30+
"@monkvision/monitoring": "4.0.0",
31+
"@monkvision/network": "4.0.0",
32+
"@monkvision/sentry": "4.0.0",
33+
"@monkvision/sights": "4.0.0",
34+
"@monkvision/types": "4.0.0",
35+
"@types/babel__core": "^7",
36+
"@types/jest": "^27.5.2",
37+
"@types/node": "^16.18.18",
38+
"@types/react": "^17.0.2",
39+
"@types/react-dom": "^17.0.2",
40+
"@types/react-router-dom": "^5.3.3",
41+
"@types/sort-by": "^1",
42+
"axios": "^1.5.0",
43+
"i18next": "^23.4.5",
44+
"i18next-browser-languagedetector": "^7.1.0",
45+
"jest-watch-typeahead": "^2.2.2",
46+
"localforage": "^1.10.0",
47+
"match-sorter": "^6.3.4",
48+
"react": "^17.0.2",
49+
"react-dom": "^17.0.2",
50+
"react-i18next": "^13.2.0",
51+
"react-router-dom": "^6.22.3",
52+
"react-scripts": "5.0.1",
53+
"sort-by": "^1.2.0",
54+
"source-map-explorer": "^2.5.3",
55+
"typescript": "^4.9.5",
56+
"web-vitals": "^2.1.4"
57+
},
58+
"devDependencies": {
59+
"@babel/core": "^7.22.9",
60+
"@monkvision/eslint-config-base": "4.0.0",
61+
"@monkvision/eslint-config-typescript": "4.0.0",
62+
"@monkvision/eslint-config-typescript-react": "4.0.0",
63+
"@monkvision/jest-config": "4.0.0",
64+
"@monkvision/prettier-config": "4.0.0",
65+
"@monkvision/test-utils": "4.0.0",
66+
"@monkvision/typescript-config": "4.0.0",
67+
"@testing-library/dom": "^8.20.0",
68+
"@testing-library/jest-dom": "^5.16.5",
69+
"@testing-library/react": "^12.1.5",
70+
"@testing-library/react-hooks": "^8.0.1",
71+
"@testing-library/user-event": "^12.1.5",
72+
"@typescript-eslint/eslint-plugin": "^5.43.0",
73+
"@typescript-eslint/parser": "^5.43.0",
74+
"env-cmd": "^10.1.0",
75+
"eslint": "^8.29.0",
76+
"eslint-config-airbnb-base": "^15.0.0",
77+
"eslint-config-prettier": "^8.5.0",
78+
"eslint-formatter-pretty": "^4.1.0",
79+
"eslint-plugin-eslint-comments": "^3.2.0",
80+
"eslint-plugin-import": "^2.26.0",
81+
"eslint-plugin-jest": "^25.3.0",
82+
"eslint-plugin-jsx-a11y": "^6.7.1",
83+
"eslint-plugin-prettier": "^4.2.1",
84+
"eslint-plugin-promise": "^6.1.1",
85+
"eslint-plugin-react": "^7.27.1",
86+
"eslint-plugin-react-hooks": "^4.3.0",
87+
"eslint-utils": "^3.0.0",
88+
"jest": "^29.3.1",
89+
"prettier": "^2.7.1",
90+
"regexpp": "^3.2.0",
91+
"ts-jest": "^29.0.3"
92+
},
93+
"prettier": "@monkvision/prettier-config",
94+
"browserslist": {
95+
"production": [
96+
">0.2%",
97+
"not dead",
98+
"not op_mini all"
99+
],
100+
"development": [
101+
"last 1 chrome version",
102+
"last 1 firefox version",
103+
"last 1 safari version"
104+
]
105+
}
106+
}

apps/drive-app/public/favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)