Top

Wapi documentation

Chat, collaborate, and create teams effortlessly with Wapi

Welcome to Wapi!

Getting Started

These are the steps required to set up the chat application manually on any environment (Local System or Live Server).

Steps:

  • - MongoDB Installation
  • - Node.js Installation

MongoDB Setup

  • - Download & Install MongoDB Community Server:

    • https://www.mongodb.com/try/download/community
    • - Select:

      • - Version: Latest stable (e.g. 7.x or 8.x)

      • - Platform: Windows

      • Package: MSI

    • - Download and run the .msi installer

    • - During installation choose:

        • - Complete setup (recommended)

        • - Check Install MongoDB as a Service (very useful for production/local)

        • - Check Install MongoDB Compass (GUI – optional but recommended)

        • - Uncheck "Install MongoD as Network Service" if you want to run under your user


  • After installation

  • - MongoDB is usually installed in:

      • C:\Program Files\MongoDB\Server\<version>\bin
  • - Add MongoDB to PATH (if not already done by installer):

    • Add:

      • C:\Program Files\MongoDB\Server\<version>\bin to system PATH
  • - Start MongoDB (if not running as service):

      • mongod --dbpath "C:\data\db"

      (First time → create folder C:\data\db manually)

  • - Better – Start as Windows Service (recommended) :

    The installer usually creates the service. Check:

      • services.msc → MongoDB → Status: Running
    • If not running → start it manually from services.

  • - Better – Start as Windows Service (recommended) :

    The installer usually creates the service. Check:

      • services.msc → MongoDB → Status: Running
    • If not running → start it manually from services.

  • - Verify Installation :

      • mongod --version
      • mongo --version # or mongosh --version (new shell)
  • - Connect & Create Database + User (using mongosh) :

    Open Command Prompt or PowerShell:

    - mongosh

    Inside mongosh:

      • // Switch to admin database first
      • use admin
      • // Create admin user (very recommended)
      • db.createUser ({
      • user: "admin",
      • pwd: "StrongAdminPass123!",
      • roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
      • })
      • // Exit and reconnect with admin user
      • exit
      • mongosh -u admin -p StrongAdminPass123! --authenticationDatabase admin
      • // Now create application user & database
      • use wapi
      • db.createUser ({
      • user: "wapi_user",
      • pwd: "T$123eam",
      • roles: [
      • { role: "readWrite", db: "wapi" }
      • ]
      • })
      • // Exit
      • exit

    Connection String Examples (use in .env)

      • mongodb://wapi_user:T$123eam@localhost:27017/wapi

Node.JS Setup

  • - Download & Install Node.js (LTS)

    • Node.JS
    • Choose:

      • - Windows Installer (.msi):

      • Install with default options

      • Ensure "Add to PATH" is checked

  • - Verify Installation

    • Open Command Prompt:

      • node -v
      • npm -v

      You should see versions (e.g., v18.x.x).

  • - Install PM2 (Process Manager for Production)

    • PM2 keeps your app alive even after crashes or server restarts.

      • npm install pm2 -g

      Verify:

      • pm2 -v

Getting Started

These are the steps required to set up the chat application manually on any environment (Local System or Live Server).

Steps:

  • - MongoDB Installation
  • - Node.js Installation

MongoDB Setup

  • - Install MongoDB using Homebrew

      • # Update brew
      • brew update
      • # Install mongodb-community
      • brew tap mongodb/brew
      • brew install mongodb-community@8.0 # or @7.0, @6.0 – choose latest stable
      • # Start MongoDB
      • brew services start mongodb/brew/mongodb-community
      • # Or manually
      • mongod --config /opt/homebrew/etc/mongod.conf
  • - Verify:

      • use admin
      • db.createUser ({
      • user: "admin",
      • pwd: "StrongAdminPass123!",
      • roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
      • })
      • exit
      • mongosh -u admin -p StrongAdminPass123! --authenticationDatabase admin
      • use wapi
      • db.createUser ({
      • user: "wapi_user",
      • pwd: "T$123eam",
      • roles: [{ role: "readWrite", db: "wapi" }]
      • })
  • - Connection String:

      • mongodb://wapi_user:T$123eam@localhost:27017/wapi

Node.JS Setup

  • - Download & Install Node.js (LTS)

    • Node.JS
    • You will see two versions:

      • - LTS (Recommended for most users)

      • - Current (Latest features)

      • Choose the LTS version for maximum stability.

  • - Download macOS Installer (.pkg)

    Click the button that says:

    • “macOS Installer (.pkg)”

    This will download a file similar to:

    node-v18.x.x.pkg

  • - Run the Installer

    • Double-click the downloaded .pkg file.

      Follow the standard installation steps:

      • - Click Continue

      • - Accept the License

      • - Choose Install for all users

      • - Click Install

      • - Click Install

      • - Authenticate with your macOS password

      • - Installer completes the setup

  • - Verify Installation

    After installation, open Terminal:

    Run the following commands:

    • node -v
    • npm -v