This is a minimal FastAPI backend that:
- Receives SMS via Twilio
- Uses the sender's phone number as identity
- Verifies that the user is an Emory student via
@emory.eduemail - Sends a 6-digit verification code to their Emory email
- After verification, allows them to text ride requests (Emory → ATL airport)
pip install -r requirements.txtCreate a .env file in the project root with your Twilio credentials:
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
DATABASE_URL=sqlite:///./trypsync.db # Optional, defaults to SQLite
uvicorn main:app --reloadIn your Twilio Console, set the webhook URL for incoming SMS to:
http://your-domain.com/sms
Install ngrok on Windows:
-
Option A: Download directly
- Visit https://ngrok.com/download
- Download the Windows version
- Extract the
ngrok.exefile - Add it to your PATH, or run it from the extracted folder
-
Option B: Using Chocolatey (if installed)
choco install ngrok
-
Option C: Using Scoop (if installed)
scoop install ngrok
After installing ngrok:
-
Start your FastAPI server:
uvicorn main:app --reload
-
In a new terminal, start ngrok:
ngrok http 8000
-
Copy the HTTPS URL from ngrok (e.g.,
https://abc123.ngrok.io) -
In Twilio Console → Phone Numbers → Your Number → Messaging Configuration:
- Set the webhook URL to:
https://abc123.ngrok.io/sms - Set HTTP method to:
POST
- Set the webhook URL to:
Alternative: Use Twilio CLI (if you prefer)
twilio phone-numbers:update +1234567890 --sms-url http://localhost:8000/sms- User texts the Twilio number
- System prompts for Emory email (@emory.edu)
- System sends OTP code to the email (currently stubbed - prints to console)
- User replies with the OTP code
- User is verified and can send ride requests
- Email sending is currently stubbed (prints to console). Replace
send_verification_email()inmain.pywith actual email sending logic. - The database defaults to SQLite for local development. Set
DATABASE_URLfor production PostgreSQL. - Ride request parsing is a placeholder - implement parsing logic in the verified user flow.