Web Client and Web Startup
This page covers the browser shell for the SureClinical web client: how the Angular application boots, how route state is registered, and how the startup path decides where a user lands after login.
Purpose
The web client is the main browser entry point for SureDrive, SureCTMS, SureETMF, and related network features. It defines the route tree, authentication flow, startup checks, and browser-specific runtime behavior.
Scope
This page focuses on the web shell and route registration layer. It does not document the details of individual workflow wizards or drive creation forms, which are covered in separate pages.
Entry Points
SC/suredms-web-client/src/main/webapp/app/js/app.jsSC/suredms-web-client/src/main/webapp/app/js/app-browser.jsSC/suredms-web-client/src/main/webapp/app/js/state/app-states.jsSC/suredms-web-client/src/main/webapp/app/js/state/app-states-network.jsSC/suredms-web-client/src/main/webapp/app/js/state/app-states-workflow.jsSC/suredms-web-client/src/main/webapp/app/js/app-navigation.js
Primary Components
app.jsis the Angular application bootstrap. Its run block wires up$rootScope, handles login redirects, checks platform license state, triggers notification refresh, and controls the state transition guard logic.app-states.jsdefines the shell states such asapp,app.dashboard,app.network,app.network.drive, and the drive wizard entry points.app-states-network.jsdefines the network search and project-facing states, including browse, audit trail, project, person, organization, and contacts flows.app-states-workflow.jsdefines workflow-related states such as workflow dashboard, workflow process, task list, and wizard-specific routes.app-browser.jsdetects the current browser and operating system, then adjusts runtime behavior such as disabling animations for IE/Edge.ClientNavigationServiceis the redirect layer that chooses the default landing area based on user permissions, feature flags, and client type.
Startup Flow
- The shell loads the Angular application and registers route definitions from the state files.
app.jsruns the initial login and state-change guard logic.- If the current route requires authentication and no user is loaded, the shell triggers the login flow or auto-login logic for OAuth/access-token cases.
- After a successful login, the shell checks notifications, redirects to the appropriate client area, and resumes the target state.
- If the browser is IE or Edge,
app-browser.jsdisables animations to reduce runtime cost.
Route and Navigation Behavior
- The default router fallback redirects to the user’s default client area instead of leaving the user on an unknown route.
- State transitions are guarded by feature checks, role checks, and navigation rules in the
$stateChangeStarthandler. - Network and workflow states are nested under the shared
appshell so the same authentication and layout behavior applies across product areas. - Some routes are parented to drive, application, or search dashboards so breadcrumbs and navigation context stay consistent.
Dependencies and Integrations
BrowserServicereadswindow.navigatorstate and reports browser capability information used by the shell.SessionService,LoginService, andOpenIdRepositoryhandle session recovery and identity checks.NotificationService,PlatformLicenseValidityCheckService, andUserVerificationWizardServiceperform runtime checks that can change the active state or force a redirect.AcePageServicecontrols the shared sidebar and footer UI that the shell toggles during state changes.
Edge Cases and Constraints
- The shell supports OAuth and access-token based recovery paths for users who arrive from external links.
- Some views are hidden when the current user lacks a feature or when the selected study belongs to a different client area.
- Browser-specific behavior is intentionally conservative for older browsers and tablet/phone layouts.