Skip to content

Generate 4-digit OTP Code and send to user on SMS with AfricasTalking API

Notifications You must be signed in to change notification settings

waWanjohi/otp-generator

Repository files navigation

An OTP Code generator with Kafka and AfricasTalking SMS API

Prerequisites

The following should be installed:

  1. Docker
  2. Python
  3. Python virtualenv
  4. An account on AfricasTalking.

Setting up

  1. Setup python virtual environment:
virtualenv venv
  1. Install dependencies:
source venv/bin/activate && pip install -r requirements.txt
  1. Create docker container:
 docker-compose -f docker-compose.yml up -d
  1. Setup your AfricasTalking credentials:
mv .env.example .env

Edit appropriately

  1. Create a Kafka Topic called otpCodes (this is important):
./scripts/create.sh -n otpCodes -c kafka-tmc
  1. Now run the producer.py then consumer.py on separate terminals respectively. Happy coding :)

About

Generate 4-digit OTP Code and send to user on SMS with AfricasTalking API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published