Phone Number Authentication using Node.js, Flutter, and Vonage SMS Gateway Service API
This project demonstrates how to implement phone number authentication using Node.js, Flutter, and the Vonage SMS Gateway Service API. Phone number authentication provides a secure and convenient way for users to verify their identity during the login process.
- Generate and send OTP via SMS to users for phone number verification.
- Validate the OTP entered by the user to authenticate their identity.
- Integration with the Vonage SMS Gateway Service API to send and receive SMS messages.
- Node.js
- Flutter
- Vonage SMS Gateway Service API
- Node.js should be installed on your machine.
- Flutter SDK should be installed.
- Sign up for a Vonage account and obtain the API key, API secret, and virtual phone number.
- Clone the repository:
git clone https://github.com/Danitilahun/flutter-node-otp-phone-number-verification.git
- Navigate to the
backend
directory:cd API
- Install dependencies:
npm install
- Configure the Vonage API credentials in the
.env
file. - Start the Node.js server:
npm start
- Open the
otp_verification
directory in your preferred code editor. - Configure the backend server URL in the Flutter code.
- Run the Flutter application on a connected device or emulator:
flutter run
POST /auth/send-otp
: Sends an OTP via SMS to the user's phone number.POST /auth/verify-otp
: Verifies the OTP entered by the user.
- Launch the Flutter application on your device/emulator.
- Enter your phone number and click on the "Send OTP" button.
- Receive the OTP on your phone.
- Enter the OTP in the application and click on the "Verify" button.
- If the OTP is valid, the user is successfully authenticated.
Contributions to this project are welcome. To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your contribution:
git checkout -b feature/your-feature
. - Commit your changes:
git commit -m 'Add your commit message'
. - Push to the branch:
git push origin feature/your-feature
. - Open a pull request and describe the changes you have made.
This project is licensed under the MIT License.
- Vonage: Used for sending and receiving SMS messages.
For any questions or feedback, please reach out to Daniel Tilahun.