Debug Instructions for BambiSleep Chat
This document provides information on how to run and debug the BambiSleep Chat application.
Prerequisites
- Node.js (v16+ recommended)
- Docker and Docker Compose
- MongoDB (via Docker)
Running the Application
Standard Run
# Start MongoDB container
docker-compose up -d mongodb
# Start the application
npm run start
Development Mode (with auto-restart)
# Start MongoDB container
docker-compose up -d mongodb
# Start the application with nodemon for auto-restart
npm run dev
Debugging Options
Option 1: Using VS Code Debugger
- Open the project in VS Code
- Set breakpoints in your code
- Press F5 or select the "Debug with Nodemon" configuration from the debug panel
- The application will start with debugging enabled
Option 2: Using Chrome DevTools
- Run the application with the debug flag:
npm run debug
- Open Chrome and navigate to
chrome://inspect
- Click on "Open dedicated DevTools for Node"
- Set breakpoints and debug
Option 3: Using PowerShell Script
- Run the included PowerShell script:
.\debug.ps1
- This will check if MongoDB is running and start the application in debug mode
Debugging with Breakpoint on Start
To pause execution at the beginning of the application:
npm run debug:break
Available Ports
- Web Application: http://localhost:6970
- MongoDB: localhost:27018
- Debugger: ws://127.0.0.1:9229
Troubleshooting
If you encounter the error "address already in use," check for running instances:
netstat -ano | findstr :6970
To kill a process using a specific port:
Stop-Process -Id <PID> -Force
To check MongoDB connection:
docker exec -it bambisleep-mongodb mongosh -u bambisleep -p bambiAppPass456 --authenticationDatabase admin