- NodeJS v18+
- NPM v8+
- MongoDB v6+
- Docker (optional)
Before you begin, ensure you have NodeJS, MongoDB, and optional Docker installed.
-
Install nodemon globally:
npm install -g nodemon
-
Install project dependencies:
npm install
-
Open two terminals for development:
Terminal 1: Run the development server using nodemon:
nodemon
Terminal 2: Start the application:
npm run dev
Using Mongo Atlas
If you prefer to use MongoDB Atlas, make the following changes:
-
Open
src/config/database.ts. -
Update the database connection URL from:
let url = mongodb://${env.MONGO_USER}:${env.MONGO_PASSWORD}@${env.MONGO_HOST}
to:
let url = mongodb+srv://${env.MONGO_USER}:${env.MONGO_PASSWORD}@${env.MONGO_HOST}
This setup compiles TypeScript files to JavaScript in the dist directory and starts an Express server using nodemon.
To run the application with Docker, ensure you have Docker and Docker Compose installed.
-
Create a
.envfile in the root directory:cp .env.example .env
-
Edit the environment variables in the
.envfile. -
Open two terminals for development:
Terminal 1: Run the development server with nodemon:
npm run dev
Terminal 2: Start the Docker container:
docker compose up
To integrate WhatsApp API, follow these steps:
-
Go to Meta For Developers and create an account or log in if you have one.
-
Create a new app on Meta Apps.
-
After creating the app, copy its credentials and update the
.envfile with the new values. -
Setup Ngrok