Circuit diagram for automation with openhab,raspberrypi and esp8266

I am new to openhab, I am planning for a project in my engineering. I need this circuit diagram for automation with raspberrypi,esp8266 and relays.. I need code for programming esp8266. Thank you in advance. Please do help me out

I would check out ESPEasy - Let's Control It