CurveLink
Defines a Node.js/Express community notification platform with Twilio SMS, PostgreSQL, and admin dashboard for building management.
What this file does
Defines a Node.js/Express community notification platform with Twilio SMS, PostgreSQL, and admin dashboard for building management.
When to use it
- Building a Twilio-based SMS alert system for a community or organization
- Creating a web-based resident issue reporting tool with subscriber verification
- Implementing an admin dashboard for managing SMS subscribers and broadcasts
- Setting up a PostgreSQL-backed notification platform with Twilio webhook integration
Assumes this stack
CurveLink
Overview
A smart community notification platform built with Node.js and Express that allows building management to broadcast emergency notifications and safety alerts to subscribed residents via Twilio SMS.
Project Structure
server.js- Main Express server with API endpointsdb.js- PostgreSQL database layer using pg pooltwilio-tools.js- Twilio SMS sending utilitiesindex.html- Public subscription landing page (modern startup design with Inter font)report.html- Resident report submission page (dark mode, lightning bolt theme)report.js- Report page frontend logic with subscriber verificationadmin.html- Admin dashboard for managing alertsadmin.js- Admin dashboard frontend logicadmin.css- Admin dashboard stylessetup.sql- Database schema for PostgreSQL
Key Features
- SMS subscription management (START/STOP commands)
- Auto-Welcome SMS sent on subscription with report page link
- Issue reporting via SMS (REPORT command saves to database)
- Web-based report submission (verified subscribers only)
- Broadcast alerts to all subscribers
- Admin dashboard for viewing subscribers and message history
- Twilio webhook integration for incoming/outgoing SMS
Configuration
The following environment variables are required for full functionality:
Required Secrets (add via Secrets tab)
TWILIO_ACCOUNT_SID- Twilio Account SIDTWILIO_AUTH_TOKEN- Twilio Auth TokenTWILIO_PHONE_NUMBER- Your Twilio phone numberBROADCAST_API_KEY- API key for broadcast endpoint authenticationADMIN_PASSWORD- Password required to authorize broadcasts and dismiss reports
Automatically Configured
DATABASE_URL- PostgreSQL connection string (provided by Replit)
Development
- Server runs on port 5000
- Database: PostgreSQL with tables for subscribers, messages, message_recipients, and reports
- Run with:
npm start - Sandbox Mode: Set
NODE_ENV=developmentto log SMS to console instead of sending real texts
API Endpoints
POST /sms- Twilio webhook for incoming SMSPOST /broadcast- Send alert to all subscribers (requires x-api-key header)POST /admin/broadcast- Password-protected broadcast from admin UIPOST /reports/:id/dismiss- Password-protected dismiss reportPOST /api/subscribe- Public subscription endpoint (sends welcome SMS)POST /api/report- Verified subscriber report submissionGET /subscribers- List all active subscribersGET /alerts- List all sent alertsGET /reports- List all resident-reported issuesGET /admin- Admin Command CenterGET /report.html- Resident report submission page
Recent Changes
- January 24, 2026: Added Auto-Welcome SMS on subscription with report page URL
- January 24, 2026: Created report.html/report.js - web-based report submission for verified subscribers
- January 24, 2026: Added /api/report endpoint with subscriber verification
- January 24, 2026: Added "Report an issue" link to landing page footer
- January 24, 2026: Fixed Safety Inbox button responsiveness with proper event listeners
- January 17, 2026: Built Admin Command Center with dark mode UI, Safety Inbox, password-protected broadcasts
- January 17, 2026: Redesigned landing page with dark mode aesthetic, green accent color, Inter font
- January 17, 2026: Implemented REPORT SMS feature - residents can text "REPORT [issue]" to log issues to database
- January 17, 2026: Initial Replit setup, configured for port 5000, PostgreSQL database initialized
What's inside
1 project overview, 1 structure list (10 files), 4 feature groups, 5 config items, 11 API endpoints, 1 changelog
Change this for your project
- Replace
TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN,TWILIO_PHONE_NUMBER,BROADCAST_API_KEY,ADMIN_PASSWORDwith your own credentials - Replace
DATABASE_URLwith your own PostgreSQL connection string if not using Replit - Replace
MarcusPiperAllen/CurveLinkwith your own repository name in any references
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Auto-welcome SMS on subscription with a link to the report page
- Sandbox mode via
NODE_ENV=developmentto log SMS to console instead of sending real texts - Password-protected broadcast and dismiss endpoints for admin actions
Related Documents
GOOBY - Closing Store Marketplace
Defines a full-stack marketplace app for discovering closing retail stores in NY/NJ/CT/PA, with automated closure scanning and admin review.
Lua Code Obfuscator/Deobfuscator
Provides a full-stack web app for obfuscating and deobfuscating Roblox Lua scripts with a Monaco editor and PostgreSQL storage.
GREEN NODE - Project Overview
Describes a full-stack recycling platform with three runtime modes, provider architecture, and development scripts for Cochabamba, Bolivia.
ADN Systems DMR Peer Server
Documents a forked FreeDMR server for amateur radio DMR voice/data routing with bridges, proxies, scheduled voice announcements, and centralized security.