You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-13Lines changed: 46 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,18 @@ Are you tired of sending code snippets back and forth, struggling to debug and c
16
16
17
17
### Prerequisites
18
18
19
+
#### For running via Docker
20
+
21
+
- Docker (25.0.4)
22
+
- Docker Compose (1.29.2)
23
+
24
+
#### For running locally
25
+
19
26
- Node.js (v20.11.1)
20
27
- npm (10.2.4)
21
28
- pm2 (5.3.1) : `npm i -g pm2`
22
29
23
-
I have used nvm (v0.39.7) to manage my node versions. View nvm official [documentation](https://github.com/nvm-sh/nvm) to install it.
30
+
**Note:**I have used nvm (v0.39.7) to manage my node versions. View nvm official [documentation](https://github.com/nvm-sh/nvm) to install it.
24
31
25
32
## Tech Stack
26
33
@@ -31,23 +38,48 @@ I have used nvm (v0.39.7) to manage my node versions. View nvm official [documen
31
38
- CodeMirror
32
39
- React-Toastify
33
40
34
-
## Run Locally
41
+
## Installation
35
42
36
-
This project is not currently live on any server. But to use the demo version, follow the steps below:
43
+
### Running via Docker Image (highly recommended)
37
44
38
-
- Clone this repository and cd into it
39
-
- Run `npm install` to install the dependencies
40
-
- To start the react app client run `npm start` in one terminal
41
-
- To start the server run `npm server:dev` or `pm2 start server.js` in another terminal
42
-
- Go to `http://localhost:3000` to view the app
43
-
- Create a room by clicking on the `create new room` button and put a username of your choice
44
-
- Copy the room id by clicking on the `Copy ROOM ID` button
45
-
- To join as an another user open another browser/browser-window or an incognito tab and go to `http://localhost:3000`
46
-
- Enter the same room id to join the same room
45
+
To run the docker image, follow the steps below:
46
+
47
+
1. Install [Docker](https://www.docker.com/) on your machine.
48
+
2. Pull the docker image from the docker hub by running `docker pull mohitur/code-editor`
49
+
3. Run the docker image by running `docker run -p 8000:8000 -p 3000:3000 -p 5000:5000 mohitur/code-editor`
50
+
4. Go to `http://localhost:3000` to view the app
51
+
5. Create a room by clicking on the `create new room` button and put a username of your choice
52
+
5 . Copy the room id by clicking on the `Copy ROOM ID` button
53
+
6. To join as an another user open another browser/browser-window or an incognito tab and go to `http://localhost:3000`
54
+
7. Enter the same room id to join the same room
47
55
48
56
Now both your editor will be synced and you can see the changes in real time. Try opening the same room in multiple browsers/browsers-windows and see the changes.
49
57
50
-
**Note:** To stop your server (only if you used pm2) run `pm2 stop server.js` in the terminal
58
+
**Note:** If you are using docker in wsl2/linux then add `sudo` before the docker commands.
59
+
60
+
### Running via building your own Docker Image
61
+
62
+
To run the app using docker, follow the steps below:
63
+
64
+
1. Install [Docker](https://www.docker.com/) on your machine.
65
+
2. Clone the project repository and Navigate to the project directory.
66
+
3. Also you have to change ENV values in the Dockerfile
67
+
4. Replace your username in docker-compose.yml file.
68
+
5. Run the Docker Compose command: `docker-compose up -d`
69
+
6. Go to `http://localhost:3000` to view the app
70
+
7. Follow the steps 5-7 from the [Running via Docker Image](https://github.com/Mohitur669/Realtime-Collaborative-Code-Editor?tab=readme-ov-file#running-via-docker-image) section to create and join a room
71
+
72
+
### Running Locally
73
+
74
+
1. Clone this repository and cd into it
75
+
2. Run `npm install` to install the dependencies
76
+
3. Create .env file in the root folder and copy paste the content of example.env, and add necessary credentials.
77
+
4. To start the react app client run `npm start` in one terminal
78
+
5. To start the server run `npm server:dev` or `pm2 start server.js` in another terminal
79
+
6. Go to `http://localhost:3000` to view the app
80
+
7. Follow the steps 4-7 from the [Running via Docker Image](https://github.com/Mohitur669/Realtime-Collaborative-Code-Editor?tab=readme-ov-file#running-via-docker-image) section to create and join a room
81
+
82
+
**Note:** To stop your server, press `Ctrl+c` or if you used "pm2", then use `pm2 stop server.js` in the terminal.
51
83
52
84
## Project Video
53
85
@@ -63,6 +95,7 @@ In case you want to fix it yourself, feel free to make a pull request.
63
95
3.[x] Added support for saving the last theme and language selected by the user in local storage
64
96
4.[ ] Add support to accept or reject new users trying to join the room
65
97
5.[ ] Add to implement video and voice chat feature inside the editor
0 commit comments