diff --git a/back/nodemon.json b/back/nodemon.json new file mode 100644 index 0000000..14d3f38 --- /dev/null +++ b/back/nodemon.json @@ -0,0 +1,6 @@ +{ + "watch": ["src/"], + "ext": "ts,json", + "exec": "etsc && node ./dist/index.js", + "legacyWatch": true +} diff --git a/back/package.json b/back/package.json new file mode 100644 index 0000000..1548611 --- /dev/null +++ b/back/package.json @@ -0,0 +1,26 @@ +{ + "name": "roomruler", + "version": "1.0.0", + "description": "Web application for distribution of free classrooms", + "scripts": { + "build": "esbuild src/index.ts --bundle --minify --outdir=dist --platform=node", + "start": "esbuild", + "dev": "nodemon" + }, + "author": "dm1sh", + "license": "MIT", + "devDependencies": { + "@types/ws": "^7.4.7", + "esbuild": "^0.12.25", + "esbuild-envfile-plugin": "^1.0.1", + "esbuild-node-tsc": "^1.6.1", + "nodemon": "^2.0.12", + "typescript": "^4.4.2" + }, + "dependencies": { + "pg": "^8.7.1", + "reflect-metadata": "^0.1.13", + "typeorm": "^0.2.37", + "ws": "^8.2.1" + } +} diff --git a/back/src/index.ts b/back/src/index.ts new file mode 100644 index 0000000..0bab5b9 --- /dev/null +++ b/back/src/index.ts @@ -0,0 +1,12 @@ +import "reflect-metadata"; +import { Server } from "ws"; + +(async () => { + const wss = new Server({ + port: Number.parseInt(process.env.PORT || "") || 8081, + }); + + wss.on("connection", async (ws) => { + ws.send("hello"); + }); +})(); diff --git a/back/tsconfig.json b/back/tsconfig.json new file mode 100644 index 0000000..7d1d347 --- /dev/null +++ b/back/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "esModuleInterop": true, + "moduleResolution": "node", + "forceConsistentCasingInFileNames": true, + "strict": false, + "skipLibCheck": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "outDir": "dist" + } +} diff --git a/index.html b/front/index.html similarity index 100% rename from index.html rename to front/index.html diff --git a/package.json b/front/package.json similarity index 100% rename from package.json rename to front/package.json diff --git a/src/App.tsx b/front/src/App.tsx similarity index 100% rename from src/App.tsx rename to front/src/App.tsx diff --git a/src/components/BuildingPlan.tsx b/front/src/components/BuildingPlan.tsx similarity index 100% rename from src/components/BuildingPlan.tsx rename to front/src/components/BuildingPlan.tsx diff --git a/src/components/Canvas.tsx b/front/src/components/Canvas.tsx similarity index 100% rename from src/components/Canvas.tsx rename to front/src/components/Canvas.tsx diff --git a/src/components/RoomList.tsx b/front/src/components/RoomList.tsx similarity index 100% rename from src/components/RoomList.tsx rename to front/src/components/RoomList.tsx diff --git a/src/constants.ts b/front/src/constants.ts similarity index 100% rename from src/constants.ts rename to front/src/constants.ts diff --git a/src/context.tsx b/front/src/context.tsx similarity index 100% rename from src/context.tsx rename to front/src/context.tsx diff --git a/src/index.tsx b/front/src/index.tsx similarity index 100% rename from src/index.tsx rename to front/src/index.tsx diff --git a/src/types/context.ts b/front/src/types/context.ts similarity index 100% rename from src/types/context.ts rename to front/src/types/context.ts diff --git a/src/types/room.ts b/front/src/types/room.ts similarity index 100% rename from src/types/room.ts rename to front/src/types/room.ts diff --git a/src/types/time.ts b/front/src/types/time.ts similarity index 100% rename from src/types/time.ts rename to front/src/types/time.ts diff --git a/src/types/ui.ts b/front/src/types/ui.ts similarity index 100% rename from src/types/ui.ts rename to front/src/types/ui.ts diff --git a/tsconfig.json b/front/tsconfig.json similarity index 100% rename from tsconfig.json rename to front/tsconfig.json diff --git a/vite.config.js b/front/vite.config.js similarity index 100% rename from vite.config.js rename to front/vite.config.js