Let your knowledge spill forth like a fountain or partake in the wisdom of those who do.
I can't help you from personal experience, because I was an unpopular nerd with self-esteem issues way before nerds were cool. But if you're creating a fictional character, you're free to give her a fictional backstory as well. How about an overly religious grandmother who is always chastising her for spending time on being popular instead of doing church-related things? Or maybe an alcoholic father who hides his alcoholism from the world? That would work especially well if he also held a prominent position in the town, like mayor, doctor, pastor, Boy Scout leader. Or perhaps her mother has some sort of illness that she doesn't want to share with the world.
Basically what I'm getting at is this: Popular girls deal with the same issues the rest of us do. If it's not critical that the source of her unhappiness is her popularity, then a whole host of possibilities present themselves. If the source of her unhappiness is something hidden in her home life, you could portray her as a misunderstood girl who has has risen to popularity despite her struggles.