Initial UWU

This commit is contained in:
Gvidas Juknevičius 2024-08-28 01:10:18 +03:00
commit dd2cc51c40
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
6 changed files with 1610 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/node_modules

30
README.md Normal file
View File

@ -0,0 +1,30 @@
# rfc
```text
GET /api/ws
GET /api/{uuid}/keypad/code
GET /api/{uuid}/keypad/get_user_info/{uid}
POST /api/{uuid}/keypad/log/door_open/{uid}
POST /api/{uuid}/keypad/set_code
POST /api/{uuid}/core/reboot
POST /api/{uuid}/core/update
```
## websocket
```json
[
0, // op
{
// data,
}
]
```
on connect:
- get client session code, to be used with api
- get explicitly set computer name from db, by the CC:T computer id, or randomly generated UUID thats set on SW install,
- on connect computer sends its module type eg. keypad, and gets extra info related to it, like: code, current.

1533
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "rtmc-be",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@types/express": "^4.17.21",
"@types/knex": "^0.15.2",
"@types/node": "^22.5.0",
"@types/ws": "^8.5.12",
"typescript": "^5.5.4"
},
"dependencies": {
"express": "^4.19.2",
"knex": "^3.1.0",
"pug": "^3.0.3",
"ws": "^8.18.0"
}
}

0
src/index.ts Normal file
View File

21
tsconfig.json Normal file
View File

@ -0,0 +1,21 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions": {
"typeRoots": ["./node_modules/@types", "./src/types"],
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "NodeNext",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"types": [""],
"noEmit": true,
"isolatedModules": true,
"noImplicitAny": true,
"alwaysStrict": true,
"outDir": "build",
},
"include": [
"src/**/*.ts",
]
}