Make sauce first (if making yourself): Heat olive oil in saucepan over medium heat and add garlic, shallot, onion and red pepper flakes. Simmer for 5 minutes until onion is soft and then add basil, salt/pepper and tomatoes. Simmer for 45 minutes or so and while the sauce is doing its thing, prep the eggplant.
Eggplant: After slicing, salt both sides and let them sit for 20 minutes to draw out the moisture. Then, rinse and pat dry. Heat 1 cup of oil in pan over medium/high heat, dredge slices in flour and fry for 1-2 minutes on each side until light brown. Place on paper towel to rid of some oil. You will probably need to add the remaining oil halfway through frying.
Preheat the oven to 400. Cover bottom of a large pan with sauce and begin layering with eggplant slices, sauce, half of the ricotta, half of the other cheeses and repeat once more ending with mozzarella. Bake 20 minutes until cheese is melted.