How abhisheksingh-dev22/whatsapp-otp works
This repository is a WhatsApp OTP test harness: a user submits a mobile number, requests an OTP delivered through MSG91, then submits the code for backend verification. Angular’s bootstrap and root component host the form; its service makes HTTP requests to Express, which manages OTP state and talks to MSG91. The backend uses an in-memory map with expiry, cooldown, and attempt limits. The graph follows the sampled source and README; the integration guide and form template were not provided, so their details are not inferred.
Main entry points: otp.service.ts OTP service · server.js Send endpoint · whatsapp-otp-test.component.ts OTP form · main.ts App bootstrap
Components 10
Angular application
- App bootstrap
frontend/src/main.ts - Root component
frontend/src/app/app.component.ts - OTP form
frontend/src/app/whatsapp-otp-test/whatsapp-otp-test.component.ts - OTP service
frontend/src/app/otp.service.ts - HTTP configuration
frontend/src/app/app.config.ts
OTP backend
- Send endpoint
backend/server.js - Verify endpoint
backend/server.js - OTP state
backend/server.js
WhatsApp delivery
- MSG91 API
Other components
- User
Connections 10
- User → OTP form: uses
README.md - App bootstrap → Root component: bootstraps
frontend/src/main.ts - App bootstrap → HTTP configuration: configures
frontend/src/main.ts - Root component → OTP form: hosts
frontend/src/app/app.component.ts - OTP form → OTP service: requests OTP
frontend/src/app/whatsapp-otp-test/whatsapp-otp-test.component.ts - OTP service → Send endpoint: POSTs send
frontend/src/app/otp.service.ts - OTP service → Verify endpoint: POSTs verify
frontend/src/app/otp.service.ts - Send endpoint → OTP state: stores code
backend/server.js - Verify endpoint → OTP state: checks code
backend/server.js - Send endpoint → MSG91 API: sends WhatsApp
backend/server.js