One idea
A factory is a function or class whose job is to create objects for the rest of your app.
Use it when creation is becoming messy: if-else branches, default values, validation, config, or choosing between similar classes.
Why this matters
In a hackathon app, object creation often starts simple. Then you add UPI and card payments, admin and student users, test data and production config.
If every route, screen, or controller decides how to create these objects, changes become risky. A factory puts that decision in one place.