waWanjohi / otp-generator

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:Python 72.6%Language:Shell 27.4%