I've been busy in the latest months writing a book to cover some key aspects of the ESP8266 ecosystem, the chip, the cloud and a mobile application.
The book will teach you and will give you a ready-to-sell solution for an IoT product.
You will discover how to work with the GPIOs on the ESP8266, how to build your basic thermostat for your house, how to control it from your mobile with your own cloud system based on MQTT.
Securing the data using authentication at the broker level and SSL is explained in a special chapter.
Real-time communication has a dedicated chapter where you will learn how to send real-time data from an ESP8266 to an nodejs server.
You can buy the book from Amazon.
I hope that you will enjoy the book.