Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Backend/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion Frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<body style="background-color: #1c1e29;">
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
Expand Down
34,382 changes: 29,400 additions & 4,982 deletions Frontend/package-lock.json

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"bootstrap": "^5.3.1",
"codemirror": "^5.65.15",
"react-avatar": "^5.0.3",
"react-hot-toast": "^2.4.1",
"react-router-dom": "^6.15.0",
"react-scripts": "5.0.1",
"socket.io-client": "^4.7.2",
"uuid": "^9.0.0",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand All @@ -23,4 +32,4 @@
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.0"
}
}
}
Binary file added Frontend/public/image/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 0 additions & 42 deletions Frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,42 +0,0 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
31 changes: 7 additions & 24 deletions Frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'

import {Routes,Route} from 'react-router-dom'
import Home from './components/Room/Home'
import Editor from './components/Room/Editor'
function App() {
const [count, setCount] = useState(0)

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.jsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
<Routes>
<Route path='/' element={<Home/>} />
<Route path='/editor' element={<Editor/>}/>
</Routes>
</>
)
}
Expand Down
13 changes: 13 additions & 0 deletions Frontend/src/components/Room/Client.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import Avatar from 'react-avatar'
const Client = ({username}) => {
return (
<div className="d-flex align-items-center mb-3">
<Avatar name={username.toString()} size={50} round="14px" className='mr-3'
/>
<span className='mx-2'>{username.toString()}</span>
</div>
)
}

export default Client
39 changes: 39 additions & 0 deletions Frontend/src/components/Room/Editor.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { useState } from 'react';
import logo from '../../../public/image/logo.jpg';
import Client from './Client';

const Editor = () => {
const [clients, setClient] = useState([
{ socketId: 1, username: "Gaurav" },
{ socketId: 2, username: "Akhil" } // Changed socketId to be unique
]);

return (
<div className='container-fluid vh-100'>
<div className="row h-100">
<div className="col-md-2 bg-dark text-light d-flex flex-column h-100" style={{ boxShadow: "2px 0px 4px rgba(0,0,0,0.1)" }}>
<img src={logo} alt="logo" className='img-fluid mx-auto' style={{ maxWidth: '150px', marginTop: '30px' }} />
<hr style={{ marginTop: '25px' }} />
{/* client list container */}
<div className="d-flex flex-column overflow-auto">
{clients.map((client) => (
<Client key={client.socketId} username={client.username} />
))}
</div>
<div className="mt-auto">
<hr />
<button className='btn btn-success mb-3' style={{ marginLeft: "50px" }}>
Copy Room Id
</button>
<button className='btn btn-danger mb-5 px-3 btn-block' style={{ marginLeft: "50px" }}>
Leave Room
</button>
</div>
</div>
{/* editor second page */}
</div>
</div>
);
}

export default Editor;
40 changes: 40 additions & 0 deletions Frontend/src/components/Room/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react'
import logo from '../../../public/image/logo.jpg'
const Home = () => {
return (
<div className='container-fluid'>
<div className="row justify-content-center align-items-center min-vh-100">
<div className="col-12 col-md-6">
<div className="card shadow-sm p-2 mb-5 bg-secondry rounded">
<div className='card-body text-center bg-dark'>
<img className="img-fluid mx-auto d-block" src={logo} alt="logo" style={{maxWidth:"150px"}}/>
<h4 className='text-light' style={{marginTop:"20px"}}>Enter the Room Id</h4>
<div className="form-group" style={{marginTop : "20px"}}>
<input type="text"
className="form-control mb-2"
placeholder="Room Id"
/>

</div>

<div className="form-group" style={{marginTop : "5px"}}>
<input type="text"
className="form-control mb-2"
placeholder="Username"
/>

</div>

<button className='btn btn-lg btn-block' style={{color:'white', background:"orange"}}>JOIN</button>
<p className='mt-3 text-light'>
Don't have a room Id?{" "}
<span className='text-success p-2' style={{cursor:"pointer"}}>New Room</span></p>
</div>
</div>
</div>
</div>
</div>
)
}

export default Home
1 change: 0 additions & 1 deletion Frontend/src/components/demo.jsx

This file was deleted.

10 changes: 5 additions & 5 deletions Frontend/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'

import { BrowserRouter as Router } from "react-router-dom";
import 'bootstrap/dist/css/bootstrap.min.css'
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
<Router>
<App/>
</Router>
)