[There will be angst later on. If you want a sweet story or can't handle heartbreak, think carefully before reading.]
Bai Yan, an "excellent" programmer, somehow manages to transmigrate while writing code for a historical fantasy game.
The unfortunate part is that he takes on the role of the empress. Yes, that's right, a male empress. The empress in the game is also a miserable soul. His family was once powerful, but he offended too many people. His parents were murdered, and the culprit got away with it. To survive, the empress learns from his family's housekeeper, Aunt Liu, that his family still owns an apothecary, so Bai Yan starts running it.
By chance, he meets Xiao Zhu, a rebellious emperor kept under the Empress Dowager's thumb. Bai Yan helps Xiao Zhu escape his predicament and free himself from the Empress Dowager's control, and their lives improve. In time, Bai Yan and Xiao Zhu fall in love. But before Bai Yan can gather enough evidence to get justice for his family, that brainless idiot of an emperor listens to a scheming maid and believes Bai Yan is cheating on him with someone else. The emperor banishes our poor Bai Yan from the palace.
Theme: None