├── frontend
├── src
│ ├── css
│ │ ├── App.css
│ │ ├── Video.css
│ │ ├── VideoBar.css
│ │ ├── ConfigBar.css
│ │ ├── Footer.css
│ │ ├── Editor.css
│ │ └── Header.css
│ ├── config
│ │ └── mappings.js
│ ├── index.js
│ └── components
│ │ ├── VideoBar.jsx
│ │ ├── Footer.jsx
│ │ ├── Video.jsx
│ │ ├── ConfigBar.jsx
│ │ ├── Header.jsx
│ │ ├── Editor.jsx
│ │ └── App.jsx
├── .gitignore
├── package.json
├── public
│ └── index.html
└── README.md
├── backend
├── Procfile
├── .gitignore
├── package.json
├── server.js
└── package-lock.json
├── readme_resource
├── github1.png
├── github2.png
└── githubLL.png
├── LICENSE
└── README.md
/frontend/src/css/App.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/Procfile:
--------------------------------------------------------------------------------
1 | web: npm start
--------------------------------------------------------------------------------
/readme_resource/github1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shreyshreyansh/Peer-Coder/HEAD/readme_resource/github1.png
--------------------------------------------------------------------------------
/readme_resource/github2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shreyshreyansh/Peer-Coder/HEAD/readme_resource/github2.png
--------------------------------------------------------------------------------
/readme_resource/githubLL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shreyshreyansh/Peer-Coder/HEAD/readme_resource/githubLL.png
--------------------------------------------------------------------------------
/frontend/src/config/mappings.js:
--------------------------------------------------------------------------------
1 | const languageToEditorMode = {
2 | c: "c_cpp",
3 | cpp: "c_cpp",
4 | python: "python",
5 | python3: "python",
6 | java: "java",
7 | };
8 |
9 | export { languageToEditorMode };
10 |
--------------------------------------------------------------------------------
/frontend/src/css/Video.css:
--------------------------------------------------------------------------------
1 | video {
2 | margin: 5px 0px 0px 5px;
3 | object-fit: cover;
4 | border: 2px solid rgb(251, 216, 127);
5 | border-radius: 7px;
6 | /* border-image: linear-gradient(45deg, rgb(124, 66, 218), rgb(233, 30, 99)) 1; */
7 | }
8 |
--------------------------------------------------------------------------------
/frontend/src/css/VideoBar.css:
--------------------------------------------------------------------------------
1 | div.scrollmenu {
2 | height: 127px;
3 | background-color: rgb(3, 37, 78);
4 | overflow: auto;
5 | white-space: nowrap;
6 | padding: 3px;
7 | }
8 | div.scrollmenu video {
9 | display: inline-block;
10 | }
11 |
--------------------------------------------------------------------------------
/backend/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/frontend/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/backend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "backend",
3 | "version": "1.0.0",
4 | "description": "Server",
5 | "main": "server.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "node server.js"
9 | },
10 | "author": "Shreyansh Shrey",
11 | "license": "ISC",
12 | "dependencies": {
13 | "cors": "^2.8.5",
14 | "express": "^4.17.1",
15 | "socket.io": "^4.1.2",
16 | "uuid": "^8.3.2"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/frontend/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./components/App";
4 | import {
5 | HashRouter as Router,
6 | Route,
7 | useParams,
8 | Redirect,
9 | } from "react-router-dom";
10 | const { v4: uuidV4 } = require("uuid");
11 | ReactDOM.render(
12 |
13 |
14 |
15 |
16 | } />
17 | ,
18 | document.getElementById("root")
19 | );
20 |
21 | function Room() {
22 | let { roomId } = useParams();
23 | return ;
24 | }
25 |
--------------------------------------------------------------------------------
/frontend/src/components/VideoBar.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import Video from "./Video";
3 | import "../css/VideoBar.css";
4 |
5 | class VideoBar extends Component {
6 | render() {
7 | return (
8 |
9 | {this.props.peersStream.map((peer) => {
10 | return (
11 |
18 | );
19 | })}
20 |
21 | );
22 | }
23 | }
24 | export default VideoBar;
25 |
--------------------------------------------------------------------------------
/frontend/src/components/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import "../css/Footer.css";
3 |
4 | class Footer extends Component {
5 | render() {
6 | return (
7 |
25 | );
26 | }
27 | }
28 | export default Footer;
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Shreyansh shrey
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/frontend/src/css/ConfigBar.css:
--------------------------------------------------------------------------------
1 | .ui {
2 | font-family: "Roboto", sans-serif;
3 | }
4 | .ui.selection.dropdown {
5 | color: rgb(251, 216, 127);
6 | background-color: rgb(3, 37, 78);
7 | }
8 | .ui.dropdown .menu > .item {
9 | background: rgb(3, 37, 78);
10 | color: rgb(251, 216, 127);
11 | border: none;
12 | z-index: 13;
13 | position: relative;
14 | }
15 | .ui.dropdown .menu > .item:hover {
16 | color: rgb(3, 37, 78);
17 | z-index: 13;
18 | background: rgb(251, 216, 127);
19 | }
20 | .ui.dropdown.selected,
21 | .ui.dropdown .menu .selected.item {
22 | color: rgb(251, 216, 127);
23 | z-index: 13;
24 | background: rgb(3, 21, 68);
25 | }
26 | .dropdown {
27 | margin: 10px;
28 | }
29 |
30 | .config-bar {
31 | background-color: rgb(1, 28, 39);
32 | padding: 0 5px 0 5px;
33 | }
34 |
35 | .run {
36 | float: right;
37 | margin-right: 10px;
38 | margin-top: 12px;
39 | width: 120px;
40 | font-family: "Roboto", sans-serif;
41 | font-size: 1.2rem;
42 | font-weight: 700px;
43 | }
44 | .run:hover {
45 | float: right;
46 | margin-right: 10px;
47 | width: 120px;
48 | font-family: "Roboto", sans-serif;
49 | font-size: 1rem;
50 | background-color: rgb(3, 37, 78);
51 | color: rgb(251, 216, 127);
52 | }
53 |
--------------------------------------------------------------------------------
/frontend/src/css/Footer.css:
--------------------------------------------------------------------------------
1 | .footer {
2 | position: fixed;
3 | left: 0;
4 | bottom: 0;
5 | width: 100%;
6 | height: 5%;
7 | background-color: rgb(1, 28, 39);
8 | color: white;
9 | z-index: 5;
10 | font-family: "Roboto", sans-serif;
11 | font-weight: 900;
12 | }
13 | .right-footer {
14 | float: right;
15 | margin-right: 150px;
16 | margin-top: 6.5px;
17 | background-color: rgb(251, 216, 127);
18 | color: rgb(1, 28, 39);
19 | padding: 2px 7px;
20 | border-radius: 15px;
21 | }
22 | .left-footer {
23 | display: inline-block;
24 | margin-left: 150px;
25 | margin-top: 6.5px;
26 | background-color: rgb(251, 216, 127);
27 | color: rgb(1, 28, 39);
28 | padding: 2px 7px;
29 | border-radius: 15px;
30 | text-decoration: none;
31 | }
32 |
33 | .left-footer:hover {
34 | display: inline-block;
35 | margin-left: 150px;
36 | margin-top: 6.5px;
37 | background-color: rgb(3, 37, 78);
38 | color: rgb(251, 216, 127);
39 | padding: 2px 7px;
40 | border-radius: 15px;
41 | text-decoration: none;
42 | }
43 |
44 | .right-footer:hover {
45 | display: inline-block;
46 | margin-left: 150px;
47 | margin-top: 6.5px;
48 | background-color: rgb(3, 37, 78);
49 | color: rgb(251, 216, 127);
50 | padding: 2px 7px;
51 | border-radius: 15px;
52 | text-decoration: none;
53 | }
54 |
--------------------------------------------------------------------------------
/frontend/src/components/Video.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from "prop-types";
2 | import React from "react";
3 | import "../css/Video.css";
4 |
5 | class Video extends React.Component {
6 | componentDidMount() {
7 | this.video.srcObject = this.props.media;
8 | }
9 |
10 | shouldComponentUpdate(props) {
11 | return this.props.media !== props.media;
12 | }
13 |
14 | componentDidUpdate() {
15 | this.video.srcObject = this.props.media;
16 | }
17 |
18 | render() {
19 | const { width, height, muted, children } = this.props;
20 |
21 | return (
22 |
33 | );
34 | }
35 | }
36 |
37 | Video.defaultProps = {
38 | children: null,
39 | height: 110,
40 | width: 160,
41 | muted: false,
42 | media: null,
43 | };
44 |
45 | Video.propTypes = {
46 | children: PropTypes.element,
47 | media: PropTypes.shape({
48 | active: PropTypes.bool,
49 | ended: PropTypes.bool,
50 | id: PropTypes.string,
51 | }),
52 | height: PropTypes.number,
53 | width: PropTypes.number,
54 | muted: PropTypes.bool,
55 | };
56 |
57 | export default Video;
58 |
--------------------------------------------------------------------------------
/frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "frontend",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.14.1",
7 | "@testing-library/react": "^11.2.7",
8 | "@testing-library/user-event": "^12.8.3",
9 | "ace-builds": "^1.4.12",
10 | "axios": "^0.21.1",
11 | "gh-pages": "^3.2.3",
12 | "peer": "^0.6.1",
13 | "peerjs": "^1.3.2",
14 | "react": "^17.0.2",
15 | "react-ace": "^9.4.1",
16 | "react-dom": "^17.0.2",
17 | "react-player": "^2.9.0",
18 | "react-router-dom": "^5.2.0",
19 | "react-scripts": "4.0.3",
20 | "react-split-pane": "^0.1.92",
21 | "semantic-ui-react": "^2.0.3",
22 | "socket.io-client": "^4.1.2",
23 | "uuid": "^8.3.2",
24 | "web-vitals": "^1.1.2"
25 | },
26 | "scripts": {
27 | "start": "react-scripts start",
28 | "build": "react-scripts build",
29 | "test": "react-scripts test",
30 | "eject": "react-scripts eject"
31 | },
32 | "eslintConfig": {
33 | "extends": [
34 | "react-app",
35 | "react-app/jest"
36 | ]
37 | },
38 | "browserslist": {
39 | "production": [
40 | ">0.2%",
41 | "not dead",
42 | "not op_mini all"
43 | ],
44 | "development": [
45 | "last 1 chrome version",
46 | "last 1 firefox version",
47 | "last 1 safari version"
48 | ]
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/frontend/src/components/ConfigBar.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { Dropdown } from "semantic-ui-react";
3 | import "../css/ConfigBar.css";
4 |
5 | class ConfigBar extends Component {
6 | render() {
7 | return (
8 |
9 |
this.props.handleOnChange(e, data)}
15 | defaultValue={this.props.themes[8].value}
16 | />
17 | this.props.handleOnChange(e, data)}
23 | value={this.props.mode}
24 | />
25 | this.props.handleOnChange(e, data)}
31 | defaultValue={this.props.fontSizes[4].value}
32 | />
33 |
36 |
37 | );
38 | }
39 | }
40 |
41 | export default ConfigBar;
42 |
--------------------------------------------------------------------------------
/frontend/src/css/Editor.css:
--------------------------------------------------------------------------------
1 | .Resizer {
2 | background: #000;
3 | opacity: 0.2;
4 | z-index: 1;
5 | -moz-box-sizing: border-box;
6 | -webkit-box-sizing: border-box;
7 | box-sizing: border-box;
8 | -moz-background-clip: padding;
9 | -webkit-background-clip: padding;
10 | background-clip: padding-box;
11 | }
12 |
13 | .Resizer:hover {
14 | -webkit-transition: all 2s ease;
15 | transition: all 2s ease;
16 | }
17 |
18 | .Resizer.horizontal {
19 | height: 11px;
20 | margin: -5px 0;
21 | border-top: 5px solid rgba(255, 255, 255, 0);
22 | border-bottom: 5px solid rgba(255, 255, 255, 0);
23 | cursor: row-resize;
24 | width: 100%;
25 | }
26 |
27 | .Resizer.horizontal:hover {
28 | border-top: 5px solid rgba(0, 0, 0, 0.5);
29 | border-bottom: 5px solid rgba(0, 0, 0, 0.5);
30 | }
31 |
32 | .Resizer.vertical {
33 | width: 11px;
34 | margin: 0 -5px;
35 | border-left: 5px solid rgba(255, 255, 255, 0);
36 | border-right: 5px solid rgba(255, 255, 255, 0);
37 | cursor: col-resize;
38 | }
39 |
40 | .Resizer.vertical:hover {
41 | border-left: 5px solid rgba(0, 0, 0, 0.5);
42 | border-right: 5px solid rgba(0, 0, 0, 0.5);
43 | }
44 | .Resizer.disabled {
45 | cursor: not-allowed;
46 | }
47 | .Resizer.disabled:hover {
48 | border-color: transparent;
49 | }
50 | .head {
51 | background-color: rgb(251, 216, 127);
52 | color: rgb(1, 28, 39);
53 | }
54 | .text {
55 | font-family: "Roboto", sans-serif;
56 | font-weight: 1000;
57 | margin-left: 15px;
58 | }
59 |
--------------------------------------------------------------------------------
/backend/server.js:
--------------------------------------------------------------------------------
1 | // https://peaceful-depths-33963.herokuapp.com/
2 | const app = require("express")();
3 | const http = require("http").Server(app);
4 | const PORT = process.env.PORT || 4000;
5 | const io = require("socket.io")(http, {
6 | cors: {
7 | origin: "*",
8 | methods: ["GET", "POST"],
9 | },
10 | });
11 | const cors = require("cors");
12 | app.use(
13 | cors({
14 | origin: "*",
15 | })
16 | );
17 |
18 | app.get("/", (req, res) => {
19 | res.send({ status: "running" });
20 | });
21 |
22 | io.on("connection", (socket) => {
23 | socket.on("join-room", (roomId, userId) => {
24 | socket.join(roomId);
25 | socket.broadcast.to(roomId).emit("user-connected", userId);
26 | socket.on("disconnect", () => {
27 | socket.broadcast.to(roomId).emit("user-disconnected", userId);
28 | });
29 | socket.on("code change", function (data) {
30 | socket.broadcast.to(roomId).emit("receive code", data);
31 | });
32 | socket.on("input change", function (data) {
33 | socket.broadcast.to(roomId).emit("receive input", data);
34 | });
35 | socket.on("output change", function (data) {
36 | socket.broadcast.to(roomId).emit("receive output", data);
37 | });
38 | socket.on("data-for-new-user", function (data) {
39 | socket.broadcast.to(roomId).emit("receive-data-for-new-user", data);
40 | });
41 | socket.on("mode-change-send", function (data) {
42 | socket.broadcast.to(roomId).emit("mode-change-receive", data);
43 | });
44 | });
45 | });
46 |
47 | http.listen(PORT, () => {
48 | console.log(`Server is running at port ${PORT}`);
49 | });
50 |
--------------------------------------------------------------------------------
/frontend/src/css/Header.css:
--------------------------------------------------------------------------------
1 | /* Style the header with a grey background and some padding */
2 | .header {
3 | overflow: hidden;
4 | background-color: rgb(1, 28, 39);
5 | text-decoration: none;
6 | padding: 9px;
7 | }
8 |
9 | .logo {
10 | text-decoration: none;
11 | color: rgb(251, 216, 127);
12 | font-family: "Roboto", sans-serif;
13 | font-size: 2rem;
14 | font-weight: 500;
15 | display: inline-block;
16 | margin-top: 7px;
17 | }
18 |
19 | .copy-url {
20 | float: right;
21 | margin-right: 10px;
22 | width: 120px;
23 | font-family: "Roboto", sans-serif;
24 | font-size: 1.2rem;
25 | font-weight: 700px;
26 | }
27 | .copy-url:hover {
28 | float: right;
29 | margin-right: 10px;
30 | width: 120px;
31 | font-family: "Roboto", sans-serif;
32 | font-size: 1rem;
33 | background-color: rgb(3, 37, 78);
34 | color: rgb(251, 216, 127);
35 | }
36 |
37 | button {
38 | justify-content: center;
39 | align-items: center;
40 | background-color: rgb(251, 216, 127);
41 | height: 35px;
42 | border-radius: 5px;
43 | color: rgb(3, 37, 78);
44 | font-size: 0.8rem;
45 | width: 35px;
46 | margin: 0 0.3rem;
47 | border: none;
48 | }
49 |
50 | .buttonOff {
51 | background-color: rgb(3, 37, 78);
52 | color: rgb(251, 216, 127);
53 | }
54 |
55 | /* Float the link section to the right */
56 | .header-right {
57 | float: right;
58 | }
59 |
60 | /* Add media queries for responsiveness - when the screen is 500px wide or less, stack the links on top of each other */
61 | @media screen and (max-width: 200px) {
62 | .header button {
63 | float: none;
64 | display: block;
65 | text-align: left;
66 | }
67 | .header-right {
68 | float: none;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/frontend/src/components/Header.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import "../css/Header.css";
3 |
4 | class Header extends Component {
5 | constructor(props) {
6 | super(props);
7 | this.state = {
8 | video: false,
9 | audio: false,
10 | };
11 | }
12 | toggleAudioCss() {
13 | let audio = this.state.audio;
14 | this.setState({ audio: !audio });
15 | }
16 | toggleVideoCss() {
17 | let video = this.state.video;
18 | this.setState({ video: !video });
19 | }
20 | handleClick() {
21 | window.prompt("ROOM URL", window.location.href);
22 | }
23 | render() {
24 | return (
25 |
26 |
27 | PEER CODER
28 |
29 |
32 |
33 |
46 |
59 |
60 |
61 | );
62 | }
63 | }
64 |
65 | export default Header;
66 |
--------------------------------------------------------------------------------
/frontend/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
16 |
17 |
18 |
19 |
23 |
27 | Peer Coder
28 |
29 |
53 |
54 |
55 |
56 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [PEER CODER](https://shreyshreyansh.github.io/Peer-Coder-Web/) ⭐
2 |
3 | [](https://reactjs.org/)
4 | [](https://shreyshreyansh.github.io/Peer-Coder-Web/)
5 | [](https://github.com/shreyshreyansh/Peer-Coder)
6 |
7 |
8 | ## Overview 👀
9 |
10 | 
11 | - **Real time code syncing among peers 👨💻**
12 | - **Executes code in Java, Python, C++, C 💻**
13 | - **Real time video and audio call 📹**
14 | - **Clean UI ⚡**
15 |
16 | ## What is Peer Coder? 🤔
17 |
18 | #### Remote pair programming is something developers have grappled with since well before the pandemic began.
19 | #### Peer Coder is ideal for Online Interviewing of Developers as well as Learning to code from Friends.
20 | #### An online code editor for interviews, troubleshooting, teaching & more…
21 |
22 | ## How it works? 🤔
23 | - **open the website [https://shreyshreyansh.github.io/Peer-Coder-Web/](https://shreyshreyansh.github.io/Peer-Coder-Web/)**
24 | - **Click Room url button and copy the url given in the prompt**
25 | - **Share that url with your peers and enjoy coding**
26 |
27 | ## Dependencies 🗃
28 |
29 | - [React.js](https://reactjs.org/) - **Frontend Framework**
30 | - [Node.js](https://nodejs.org/en/) - **Backend Framework**
31 | - [Socket.io](https://socket.io/) - **Client-Server Communication**
32 | - [Peer.js](https://peerjs.com/) - **Client-Client Communication**
33 | - [Ace editor](https://www.npmjs.com/package/react-ace) - **Code Editor**
34 |
35 | ## Run Locally 💻
36 |
37 | ```
38 | > Clone the repo
39 | >> For Windows: Git Bash
40 | >> For Linux: Terminal
41 | >> git clone https://github.com/shreyshreyansh/Peer-Coder.git
42 | >> cd Peer-Coder
43 | > Install all dependencies
44 | >> npm i
45 | > Spin the server on port 4000
46 | >> cd backend
47 | >> npm start
48 | > Spin the react on port 3000
49 | >> cd frontend
50 | >> npm start
51 | > Visit the website on http://localhost:3000/
52 |
53 | ```
54 |
--------------------------------------------------------------------------------
/frontend/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39 |
40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/frontend/src/components/Editor.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ConfigBar from "./ConfigBar";
3 | import AceEditor from "react-ace";
4 | import SplitPane from "react-split-pane";
5 | import { languageToEditorMode } from "../config/mappings";
6 | import "ace-builds/webpack-resolver";
7 |
8 | import "ace-builds/src-noconflict/ext-language_tools";
9 |
10 | import "ace-builds/src-noconflict/mode-java";
11 | import "ace-builds/src-noconflict/mode-c_cpp";
12 | import "ace-builds/src-noconflict/mode-python";
13 | import "ace-builds/src-noconflict/mode-javascript";
14 | import "ace-builds/src-noconflict/mode-rust";
15 | import "ace-builds/src-noconflict/mode-kotlin";
16 |
17 | import "ace-builds/src-noconflict/theme-github";
18 | import "ace-builds/src-noconflict/theme-solarized_dark";
19 | import "ace-builds/src-noconflict/theme-dracula";
20 | import "ace-builds/src-noconflict/theme-monokai";
21 | import "ace-builds/src-noconflict/theme-eclipse";
22 | import "ace-builds/src-noconflict/theme-tomorrow_night";
23 | import "ace-builds/src-noconflict/theme-tomorrow_night_blue";
24 | import "ace-builds/src-noconflict/theme-xcode";
25 | import "ace-builds/src-noconflict/theme-ambiance";
26 | import "ace-builds/src-noconflict/theme-solarized_light";
27 |
28 | import "../css/Editor.css";
29 |
30 | const languages = Object.keys(languageToEditorMode);
31 | const fontSizes = [
32 | "8",
33 | "10",
34 | "12",
35 | "14",
36 | "16",
37 | "18",
38 | "20",
39 | "22",
40 | "24",
41 | "26",
42 | "28",
43 | "30",
44 | "32",
45 | ];
46 | const themes = [
47 | "monokai",
48 | "github",
49 | "solarized_dark",
50 | "dracula",
51 | "eclipse",
52 | "tomorrow_night",
53 | "tomorrow_night_blue",
54 | "xcode",
55 | "ambiance",
56 | "solarized_light",
57 | ].sort();
58 | var lang;
59 | var font;
60 | var theme;
61 |
62 | class Editor extends Component {
63 | constructor(props) {
64 | super(props);
65 | this.state = {
66 | theme: "tomorrow_night_blue",
67 | fontSize: 16,
68 | };
69 | let i = 0;
70 | lang = languages.map((language) => {
71 | i++;
72 | return { key: "" + i, text: language, value: language };
73 | });
74 | let j = 0;
75 | font = fontSizes.map((fontSize) => {
76 | j++;
77 | return { key: "" + j, text: fontSize, value: fontSize };
78 | });
79 | let k = 0;
80 | theme = themes.map((theme) => {
81 | k++;
82 | return { key: "" + k, text: theme, value: theme };
83 | });
84 | this.handleOnChange = this.handleOnChange.bind(this);
85 | }
86 | handleOnChange(e, data) {
87 | if (data.placeholder === "Theme") {
88 | this.setState({ theme: data.value });
89 | } else if (data.placeholder === "Font Size") {
90 | this.setState({ fontSize: parseInt(data.value) });
91 | } else if (data.placeholder === "Language") {
92 | this.props.onChangeMode(data.value);
93 | }
94 | }
95 | render() {
96 | return (
97 |
98 | this.props.handleRunClick()}
106 | />
107 |
114 |
115 |
118 |
this.props.onChangeCode(data)}
124 | width={"100vw"}
125 | height={"61.4vh"}
126 | showGutter={true}
127 | useWorker={false}
128 | editorProps={{ $blockScrolling: false }}
129 | setOptions={{
130 | enableLiveAutocompletion: true,
131 | enableSnippets: true,
132 | }}
133 | />
134 |
135 |
136 |
137 |
140 |
this.props.onChangeInput(data)}
146 | width={"100vw"}
147 | height={"28vh"}
148 | showGutter={true}
149 | useWorker={false}
150 | editorProps={{ $blockScrolling: false }}
151 | setOptions={{
152 | enableLiveAutocompletion: true,
153 | enableSnippets: true,
154 | }}
155 | />
156 |
157 |
158 |
161 |
this.props.onChangeOutput(data)}
167 | width={"100vw"}
168 | height={"32vh"}
169 | readOnly={true}
170 | showGutter={true}
171 | useWorker={false}
172 | editorProps={{ $blockScrolling: false }}
173 | setOptions={{
174 | enableLiveAutocompletion: true,
175 | enableSnippets: true,
176 | }}
177 | />
178 |
179 |
180 |
181 |
182 | );
183 | }
184 | }
185 |
186 | export default Editor;
187 |
--------------------------------------------------------------------------------
/frontend/src/components/App.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import Header from "./Header";
3 | import VideoBar from "./VideoBar";
4 | import Editor from "./Editor";
5 | import Footer from "./Footer";
6 | import io from "socket.io-client";
7 | import Peer from "peerjs";
8 | import axios from "axios";
9 | import "../css/App.css";
10 | const myPeer = new Peer();
11 | // https://peaceful-depths-33963.herokuapp.com/
12 | // http://localhost:4000
13 | const socket = io("http://localhost:4000");
14 | const peers = {};
15 |
16 | class App extends Component {
17 | constructor(props) {
18 | super(props);
19 | this.state = {
20 | userId: "",
21 | stream: {},
22 | peers: [],
23 | mode: "java",
24 | code: "",
25 | input: "",
26 | output: "",
27 | status: "RUN",
28 | };
29 | this.handleVideoToggle = this.handleVideoToggle.bind(this);
30 | this.handleAudioToggle = this.handleAudioToggle.bind(this);
31 | this.handleChangeCode = this.handleChangeCode.bind(this);
32 | this.handleChangeInput = this.handleChangeInput.bind(this);
33 | this.handleChangeOutput = this.handleChangeOutput.bind(this);
34 | this.handleRunClick = this.handleRunClick.bind(this);
35 | this.handleChangeMode = this.handleChangeMode.bind(this);
36 | }
37 | componentDidMount() {
38 | myPeer.on("open", (id) => {
39 | navigator.mediaDevices
40 | .getUserMedia({
41 | video: true,
42 | audio: true,
43 | })
44 | .then((stream) => {
45 | this.addUserIdAndStream(id, stream);
46 | this.addVideoStream(id, stream, false);
47 | socket.on("user-connected", (userId) => {
48 | this.connectToNewUser(userId, stream);
49 | this.sendDatatoNewUser();
50 | });
51 | myPeer.on("call", (call) => {
52 | call.answer(stream);
53 | call.on("stream", (userVideoStream) => {
54 | this.addVideoStream(call.peer, userVideoStream, false);
55 | });
56 | call.on("close", () => {
57 | const peers = this.state.peers;
58 | var peersModified = peers.filter((peer) => {
59 | return peer.userId !== call.peer;
60 | });
61 | this.setState({ peers: peersModified });
62 | });
63 | peers[call.peer] = call;
64 | });
65 | socket.emit("join-room", this.props.roomId, id);
66 | socket.on("receive code", (payload) => {
67 | this.updateCodeFromSockets(payload);
68 | });
69 | socket.on("receive input", (payload) => {
70 | this.updateInputFromSockets(payload);
71 | });
72 | socket.on("receive output", (payload) => {
73 | this.updateOutputFromSockets(payload);
74 | });
75 | socket.on("receive-data-for-new-user", (payload) => {
76 | this.updateStateFromSockets(payload);
77 | });
78 | socket.on("mode-change-receive", (payload) => {
79 | this.updateModeFromSockets(payload);
80 | });
81 | });
82 | });
83 | socket.on("user-disconnected", (userId) => {
84 | if (peers[userId]) peers[userId].close();
85 | });
86 | }
87 | sendDatatoNewUser() {
88 | socket.emit("data-for-new-user", {
89 | newCode: this.state.code,
90 | newInput: this.state.input,
91 | newOutput: this.state.output,
92 | newMode: this.state.mode,
93 | });
94 | }
95 | updateStateFromSockets(payload) {
96 | this.setState({ code: payload.newCode });
97 | this.setState({ input: payload.newInput });
98 | this.setState({ output: payload.newOutput });
99 | this.setState({ mode: payload.newMode });
100 | }
101 | updateCodeFromSockets(payload) {
102 | this.setState({ code: payload.newCode });
103 | }
104 | updateInputFromSockets(payload) {
105 | this.setState({ input: payload.newInput });
106 | }
107 | updateOutputFromSockets(payload) {
108 | this.setState({ output: payload.newOutput });
109 | }
110 | updateModeFromSockets(payload) {
111 | this.setState({ mode: payload.mode });
112 | }
113 | connectToNewUser(userId, stream) {
114 | const call = myPeer.call(userId, stream);
115 | call.on("stream", (userVideoStream) => {
116 | this.addVideoStream(userId, userVideoStream, false);
117 | });
118 | call.on("close", () => {
119 | const peers = this.state.peers;
120 | var peersModified = peers.filter((peer) => {
121 | return peer.userId !== userId;
122 | });
123 | this.setState({ peers: peersModified });
124 | });
125 | peers[userId] = call;
126 | }
127 |
128 | addVideoStream(userId, stream, flag) {
129 | if (userId === this.state.userId) {
130 | stream.getVideoTracks()[0].enabled = false;
131 | stream.getAudioTracks()[0].enabled = false;
132 | }
133 | const peers = this.state.peers;
134 | peers.forEach((peer) => {
135 | if (peer.userId === userId) {
136 | peer.stream = stream;
137 | flag = true;
138 | }
139 | });
140 | if (!flag) peers.push({ userId: userId, stream: stream });
141 | this.setState({ peers: peers });
142 | }
143 |
144 | addUserIdAndStream(userId, stream) {
145 | this.setState({ userId: userId, stream: stream });
146 | }
147 |
148 | handleVideoToggle(userId) {
149 | this.state.peers.forEach((peer) => {
150 | if (peer.userId === userId) {
151 | const enabled = peer.stream.getVideoTracks()[0].enabled;
152 | peer.stream.getVideoTracks()[0].enabled = !enabled;
153 | }
154 | });
155 | }
156 |
157 | handleAudioToggle(userId) {
158 | this.state.peers.forEach((peer) => {
159 | if (peer.userId === userId) {
160 | const enabled = peer.stream.getAudioTracks()[0].enabled;
161 | peer.stream.getAudioTracks()[0].enabled = !enabled;
162 | }
163 | });
164 | }
165 | handleChangeCode(newCode) {
166 | this.setState({ code: newCode });
167 | socket.emit("code change", {
168 | newCode: newCode,
169 | });
170 | }
171 | handleChangeInput(newInput) {
172 | this.setState({ input: newInput });
173 | socket.emit("input change", {
174 | newInput: newInput,
175 | });
176 | }
177 | handleChangeOutput(newOutput) {
178 | this.setState({ output: newOutput });
179 | socket.emit("output change", {
180 | newOutput: newOutput,
181 | });
182 | }
183 | handleRunClick() {
184 | this.setState({
185 | status: `RUNNING `,
186 | });
187 | const params = {
188 | source_code: this.state.code,
189 | language: this.state.mode,
190 | input: this.state.input,
191 | api_key: "guest",
192 | };
193 | axios.post(`https://api.paiza.io/runners/create`, params).then((res) => {
194 | const query = new URLSearchParams({
195 | id: res.data.id,
196 | api_key: "guest",
197 | });
198 | var callback = (res, error) => {
199 | this.setState({ status: "RUN" });
200 | // consume data
201 | if (error) {
202 | console.error(error);
203 | return;
204 | }
205 | let output = "";
206 | if (res.data.stdout) output += res.data.stdout;
207 | if (res.data.stderr) output += res.data.stderr;
208 | if (res.data.build_stderr) output += res.data.build_stderr;
209 | this.handleChangeOutput(output);
210 | };
211 |
212 | request(10, callback);
213 | function request(retries, callback) {
214 | axios
215 | .get(`https://api.paiza.io/runners/get_details?${query.toString()}`)
216 | .then((response) => {
217 | // request successful
218 |
219 | if (response.data.status === "completed") {
220 | // server done, deliver data to script to consume
221 | callback(response);
222 | } else {
223 | if (retries > 0) {
224 | request(--retries, callback);
225 | } else {
226 | // no retries left, calling callback with error
227 | callback([], "out of retries");
228 | }
229 | }
230 | })
231 | .catch((error) => {
232 | // ajax error occurred
233 | // would be better to not retry on 404, 500 and other unrecoverable HTTP errors
234 | // retry, if any retries left
235 | if (retries > 0) {
236 | request(--retries, callback);
237 | } else {
238 | // no retries left, calling callback with error
239 | callback([], error);
240 | }
241 | });
242 | }
243 | });
244 | }
245 | handleChangeMode(mode) {
246 | this.setState({ mode: mode });
247 | socket.emit("mode-change-send", { mode: mode });
248 | }
249 |
250 | render() {
251 | return (
252 |
253 |
259 |
260 |
272 |
273 |
274 | );
275 | }
276 | }
277 | export default App;
278 |
--------------------------------------------------------------------------------
/backend/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "backend",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@types/component-emitter": {
8 | "version": "1.2.10",
9 | "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz",
10 | "integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg=="
11 | },
12 | "@types/cookie": {
13 | "version": "0.4.0",
14 | "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.0.tgz",
15 | "integrity": "sha512-y7mImlc/rNkvCRmg8gC3/lj87S7pTUIJ6QGjwHR9WQJcFs+ZMTOaoPrkdFA/YdbuqVEmEbb5RdhVxMkAcgOnpg=="
16 | },
17 | "@types/cors": {
18 | "version": "2.8.10",
19 | "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.10.tgz",
20 | "integrity": "sha512-C7srjHiVG3Ey1nR6d511dtDkCEjxuN9W1HWAEjGq8kpcwmNM6JJkpC0xvabM7BXTG2wDq8Eu33iH9aQKa7IvLQ=="
21 | },
22 | "@types/node": {
23 | "version": "15.12.4",
24 | "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.4.tgz",
25 | "integrity": "sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA=="
26 | },
27 | "accepts": {
28 | "version": "1.3.7",
29 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
30 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
31 | "requires": {
32 | "mime-types": "~2.1.24",
33 | "negotiator": "0.6.2"
34 | }
35 | },
36 | "array-flatten": {
37 | "version": "1.1.1",
38 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
39 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
40 | },
41 | "base64-arraybuffer": {
42 | "version": "0.1.4",
43 | "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz",
44 | "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI="
45 | },
46 | "base64id": {
47 | "version": "2.0.0",
48 | "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
49 | "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog=="
50 | },
51 | "body-parser": {
52 | "version": "1.19.0",
53 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
54 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
55 | "requires": {
56 | "bytes": "3.1.0",
57 | "content-type": "~1.0.4",
58 | "debug": "2.6.9",
59 | "depd": "~1.1.2",
60 | "http-errors": "1.7.2",
61 | "iconv-lite": "0.4.24",
62 | "on-finished": "~2.3.0",
63 | "qs": "6.7.0",
64 | "raw-body": "2.4.0",
65 | "type-is": "~1.6.17"
66 | }
67 | },
68 | "bytes": {
69 | "version": "3.1.0",
70 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
71 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
72 | },
73 | "component-emitter": {
74 | "version": "1.3.0",
75 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
76 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
77 | },
78 | "content-disposition": {
79 | "version": "0.5.3",
80 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
81 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
82 | "requires": {
83 | "safe-buffer": "5.1.2"
84 | }
85 | },
86 | "content-type": {
87 | "version": "1.0.4",
88 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
89 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
90 | },
91 | "cookie": {
92 | "version": "0.4.0",
93 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
94 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
95 | },
96 | "cookie-signature": {
97 | "version": "1.0.6",
98 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
99 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
100 | },
101 | "cors": {
102 | "version": "2.8.5",
103 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
104 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
105 | "requires": {
106 | "object-assign": "^4",
107 | "vary": "^1"
108 | }
109 | },
110 | "debug": {
111 | "version": "2.6.9",
112 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
113 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
114 | "requires": {
115 | "ms": "2.0.0"
116 | }
117 | },
118 | "depd": {
119 | "version": "1.1.2",
120 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
121 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
122 | },
123 | "destroy": {
124 | "version": "1.0.4",
125 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
126 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
127 | },
128 | "ee-first": {
129 | "version": "1.1.1",
130 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
131 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
132 | },
133 | "encodeurl": {
134 | "version": "1.0.2",
135 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
136 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
137 | },
138 | "engine.io": {
139 | "version": "5.1.1",
140 | "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-5.1.1.tgz",
141 | "integrity": "sha512-aMWot7H5aC8L4/T8qMYbLdvKlZOdJTH54FxfdFunTGvhMx1BHkJOntWArsVfgAZVwAO9LC2sryPWRcEeUzCe5w==",
142 | "requires": {
143 | "accepts": "~1.3.4",
144 | "base64id": "2.0.0",
145 | "cookie": "~0.4.1",
146 | "cors": "~2.8.5",
147 | "debug": "~4.3.1",
148 | "engine.io-parser": "~4.0.0",
149 | "ws": "~7.4.2"
150 | },
151 | "dependencies": {
152 | "cookie": {
153 | "version": "0.4.1",
154 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
155 | "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
156 | },
157 | "debug": {
158 | "version": "4.3.1",
159 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
160 | "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
161 | "requires": {
162 | "ms": "2.1.2"
163 | }
164 | },
165 | "ms": {
166 | "version": "2.1.2",
167 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
168 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
169 | }
170 | }
171 | },
172 | "engine.io-parser": {
173 | "version": "4.0.2",
174 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.2.tgz",
175 | "integrity": "sha512-sHfEQv6nmtJrq6TKuIz5kyEKH/qSdK56H/A+7DnAuUPWosnIZAS2NHNcPLmyjtY3cGS/MqJdZbUjW97JU72iYg==",
176 | "requires": {
177 | "base64-arraybuffer": "0.1.4"
178 | }
179 | },
180 | "escape-html": {
181 | "version": "1.0.3",
182 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
183 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
184 | },
185 | "etag": {
186 | "version": "1.8.1",
187 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
188 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
189 | },
190 | "express": {
191 | "version": "4.17.1",
192 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
193 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
194 | "requires": {
195 | "accepts": "~1.3.7",
196 | "array-flatten": "1.1.1",
197 | "body-parser": "1.19.0",
198 | "content-disposition": "0.5.3",
199 | "content-type": "~1.0.4",
200 | "cookie": "0.4.0",
201 | "cookie-signature": "1.0.6",
202 | "debug": "2.6.9",
203 | "depd": "~1.1.2",
204 | "encodeurl": "~1.0.2",
205 | "escape-html": "~1.0.3",
206 | "etag": "~1.8.1",
207 | "finalhandler": "~1.1.2",
208 | "fresh": "0.5.2",
209 | "merge-descriptors": "1.0.1",
210 | "methods": "~1.1.2",
211 | "on-finished": "~2.3.0",
212 | "parseurl": "~1.3.3",
213 | "path-to-regexp": "0.1.7",
214 | "proxy-addr": "~2.0.5",
215 | "qs": "6.7.0",
216 | "range-parser": "~1.2.1",
217 | "safe-buffer": "5.1.2",
218 | "send": "0.17.1",
219 | "serve-static": "1.14.1",
220 | "setprototypeof": "1.1.1",
221 | "statuses": "~1.5.0",
222 | "type-is": "~1.6.18",
223 | "utils-merge": "1.0.1",
224 | "vary": "~1.1.2"
225 | }
226 | },
227 | "finalhandler": {
228 | "version": "1.1.2",
229 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
230 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
231 | "requires": {
232 | "debug": "2.6.9",
233 | "encodeurl": "~1.0.2",
234 | "escape-html": "~1.0.3",
235 | "on-finished": "~2.3.0",
236 | "parseurl": "~1.3.3",
237 | "statuses": "~1.5.0",
238 | "unpipe": "~1.0.0"
239 | }
240 | },
241 | "forwarded": {
242 | "version": "0.2.0",
243 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
244 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
245 | },
246 | "fresh": {
247 | "version": "0.5.2",
248 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
249 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
250 | },
251 | "http-errors": {
252 | "version": "1.7.2",
253 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
254 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
255 | "requires": {
256 | "depd": "~1.1.2",
257 | "inherits": "2.0.3",
258 | "setprototypeof": "1.1.1",
259 | "statuses": ">= 1.5.0 < 2",
260 | "toidentifier": "1.0.0"
261 | }
262 | },
263 | "iconv-lite": {
264 | "version": "0.4.24",
265 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
266 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
267 | "requires": {
268 | "safer-buffer": ">= 2.1.2 < 3"
269 | }
270 | },
271 | "inherits": {
272 | "version": "2.0.3",
273 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
274 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
275 | },
276 | "ipaddr.js": {
277 | "version": "1.9.1",
278 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
279 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
280 | },
281 | "media-typer": {
282 | "version": "0.3.0",
283 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
284 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
285 | },
286 | "merge-descriptors": {
287 | "version": "1.0.1",
288 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
289 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
290 | },
291 | "methods": {
292 | "version": "1.1.2",
293 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
294 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
295 | },
296 | "mime": {
297 | "version": "1.6.0",
298 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
299 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
300 | },
301 | "mime-db": {
302 | "version": "1.48.0",
303 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz",
304 | "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ=="
305 | },
306 | "mime-types": {
307 | "version": "2.1.31",
308 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz",
309 | "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==",
310 | "requires": {
311 | "mime-db": "1.48.0"
312 | }
313 | },
314 | "ms": {
315 | "version": "2.0.0",
316 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
317 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
318 | },
319 | "negotiator": {
320 | "version": "0.6.2",
321 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
322 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
323 | },
324 | "object-assign": {
325 | "version": "4.1.1",
326 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
327 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
328 | },
329 | "on-finished": {
330 | "version": "2.3.0",
331 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
332 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
333 | "requires": {
334 | "ee-first": "1.1.1"
335 | }
336 | },
337 | "parseurl": {
338 | "version": "1.3.3",
339 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
340 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
341 | },
342 | "path-to-regexp": {
343 | "version": "0.1.7",
344 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
345 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
346 | },
347 | "proxy-addr": {
348 | "version": "2.0.7",
349 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
350 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
351 | "requires": {
352 | "forwarded": "0.2.0",
353 | "ipaddr.js": "1.9.1"
354 | }
355 | },
356 | "qs": {
357 | "version": "6.7.0",
358 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
359 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
360 | },
361 | "range-parser": {
362 | "version": "1.2.1",
363 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
364 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
365 | },
366 | "raw-body": {
367 | "version": "2.4.0",
368 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
369 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
370 | "requires": {
371 | "bytes": "3.1.0",
372 | "http-errors": "1.7.2",
373 | "iconv-lite": "0.4.24",
374 | "unpipe": "1.0.0"
375 | }
376 | },
377 | "safe-buffer": {
378 | "version": "5.1.2",
379 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
380 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
381 | },
382 | "safer-buffer": {
383 | "version": "2.1.2",
384 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
385 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
386 | },
387 | "send": {
388 | "version": "0.17.1",
389 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
390 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
391 | "requires": {
392 | "debug": "2.6.9",
393 | "depd": "~1.1.2",
394 | "destroy": "~1.0.4",
395 | "encodeurl": "~1.0.2",
396 | "escape-html": "~1.0.3",
397 | "etag": "~1.8.1",
398 | "fresh": "0.5.2",
399 | "http-errors": "~1.7.2",
400 | "mime": "1.6.0",
401 | "ms": "2.1.1",
402 | "on-finished": "~2.3.0",
403 | "range-parser": "~1.2.1",
404 | "statuses": "~1.5.0"
405 | },
406 | "dependencies": {
407 | "ms": {
408 | "version": "2.1.1",
409 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
410 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
411 | }
412 | }
413 | },
414 | "serve-static": {
415 | "version": "1.14.1",
416 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
417 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
418 | "requires": {
419 | "encodeurl": "~1.0.2",
420 | "escape-html": "~1.0.3",
421 | "parseurl": "~1.3.3",
422 | "send": "0.17.1"
423 | }
424 | },
425 | "setprototypeof": {
426 | "version": "1.1.1",
427 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
428 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
429 | },
430 | "socket.io": {
431 | "version": "4.1.2",
432 | "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.1.2.tgz",
433 | "integrity": "sha512-xK0SD1C7hFrh9+bYoYCdVt+ncixkSLKtNLCax5aEy1o3r5PaO5yQhVb97exIe67cE7lAK+EpyMytXWTWmyZY8w==",
434 | "requires": {
435 | "@types/cookie": "^0.4.0",
436 | "@types/cors": "^2.8.8",
437 | "@types/node": ">=10.0.0",
438 | "accepts": "~1.3.4",
439 | "base64id": "~2.0.0",
440 | "debug": "~4.3.1",
441 | "engine.io": "~5.1.0",
442 | "socket.io-adapter": "~2.3.0",
443 | "socket.io-parser": "~4.0.3"
444 | },
445 | "dependencies": {
446 | "debug": {
447 | "version": "4.3.1",
448 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
449 | "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
450 | "requires": {
451 | "ms": "2.1.2"
452 | }
453 | },
454 | "ms": {
455 | "version": "2.1.2",
456 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
457 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
458 | }
459 | }
460 | },
461 | "socket.io-adapter": {
462 | "version": "2.3.1",
463 | "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.1.tgz",
464 | "integrity": "sha512-8cVkRxI8Nt2wadkY6u60Y4rpW3ejA1rxgcK2JuyIhmF+RMNpTy1QRtkHIDUOf3B4HlQwakMsWbKftMv/71VMmw=="
465 | },
466 | "socket.io-parser": {
467 | "version": "4.0.4",
468 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz",
469 | "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==",
470 | "requires": {
471 | "@types/component-emitter": "^1.2.10",
472 | "component-emitter": "~1.3.0",
473 | "debug": "~4.3.1"
474 | },
475 | "dependencies": {
476 | "debug": {
477 | "version": "4.3.1",
478 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
479 | "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
480 | "requires": {
481 | "ms": "2.1.2"
482 | }
483 | },
484 | "ms": {
485 | "version": "2.1.2",
486 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
487 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
488 | }
489 | }
490 | },
491 | "statuses": {
492 | "version": "1.5.0",
493 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
494 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
495 | },
496 | "toidentifier": {
497 | "version": "1.0.0",
498 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
499 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
500 | },
501 | "type-is": {
502 | "version": "1.6.18",
503 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
504 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
505 | "requires": {
506 | "media-typer": "0.3.0",
507 | "mime-types": "~2.1.24"
508 | }
509 | },
510 | "unpipe": {
511 | "version": "1.0.0",
512 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
513 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
514 | },
515 | "utils-merge": {
516 | "version": "1.0.1",
517 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
518 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
519 | },
520 | "uuid": {
521 | "version": "8.3.2",
522 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
523 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
524 | },
525 | "vary": {
526 | "version": "1.1.2",
527 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
528 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
529 | },
530 | "ws": {
531 | "version": "7.4.6",
532 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
533 | "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A=="
534 | }
535 | }
536 | }
537 |
--------------------------------------------------------------------------------