Doorman is an automated door unlock system for residents using a callbox. When someone presses your code at the callbox, it places a phone call. Normally, you answer and press a digit to unlock the door. Doorman automates this by answering the call and pressing the unlock digit when auto-unlock is enabled.
Perfect for deliveries 📦 or letting in guests without needing to pick up the phone. Toggle auto-unlock on or off through a simple web interface.
⚠️ Note: You must ask your property manager to configure the callbox to call your Twilio number instead of your personal phone.
- 🔑 Automatic door unlocking using DTMF tones
- 🌐 Web interface to enable or disable unlocking
- 📊 Activity tracking for unlocks, calls, and rejections
- 📱 SMS notifications when the door is unlocked (optional)
- 🛠️ Customizable behavior and timing
- Your callbox is set up to call your Twilio number
- Twilio forwards incoming calls to your
/api/answerendpoint - Doorman auto-answers the call
- If unlocking is enabled:
- It waits a few seconds
- Sends the unlock digit (e.g.
9) - Hangs up after a short delay
- Optionally, it sends you an SMS notification
- If unlocking is disabled, the caller hears an "unavailable" message
- 📞 Get a Twilio number from twilio.com
- 🏢 Contact your property manager and give them your Twilio number
- ✅ Verify the callbox is calling your Twilio number correctly
- 🧪 Test the setup by pressing your code at the callbox
ℹ️ Some properties may charge fees or have restrictions on callbox number changes. Ask your management team for details.
- Node.js with npm (or yarn, pnpm, or bun)
- A Twilio account with a phone number
- An Upstash Redis instance
- Required environment variables
npm installCreate a .env.local file in the root directory:
UPSTASH_REDIS_REST_URL=your_redis_url
UPSTASH_REDIS_REST_TOKEN=your_redis_token
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
NOTIFY_PHONE_NUMBER=+1234567890
WHITE_LISTED_PHONE_NUMBERS=+1234567890,+0987654321
BLACK_LISTED_PHONE_NUMBERS=+1111111111,+2222222222Optional Variables:
NOTIFY_PHONE_NUMBER: Phone number to notify by SMS when the door is unlocked (e.g.,+1234567890)WHITE_LISTED_PHONE_NUMBERS: Comma-separated list of phone numbers allowed to unlock (e.g.,+1234567890,+0987654321)BLACK_LISTED_PHONE_NUMBERS: Comma-separated list of phone numbers blocked from unlocking (e.g.,+1111111111,+2222222222)
Edit src/consts.ts to customize behavior:
DOOR_UNLOCK_DIGIT: DTMF digit to send (e.g.9)TIMES_TO_EMIT_UNLOCK_DIGIT: Number of times to send it (default is2)DOOR_UNLOCK_DELAY_SECONDS: Delay before unlocking (default is3seconds)HANGUP_DELAY_SECONDS: Delay before hanging up (default is3seconds)UNAVAILABLE_MESSAGE: Message played when auto-unlock is disabledUNLOCK_NOTIFICATION_MESSAGE: SMS message sent on unlock (ifNOTIFY_PHONE_NUMBERis set)
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen your browser at http://localhost:3000 to view the control panel.
In your Twilio console:
- Go to your Twilio phone number settings
- Set the voice webhook URL to:
https://your-domain.com/api/answer
- Set the HTTP method to
POST
- ✅ Make sure your Twilio number is configured on the callbox
- 🕹️ Use the web interface to enable auto-unlocking when needed
- When a visitor arrives:
- Callbox calls your Twilio number
- Doorman answers automatically
- If enabled, it sends unlock tones and optionally notifies you via SMS
- If disabled, the caller hears an "unavailable" message
- 🔒 Disable auto-unlock when you're done
The interface shows:
- Current unlock status
- Last unlock time
- Last answered call
- Last rejected attempt
- Next.js – Web app and API routes
- Twilio – Call handling and DTMF control
- Upstash Redis – State storage
- SWR – Data fetching and caching
Deploy quickly using Vercel.
Make sure to set all environment variables in your Vercel project settings.
Enjoy seamless door access control with Doorman 🛎️