Educational SaaS platforms coordinate complex user networks. A single system must host platform managers, sales agents, system developers, QA testers, support representatives, school tenant owners, teachers, and students. Giving each of these roles a separate site URL leads to user confusion and billing overhead.
The solution is a **unified login portal** that evaluates credentials, verifies tenant status, hashes passwords securely, and routes sessions dynamically. In this article, we details how Pockethost.in implements this architecture.
1. The Single Gateway Model
With Pockethost.in, all roles access a single clean login interface. Behind the scenes, our Node.js Express server coordinates with database tables using BcryptJS hashing to verify passwords. Upon successful authentication, the server generates a JSON Web Token (JWT) containing the user's role and unique tenant ID metadata.
2. Dynamic Routing & View Gating
Once the client-side React application decodes the JWT, it directs the session to the appropriate workspace dashboard:
- Sales Executive Workspace: Opens lead onboarding pipelines and simulated WhatsApp dispatch triggers.
- Platform Operations (Manager): Displays real-time dashboards showing lead statistics, sales analytical tables, and suspension toggles.
- School Admin Dashboard: Gathers outstanding tuition fee logs, teacher wages payroll files, and theme customizers.
- Teacher Desktop: Shows MCQ builders, notice publication pages, and test paper rosters.
- Student Dashboard: Opens notice announcements, pending fee invoices, and MCQ test player views.
3. Security Interceptors and Suspended State Isolation
Session tokens are sent inside header interceptors on every api request. If a tenant is suspended, our backend middleware intercepts incoming requests and returns an authorization exception immediately. The front-end React dashboard responds by showing the branded Access Paused shield, isolating all data paths until the tenant is restored by a manager.
"Having a role-based session dispatcher makes the interface simple for students and teachers alike while enforcing enterprise security barriers on every backend query."
Experience the simplicity of role-based portals. Try Pockethost's sandbox simulation on our homepage and see how roles work dynamically in real time.