With respect, I think you need to do some basic research.
No one is going to be able to send you a link to some code or article that does exactly what you want. So other than doing the work for you, or suggesting that you use the standard technique, is to give hints in the form of keywords. Google or your favorite search engine works well with keywords, but you have to be prepared to learn about the code patterns / technologies one at a time before you think about putting them together. Expect weeks to months of learning