Skip to content

Commit

Permalink
Merge pull request #180 from DigitalSlideArchive/vue-binary-build
Browse files Browse the repository at this point in the history
Vue binary build
  • Loading branch information
marySalvi committed Jan 30, 2024
2 parents 04be8a1 + 6cd3f30 commit dd775b4
Show file tree
Hide file tree
Showing 22 changed files with 1,042 additions and 60 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Developer tools
.envrc
.vscode/*
# Redacted Images

# Build artifacts
*/web_static/*

# Sample Redacted Images
*/REDACTED_*
*/Redacted_*
Redacted_*/
Expand Down
2 changes: 2 additions & 0 deletions client/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This could leak to production. Should only be used in DEBUG mode for FastAPI
VITE_APP_API_URL=http://127.0.0.1:8000
File renamed without changes.
21 changes: 21 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Development
For efficient front end developement in the project root run:

```bash
export DEBUG=True
hypercorn --reload imagedephi.gui:app
```

In a new terminal:

```bash
cd client/
yarn dev
```

**Note**
`imagedephi gui` will break and tests will fail in debug mode. Remember to reset variable when done with development.

```bash
export DEBUG=False
```
File renamed without changes.
12 changes: 9 additions & 3 deletions imagedephi/client/package.json → client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
"name": "imagedephi",
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"type": "module",
"scripts": {
"dev": "vite --port 8080",
"build": "vue-tsc && vite build",
"preview": "vite preview"
"lint:tsc": "vue-tsc --noEmit",
"lint": "npm-run-all lint:*",
"dev": "NODE_ENV=development vite --port 8080",
"build:clean": "rimraf ../imagedephi/web_static",
"build:compile": "vite build --outDir ../imagedephi/web_static",
"build": "npm-run-all build:clean build:compile"
},
"dependencies": {
"vue": "^3.3.4"
Expand All @@ -15,7 +19,9 @@
"@vitejs/plugin-vue": "^4.2.3",
"autoprefixer": "^10.4.16",
"daisyui": "^4.0.7",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.31",
"rimraf": "^5.0.5",
"tailwindcss": "^3.3.5",
"typescript": "^5.0.2",
"vite": "^4.4.5",
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions client/src/api/rest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export async function getDirectoryInfo(path?:string) {
const selectedPath= path ? path : '';
const basePath = import.meta.env.VITE_APP_API_URL ? import.meta.env.VITE_APP_API_URL : '';
const response = await fetch(`${basePath}/directory/${selectedPath}`, {method: "GET", mode: 'cors'});

return response.json()

}
2 changes: 2 additions & 0 deletions imagedephi/client/src/main.ts → client/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import './style.css'
import { getDirectoryInfo } from './api/rest.ts'

createApp(App).mount('#app')
getDirectoryInfo()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit dd775b4

Please sign in to comment.