You’re not wrong to be concerned that your boyfriend’s ex-fling and sometime best friend is competition. He may not view her as a love interest, but she’s still an ex-fling, and it sounds like she’s still interested in him.
Because you’re both young, he may not understand that this best friend of his is going to be a problem for whomever he has in his life — whether it’s you or someone else. He may not have enough experience to understand this just yet.
That said, if and when he cares enough about you, he’ll spend less time with her — or else only see her in your presence. If you can bring this subject up with him in a way that doesn’t make him feel threatened or defensive, he may volunteer on his own to do the right thing. The tricky part for you is to understand that unless you and your boyfriend are developing a strong commitment, he isn’t going to be ready to put your needs first. So timing is important.
When a man is ready to make a commitment to a woman he’s going to act like he’s committed. He’ll start acting like part of a couple that’s committed to each other, and that means putting your needs in this kind of situation first.