Fiction by Rainbow Rowell.
I don't know much about "fan fiction," but apparently it's a thing. (If you've never heard of it: People take the established characters of a popular book or movie and write their own stories with them. They can post them online for others to read.)
This story is about a girl named Cath who writes fan fiction about a Harry-Potter-type series of books, called "Simon Snow." Her identical twin sister helps her with it; however, when they go to college, everything changes. Suddenly her sister is more interested in real life, while Cath is still stuck in the magical world of Simon Snow.
This was a good book.
I also read recently by this author: Eleanor and Park