Skip to content

Commit

Permalink
Typescript refactor (opensacorg#58)
Browse files Browse the repository at this point in the history
* Replaced Backend with python, fixed infa deploy logic # 35

* backend now tracks images by their sha256 value to avoid duplication
* added new manual action to infra deploy logic # 35
* added log retention logic to backend deploy # 36
* added new fields to deploy_map
    "log_retention_days": 30,
    "dns_domain_map_root": true,
* made github_actions script aware of domain, and "is_root_domain" deploy_map setting

* Addresses # 32, added new features amongst them a download all button

* added new packages to UI
    * "dexie" local storage w/ indexeddb browser store, localstore
      couldn't cut it
    * "file-saver": allows us to do a saveas with the zip file
    * "jszip": zip libarary to address #
* indicators for backend upload success, and if the image has been seen
  before
* now looks good in mobile as well as desktop
* also using indexeddb introduced caching the file objects (for download later) and caching of the tf model

* Added support for python packages

* Adjusted permission to add/remove layers in the prefix namespace

* fixed permissions issue for layers / backend deploy

* Added hash and other metadata to the metadata display and hover over filename

* Fixed metadata download and info button

* Fixing file ext name issue with s3 bucket upload on backend

* Promote staging updates to prod (opensacorg#52)

* Coco POC #8 #9 (#19) (#26)

* Fixed some package.json issues, updated some entries in .gitignore and .in (for those who would use it)

* saving work

* saving work... having issues with async reading file then loading it in coco

* coco confirmed working

* Added JSON metadata

* Arg! this should work

* Removed Pro port mapping from localstack docker-compose

* Added multiple file upload and cleaned up presentation a bit

Looks like there is a problem with uploading multiple files at once, the
predictions don't always trigger

* Minor updates to MacOS details (#24)

Co-authored-by: Jim <[email protected]>

Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>

Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>

* removed symlink

* Testing coco (#28)

* Fixed some package.json issues, updated some entries in .gitignore and .in (for those who would use it)

* saving work

* saving work... having issues with async reading file then loading it in coco

* coco confirmed working

* Added JSON metadata

* Arg! this should work

* Removed Pro port mapping from localstack docker-compose

* Added multiple file upload and cleaned up presentation a bit

Looks like there is a problem with uploading multiple files at once, the
predictions don't always trigger

* Minor updates to MacOS details (#24)

Co-authored-by: Jim <[email protected]>

* removed symlink to web_model

* Coco POC #8 #9 (#19) (#26)

* Fixed some package.json issues, updated some entries in .gitignore and .in (for those who would use it)

* saving work

* saving work... having issues with async reading file then loading it in coco

* coco confirmed working

* Added JSON metadata

* Arg! this should work

* Removed Pro port mapping from localstack docker-compose

* Added multiple file upload and cleaned up presentation a bit

Looks like there is a problem with uploading multiple files at once, the
predictions don't always trigger

* Minor updates to MacOS details (#24)

Co-authored-by: Jim <[email protected]>

Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>

Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>

* removed symlink

Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>

* Changed upload behaviour

* Refactored upload dialog / drop area

* added more model samples
* removed dropzone package

* Fixed issue with remove / key and array order

* Removed lab / test for deployed versions of environment

* Added about page

* Forgot to update the metadata text

* Yolov5-Taco web model #7 (opensacorg#30)

* Testing tf_web model export

* removing pyright

* Working version of taco dataset + initial build instructions

* Created links to code4sac and the github project

Added jupyter notebook files for new training as well as using existing
training data

* Adjusted new training jupyter notebook

* Testing change to model loading in AWS

* Try 2 on loading model

* Try 3 on loading model

* Reverting changes (has to do with basic auth url)

* Removed old react frontend directory

* Removed old react frontend directory (opensacorg#34)

* Moving domain from codefordev to trashai.org

* Fixes for opensacorg#36, opensacorg#35, opensacorg#32 + download all feature, and backend refactor w/ dedup (opensacorg#38)

* Replaced Backend with python, fixed infa deploy logic # 35

* backend now tracks images by their sha256 value to avoid duplication
* added new manual action to infra deploy logic # 35
* added log retention logic to backend deploy # 36
* added new fields to deploy_map
    "log_retention_days": 30,
    "dns_domain_map_root": true,
* made github_actions script aware of domain, and "is_root_domain" deploy_map setting

* Addresses # 32, added new features amongst them a download all button

* added new packages to UI
    * "dexie" local storage w/ indexeddb browser store, localstore
      couldn't cut it
    * "file-saver": allows us to do a saveas with the zip file
    * "jszip": zip libarary to address #
* indicators for backend upload success, and if the image has been seen
  before
* now looks good in mobile as well as desktop
* also using indexeddb introduced caching the file objects (for download later) and caching of the tf model

* Added support for python packages

* Adjusted permission to add/remove layers in the prefix namespace

* fixed permissions issue for layers / backend deploy

* Added hash and other metadata to the metadata display and hover over filename

* Fixed metadata download and info button

* bugfix on s3 naming with file extension (opensacorg#40)

* Added magnifying feature for larger images

* filling out the about page (opensacorg#45)

* filling out the about page

* adding article

* better formatting

* Made about page default opensacorg#49

* Added "Samples" button to upload tab closes opensacorg#50

* Making about updates specified in opensacorg#48 (opensacorg#51)

* Making about updates specified in opensacorg#48

* removing space

* small about update

Co-authored-by: Steven Hollingsworth <[email protected]>
Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>

* Typescript refactor Version 1

* removed nuxt

* removed more files

* adjusted build commands

* fixed height issue with uploads

* re-implemented backend

* adjusted frontend deploy stack

* Added github secret for google maps api key

* Added dockerfile for frontend

* added jszip

* Fixed android upload gps issue, fixed mobile status truncating issue

* removed uneeded logo files

Co-authored-by: Dan Fey <[email protected]>
Co-authored-by: Jim Ewald <[email protected]>
Co-authored-by: Jim <[email protected]>
  • Loading branch information
4 people authored Aug 4, 2022
1 parent 8bfc643 commit 25ab380
Show file tree
Hide file tree
Showing 204 changed files with 7,934 additions and 12,939 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/node_modules
**/node_modules/**
./model
./archive
./data
2 changes: 2 additions & 0 deletions .github/workflows/infra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ jobs:
node-version: "14"

- name: Run Deploy
env:
VITE_GOOGLE_MAPS_API_KEY: ${{ secrets.VITE_GOOGLE_MAPS_API_KEY }}
run: ./bin/github_actions.py deploy --doit
1 change: 1 addition & 0 deletions .github/workflows/manual_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ jobs:
run: ./bin/github_actions.py manual --stack ${{ github.event.inputs.stack }}
env:
SKIP_FRONTEND: ${{ github.event.inputs.skip_frontend }}
VITE_GOOGLE_MAPS_API_KEY: ${{ secrets.VITE_GOOGLE_MAPS_API_KEY }}
2 changes: 1 addition & 1 deletion .in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source $HOME/.config/nvm/nvm.sh
nvm use 16.14.0
export B=$(dirname $0)
export J=$B/frontend
export O=$B/frontend.orig
export S=$B/frontend/src
export K=$B/infra
export C=$B/backend
5 changes: 5 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ async def upload(
"uploaded": uploaded,
}

@app.get("/test")
async def test():
return {"message": "Hello World"}



# def rate(event, context):
# current_time = datetime.datetime.now().time()
Expand Down
4 changes: 3 additions & 1 deletion bin/github_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ class Config:
chain(
BASE.glob("frontend/*.json"),
BASE.glob("frontend/src/**/*"),
BASE.glob("frontend/*.js"),
BASE.glob("frontend/**/*.ts"),
BASE.glob("frontend/**/*.js"),
BASE.glob("frontend/**/*.vue"),
BASE.glob("frontend/package.json"),
BASE.glob("infra/lib/frontend/**/*"),
)
Expand Down
3 changes: 1 addition & 2 deletions bin/runfrontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ IFS=$'\n\t'

export PATH="$PATH:/node_modules/.bin:/stack/bin:node_modules/.bin"

cnt=0
wait-for-it.sh -t 300 -h backend -p 4000
cd /stack/frontend
while true; do
yarn
nuxt dev
yarn dev --port 5150 --host 0.0.0.0
sleep 30
done
16 changes: 0 additions & 16 deletions frontend/.babelrc

This file was deleted.

4 changes: 4 additions & 0 deletions frontend/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11
2 changes: 0 additions & 2 deletions frontend/.dockerignore

This file was deleted.

31 changes: 18 additions & 13 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
export default {
extends: [
"plugin:vue/base",
"plugin:vuetify/base",
"plugin:vue/recommended",
],
rules: {
"no-console": "off",
"vue/html-indent": "off",
"vue/html-self-closing": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/max-attributes-per-line": "off",
},
module.exports = {
root: true,
env: {
node: true,
},
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
};
5 changes: 0 additions & 5 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.DS_Store
node_modules
/dist
.nuxt/
tmp/
**/*.pyc


# local env files
Expand All @@ -24,5 +21,3 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?

coverage/
12 changes: 12 additions & 0 deletions frontend/.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DIR="$( cd "$( dirname "$0" )" && pwd )"
source $HOME/.config/nvm/nvm.sh
# nvm use 16.14.0
nvm use --lts
export B="${DIR}"
case ":$PYTHONPATH:" in
*:${PWD}/src:*) ;;
*) export PYTHONPATH="${PYTHONPATH}:${PWD}/src" ;;
esac
export VITE_FRONTEND_PORT="5150"
export VITE_BACKEND_FQDN="localhost"
export VITE_BACKEND_PORT="4000"
9 changes: 9 additions & 0 deletions frontend/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
trailingComma: 'all',
tabWidth: 4,
semi: false,
singleQuote: true,
bracketSpacing: true,
arrowParens: 'always',
singleAttributePerLine: true,
}
4 changes: 0 additions & 4 deletions frontend/.prettierrc.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions frontend/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.DEFAULT_GOAL := help
help:
@echo "Available commands:"
@echo
@cat Makefile | grep '^\w.*:$$' | cut -d ':' -f 1 | grep -v '^help$$'

dev:
yarn vite dev

preview:
rm -rfv ./dist/*
yarn vite build
yarn vite preview

build:
yarn vite build


clean:
rm -rfv ./node_modules/
rm -rfv ./yarn.lock
rm -rfv ./package-lock.json
yarn install

pretty:
yarn prettier --write $$(find ./src -name '*.ts')
yarn prettier --write $$(find ./src -name '*.vue')
yarn prettier --write $$(find ./src -name '*.scss')
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vuetify-demo
# frontend

## Project setup
```
Expand Down
6 changes: 3 additions & 3 deletions frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
presets: ["@vue/cli-plugin-babel/preset"],
};
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
}
16 changes: 16 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Trash AI</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
18 changes: 0 additions & 18 deletions frontend/jest.config.js

This file was deleted.

Loading

0 comments on commit 25ab380

Please sign in to comment.