A simple chat room application using React, TypeScript, JavaScript, MongoDB, and Docker+Docker Compose.
- After cloning, run
npm installinserverandclientfolder before starting application - To see 2+ users having a conversation, open a web browser window for each user that wants to chat and go to http://localhost:3000 in each window to send chats in real time
- Open Docker Desktop
- Navigate to project directory called
my-app
cd path/to/project/directory- Build Docker
docker-compose build- Start container
docker-compose up- Open a web browser and go to
http://localhost:3000
- Navigate to project directory called
my-app
cd path/to/project/directory- Navigate to server directory
cd server- Start server
npm start- Sample terminal output after running command
> server@1.0.0 start
> nodemon index.js
[nodemon] 3.1.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node index.js`
Server is running on port 8000
Connected to MongoDB
- In another terminal tab, navigate to project directory and client directory
cd path/to/project/directory
cd client- Start client
npm run dev- Sample terminal output after running command
> my-app@0.1.0 dev
> next dev
▲ Next.js 14.2.5
- Local: http://localhost:3000
✓ Starting...
✓ Ready in 1463ms
- Open a web browser and go to
http://localhost:3000
- To view local database
chatentries Docker must be running
- Open terminal
- Locate container id of port 27017
docker ps- Access database
docker exec -it [CONTAINER-ID] mongosh- Switch to
chatdatabase
use chat- View
userscollection
db.users.find().pretty()- View
messagescollection
db.messages.find().pretty()- Refreshing chat pages will close/hinder the connection
- Can see the updated/correct amount of upvotes/downvotes when user logs back in
- To leave chat room, close browser window
- Username: gurman & Password: kalkat
- Username: testing & Password: is.fun
- Username: robots & Password: are.cool