git clone https://github.com/Obaego12-debug/Text-.git
cd Text-
npm install
cp .env.example .envGreat! Now let's verify everything and start the application.
Check that npm packages installed correctly:
# Check Node version
node --version
# Should be v14.0.0 or higher
# Check npm version
npm --version
# Should be v6.0.0 or higher
# List installed packages
npm list --depth=0Edit the .env file with your settings:
# On macOS/Linux
nano .env
# On Windows
notepad .envMinimum required settings:
PORT=3000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/text-app
JWT_SECRET=your-secret-key-change-this
LOG_LEVEL=infoOptional settings (can skip for local dev):
REDIS_URL=redis://localhost:6379
SMTP_HOST=smtp.gmail.com
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-password
CORS_ORIGIN=http://localhost:3000macOS:
# Install with Homebrew
brew install mongodb-community
# Start MongoDB
brew services start mongodb-community
# Verify it's running
mongosh
# Should connect successfullyWindows:
# Download from: https://www.mongodb.com/try/download/community
# Run installer and follow prompts
# MongoDB will start automaticallyLinux:
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongodVerify MongoDB is running:
mongosh
# You should see: test>
# Type: exit- Go to https://www.mongodb.com/cloud/atlas
- Create free account
- Create cluster
- Get connection string
- Update
.envwithMONGODB_URI:
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/text-appmacOS:
brew install redis
brew services start redisLinux:
sudo apt-get install -y redis-server
sudo systemctl start redis-serverVerify Redis:
redis-cli ping
# Should return: PONGJust remove or comment out in .env:
# REDIS_URL=redis://localhost:6379npm run devYou should see:
Chat application running on http://localhost:3000
Environment: development
MongoDB: mongodb://localhost:27017/text-app
npm startOpen your browser and go to:
http://localhost:3000
You should see:
- Chat application UI
- Input fields for username and room ID
- Connect button
- Enter username:
testuser1 - Enter room ID:
general - Click "Join Room"
- Open new tab:
http://localhost:3000 - Enter username:
testuser2 - Enter room ID:
general(same room) - Click "Join Room"
- In first tab, type a message and send
- Message appears in second tab in real-time
- Typing indicator shows when other user types
# Check if MongoDB is running
mongosh
# If not running, start it:
# macOS: brew services start mongodb-community
# Linux: sudo systemctl start mongod
# Windows: Check Services app# Find what's using port 3000
lsof -i :3000
# Kill the process
kill -9 <PID>
# Or use different port
PORT=3001 npm run dev# Clear npm cache
npm cache clean --force
# Try install again
npm install
# If still fails, delete node_modules
rm -rf node_modules package-lock.json
npm install# Make sure you're in correct directory
pwd # Should show: .../Text-
# Reinstall dependencies
rm -rf node_modules
npm install# Check if all services are running:
# 1. MongoDB: mongosh
# 2. Node: npm run dev
# 3. Check .env file is configured
# View full error logs
npm run dev # Look for error messages# Development
npm run dev # Start with auto-reload
npm run lint # Check code quality
npm test # Run tests
npm run seed # Seed database
# Production
npm start # Start app
npm run build # Build (if needed)
# Database
mongosh # Connect to MongoDB
redis-cli # Connect to Redis
# Docker
docker-compose up # Start all services
docker-compose down # Stop all services- Clone repository
- Run
npm install - Copy
.env.exampleto.env - Start MongoDB
- Configure
.envif needed - Run
npm run dev - Open
http://localhost:3000 - Test with 2 browser tabs
- Send test messages
Once local development is working:
- Read documentation: See
README.md - Explore API: See
API_DOCUMENTATION.md - Plan deployment: See
DEPLOYMENT.md - Deploy to production: Run
bash scripts/deploy-helper.sh
- Keep
npm run devrunning in one terminal - Open another terminal for database commands
- Check browser console (F12) for client-side errors
- Check terminal output for server-side errors
- Use different rooms to test multiple conversations
- Try opening multiple browser windows with different usernames
- Check troubleshooting section above
- Read documentation files in repository
- Check GitHub Issues for common problems
- Look at application logs for error details
Once you see messages appearing in real-time, you'll know everything is working correctly!
🎉 Enjoy your local chat application!
Next: Deploy globally using bash scripts/deploy-helper.sh