Looking forward to start a guest loyalty program

how do we track repeat guest and how can we reward them with points or a complimentary meal of a certain amount

I want to make this applicable for delivery guests, is there any application which can track guest record and update the eligibility of guest when its time for a reward…?