Skip to content

Commit 366f502

Browse files
committed
readme v3.1
1 parent cdb7cec commit 366f502

1 file changed

Lines changed: 46 additions & 13 deletions

File tree

README.md

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@ Are you tired of sending code snippets back and forth, struggling to debug and c
1616

1717
### Prerequisites
1818

19+
#### For running via Docker
20+
21+
- Docker (25.0.4)
22+
- Docker Compose (1.29.2)
23+
24+
#### For running locally
25+
1926
- Node.js (v20.11.1)
2027
- npm (10.2.4)
2128
- pm2 (5.3.1) : `npm i -g pm2`
2229

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.
2431

2532
## Tech Stack
2633

@@ -31,23 +38,48 @@ I have used nvm (v0.39.7) to manage my node versions. View nvm official [documen
3138
- CodeMirror
3239
- React-Toastify
3340

34-
## Run Locally
41+
## Installation
3542

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)
3744

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
4755

4856
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.
4957

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.
5183

5284
## Project Video
5385

@@ -63,6 +95,7 @@ In case you want to fix it yourself, feel free to make a pull request.
6395
3. [x] Added support for saving the last theme and language selected by the user in local storage
6496
4. [ ] Add support to accept or reject new users trying to join the room
6597
5. [ ] Add to implement video and voice chat feature inside the editor
98+
6. [ ] Add support for local code file uploading
6699

67100
## Open Source Contribution
68101

0 commit comments

Comments
 (0)