Skip to content

Commit d7828e9

Browse files
committed
updated the folder structuer for deployment
1 parent d33552d commit d7828e9

10 files changed

Lines changed: 180 additions & 115 deletions

File tree

‎.env‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
REACT_APP_BACKEND_URL=http://0.0.0.0:5000
22
REACT_APP_API_BASE_URL=0.0.0.0
33
REACT_APP_API_BASE_PORT=3000
4+
VITE_BACKEND_URL=http://localhost:4000

server.js renamed to backhand1/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { Server } = require('socket.io');
66
const io = new Server(server);
77
app.use(express.static('build'));
88
const userSocketMap = {};
9-
const ACTIONS = require('./src/Actions'); // ✅ correct import
9+
const ACTIONS = require('../src/Actions'); // ✅ correct import
1010
const roomCodeMap = {}; // { roomId: { javascript, htmlmixed, css } }
1111

1212

servercss.js renamed to backhand2/servercss.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { Server } = require('socket.io');
66
const io = new Server(server);
77
app.use(express.static('build'));
88
const userSocketMap = {};
9-
const ACTIONS = require('./src/Actions'); // ✅ correct import
9+
const ACTIONS = require('../src/Actions'); // ✅ correct import
1010
const roomCodeMap = {}; // { roomId: { javascript, htmlmixed, css } }
1111

1212

serverhtml.js renamed to backhand3/serverhtml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { Server } = require('socket.io');
66
const io = new Server(server);
77
app.use(express.static('build'));
88
const userSocketMap = {};
9-
const ACTIONS = require('./src/Actions'); // ✅ correct import
9+
const ACTIONS = require('../src/Actions'); // ✅ correct import
1010
const roomCodeMap = {}; // { roomId: { javascript, htmlmixed, css } }
1111

1212

‎package-lock.json‎

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@testing-library/jest-dom": "^6.7.0",
88
"@testing-library/react": "^16.3.0",
99
"@testing-library/user-event": "^13.5.0",
10+
"axios": "^1.12.1",
1011
"bcryptjs": "^3.0.2",
1112
"codemirror": "^5.65.16",
1213
"cookie-parser": "^1.4.7",
@@ -24,22 +25,22 @@
2425
"react-rnd": "^10.5.2",
2526
"react-router-dom": "^7.8.0",
2627
"react-scripts": "5.0.1",
28+
"react-toastify": "^11.0.5",
2729
"socket.io": "^4.8.1",
2830
"socket.io-client": "^4.8.1",
2931
"uuid": "^11.1.0",
3032
"web-vitals": "^2.1.4"
3133
},
3234
"scripts": {
33-
"start": "react-scripts start",
34-
"build": "react-scripts build",
35-
"server:js": "nodemon serverjs.js",
36-
"server:html": "nodemon serverhtml.js",
37-
"server:css": "nodemon servercss.js",
38-
"server:all": "concurrently \"npm run server:js\" \"npm run server:html\" \"npm run server:css\"",
39-
"test": "react-scripts test",
40-
"eject": "react-scripts eject"
41-
},
42-
35+
"start": "react-scripts start",
36+
"build": "react-scripts build",
37+
"server:js": "nodemon serverjs.js",
38+
"server:html": "nodemon serverhtml.js",
39+
"server:css": "nodemon servercss.js",
40+
"server:all": "concurrently \"npm run server:js\" \"npm run server:html\" \"npm run server:css\"",
41+
"test": "react-scripts test",
42+
"eject": "react-scripts eject"
43+
},
4344
"eslintConfig": {
4445
"extends": [
4546
"react-app",

‎run.bat‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
2-
pm2 start serverhtml.js --watch
3-
pm2 start servercss.js --watch
4-
pm2 start server.js --watch
1+
pm2 start backhand1/server.js --name backend1 --watch
2+
pm2 start backhand2/servercss.js --name backend2 --watch
3+
pm2 start backhand3/serverhtml.js --name backend3 --watch

‎src/App.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import { Toaster } from 'react-hot-toast';
66
import LandingPage from './pages/landingpage';
77
import Signlog from './pages/signlog';
88
import Signup from './pages/signup';
9+
import { ToastContainer } from 'react-toastify';
10+
11+
912

1013
function App() {
1114
return (
@@ -24,13 +27,17 @@ function App() {
2427

2528
</div>
2629
<BrowserRouter>
30+
31+
<ToastContainer />
2732
<Routes>
33+
2834
<Route path="/signup" element={<Signup/>}></Route>
2935
<Route path="/sigin" element={<Signlog/>}></Route>
3036
<Route path="/" element ={<LandingPage/>}></Route>
3137
<Route path="/home" element={<Home />} ></Route>
3238
<Route path="/editor/:roomId" element={<EditorPage />} ></Route>
3339
</Routes>
40+
3441
</BrowserRouter>
3542
</>
3643
);

‎src/pages/signlog.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useRef, useEffect } from "react";
1+
22
import { Navigate, useNavigate } from "react-router";
33

44
export default function Signlog() {

0 commit comments

Comments
 (0)