Skip to content

Commit df8a3aa

Browse files
committed
init
0 parents  commit df8a3aa

23 files changed

+5723
-0
lines changed

.deployment

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[config]
2+
SCM_DO_BUILD_DURING_DEPLOYMENT=true

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Ignore specific file
2+
config.json
3+
.env
4+
.dep
5+
node_modules/
6+
session*
7+
8+
# console, not released in this module
9+
public/console*
10+
11+
# need more work, release in future
12+
index-llm*
13+
llm*
14+
hey*
15+
16+
# Ignore all .log files
17+
*.log
18+
19+
# Ignore all files in the "temp" directory
20+
temp/
21+
22+
# Ignore all .tmp files in any directory
23+
**/*.tmp

.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"appService.defaultWebAppToDeploy": "/subscriptions/3e6d532b-34e9-47a5-a7f7-e11bc8869fb8/resourceGroups/2gollmuseast042023/providers/Microsoft.Web/sites/operator2g",
3+
"appService.deploySubpath": ".",
4+
"appService.zipIgnorePattern": [
5+
"node_modules{,/**}",
6+
".vscode{,/**}"
7+
]
8+
}

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# *process flow* handChecker 2023.09
2+
3+
## events table
4+
|sevents|state |prompt|data/constructor|error
5+
|--|--|--|--|--|
6+
|start | null|say 'Hey Joe'|`init()`, `iniAgora()`*not included here
7+
|voice | 1|await motion...|
8+
|motion detected |2|await gesture|
9+
|gesture detected |3|say 'check'|`.boxLoc()`, `typeOf()`|'gesture first', `rout to 2`
10+
|break[]|--|--|--|--|
11+
|check or upload |4|checking now|.`imageBlob()|`
12+
|md ready |5|showing result|save to Azure CV Prediction
13+
14+
## variables
15+
16+
|var| reference |
17+
|--|--|
18+
| prompt: |instruction or state, `say 'Hey Computer' to start,/awaiting hand gesture...`,` |
19+
| dataset: |id, tag, info,|
20+
| dataset: |keyContain `key (CV prediction) or contain (Azure storage container)`|
21+
| dataset: |endConnect `endpoint (CV prediction) or connection (Azure storage container)`|
22+
| snapShot: |image & prediction results|
23+
| snapShot Image: |blob, 224 X 224, vector directioned per pointing gesture|
24+
| socket|messages to lead console: `gridID`, state|
25+
| Agora|webRTC, auth `token, UID, session ID`, and `channel name|`
26+
27+
## js libraries
28+
29+
|js| usage |
30+
|--|--|
31+
|jsQR | QR Code `./lib/jsQR.js`|
32+
|mediaPipe | `handMarkers, fileSaver,hands,drawing` |
33+
|Agora | `AgoraRTC 4.7.3` |
34+
|Markdown Extension | `marked` and `stackedit.io` |
35+
36+
## bugs and taks
37+
>jsQR failed often
38+
>snapShot image to be shown on sidePage
39+
>error handlings
40+
>
41+
> Sept 02, 2023

index.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import express from 'express';
2+
const app = express();
3+
4+
import http from 'http';
5+
const server = http.Server(app);
6+
7+
8+
import bodyParser from 'body-parser';
9+
10+
// Middleware
11+
app.use(bodyParser.json());
12+
13+
14+
15+
// Express routing path variable: __dirname, __filename
16+
import { fileURLToPath } from 'url';
17+
import { dirname } from 'path';
18+
19+
const __filename = fileURLToPath(import.meta.url);
20+
const __dirname = dirname(__filename);
21+
22+
// Serve static files from the 'public' directory
23+
app.use(express.static(__dirname + '/public'));
24+
25+
26+
// Route for Operator- camera.html
27+
app.get('/', function (req, res) {
28+
res.sendFile('camera.html', { root: __dirname + '/public' });
29+
});
30+
31+
// Route for Supervisor-Lead - console.html file
32+
app.get('/lead', function (req, res) {
33+
res.sendFile('console.html', { root: __dirname + '/public' });
34+
});
35+
36+
37+
const port = process.env.PORT || 3000;
38+
server.listen(port, function () { // Updated this line to use 'server' instead of 'http'
39+
console.log(`Server listening on port ${port}`);
40+
});

0 commit comments

Comments
 (0)