K.S.
You sound so distraught! Be sure to take care of yourself, for if you don't you will find it difficult to take care of anything else. A few long, deep breaths are in order! :) You deserve the chance to regain your tranquility.
You have been living with your parents with DD for the past five years, as far as I can tell. Five years is a long time for routines to get established: yours and your daughter's; yours and your mother's; your DD's between her mother and her grandmother. You will need to make a plan and figure out how to employ it before you make any changes. Likely, you will be best off if you get someone to help you create this plan. Don't let that set you back in your idea. Something this important deserves to have some rehearsal and testing done with a social worker/counselor/therapist person. It will be well worth the effort.
For the plan to work, you will have to get all of the adults on board. This may require you to get different housing arrangements if the other adults in your dd's daily life don't want to get on board. I know what I've said may seem impossible. If living alone was easy to finance, you'd already be doing that. I trust you have already been working towards this goal. How soon can you reach this first goal?
You give no indication of your own age. I only ask because, according to how you describe the situation, your mom is not talking to you as if you are an adult. Perhaps your living under her roof contributes to this; perhaps there are other behaviors that lead her to treat you that way. Oftentimes, people act like their younger selves with their parents (I fall into that trap myself quite often, and so do a lot of other adults). If you feel that you speak to your mother like an adult, dismiss this thought.
Read up on some child psychology books. More than a discipline plan, create how you plan to create an environment in your home and a relationship with your daughter, and then as necessary, with your parents. This is not just a one moment in a day plan. This is a "how I live" outlook in one's life. What to do when your daughter does not follow expected behavior will eventually come automatically once you've figured out how you want you home's environment to be.
Be careful not to get into a power struggle with your DD and / or your mom. Your goal is to have a polite, safe, and well-behaved DD. Do not get caught up in the idea that "My authority is being questioned!" Your goal is not to "win," or even to be "listened to." Your goal is to have a relationship with your daughter so that you can say, "Honey, auntie is tired, and she has asked that you not go up to see her so late at night. Maybe, let's make her a card tonight, and then let's bring her something special for breakfast (or the next time you'll see her.) "Sweetie, I know that you want to see her, but I've made this decision, and I'm not changing my mind. Sorry, sweetie." Look for the natural consequences rather than ways to "punish." See if auntie can get in with the "Nope, this is not a good time to visit" routine. Then, you will have a natural consequence. Consider reading the "Love and Logic" series of books (perhaps they can only be found online.)
As a teacher, I beseech you that you do not use school as punishment. School is the place to discover the world through curiosity and some guidance from the teacher. If she is behind in reading and writing, then find a good summer program that provides a reading and writing workshop and does some enrichment exploration. Perhaps some summer camps, like soccer and art camp, or writing camp, are good choices.
I hope you are feeling less frazzled. I hope things work out for you.
Have a tranquil new year.