database-dashboard
๐งพ Database Dashboard โ Frontend Documentationโ
Overviewโ
This internal database dashboard is built to view and manage internal data across different services (MFEs) via simple tables and data views. It is fully integrated with GraphQL APIs, Mantine UI, and follows a micro-frontend architecture (MFE) using module federation.
Tech Stackโ
| Tech | Purpose |
|---|---|
| React | Core UI framework |
| React Router DOM | Routing across different modules |
| Jotai | State management |
| URQL | GraphQL client for data fetching |
| Mantine | Component library |
| Module Federation | Micro-frontend integration (MFEs) |
| TypeScript | Static typing |
MFE Structureโ
All MFEs listed are mounted inside /dashboard
Example: /dashboard/mca, /dashboard/atfp
List of MFEs:โ
- atfp
- canada-consolidated
- canada-osfi
- cci
- cestate-case-details
- cibil
- district-courts
- drt-draft
- e-courts
- europe-consolidated
- itat
- mca
- mca-data-overview
- msme
- ncdrc
- nclat
- nclt
- new-cia-leaders
- new-sat
- rbi-compounding
- sebi-debarred
- sebi-defaulter-brokers
- sebi-defaulters
- sebi-records
- switzerland-sanctions
- uk-consolidated-list
- un-consolidated-list
- us-consolidated-list
- worldbank-debarred
- supreme-court
Each module is lazily loaded using React.lazy().
Folder Structure (Example)โ
src/
โ
โโโ views/
โ โโโ HomeApp.tsx
โ โโโ StatusCheckView.tsx
โ
โโโ store/
โ โโโ client.ts # URQL clients for different MFEs
โ
โโโ Router.tsx # Route configuration
โโโ ...
Routingโ
Routing is handled using react-router-dom@6 with nested routes. Each MFE is mounted under /dashboard.
Example:
{
path: '/dashboard/mca',
element: (
<ProviderWrapper client={clientValueMCA}>
<MCA />
</ProviderWrapper>
),
}
GraphQL Integrationโ
- All data is fetched via GraphQL using URQL clients.
- Each MFE uses a different client (
atfpClientAtom,districtClientAtom,mcaClientAtom, etc). - Clients are provided through
UrqlProvider.
Example:
<UrqlProvider value={clientValueMCA}>
<MCA />
</UrqlProvider>
Authenticationโ
- Login screen is available at
/ - After successful login, user is redirected to
/homeor/dashboard
{
path: '/',
element: (
<ProviderWrapper client={client}>
<Login />
</ProviderWrapper>
),
}
UI & UXโ
- Uses Mantine for component library.
- Tables, overlays, modals are used across MFEs to present internal data.
LoadingOverlayis used as the fallback for lazy loading.
const Loader = (
<LoadingOverlay
visible
zIndex={1000}
overlayProps={{ radius: 'sm', blur: 2 }}
loaderProps={{ color: 'green', type: 'bars' }}
/>
);
Adding a New MFEโ
To add a new micro-frontend module:
-
Add lazy loading for the component:
const XYZ = lazy(() => import('XYZApp/XYZ')) -
Add a new route under
/dashboard:{
path: 'xyz',
element: (
<ProviderWrapper client={clientValueXYZ}>
<XYZ />
</ProviderWrapper>
),
} -
Ensure the remote module is exposed in
module-federation.config.jsandwebpack.config.js
Status Checksโ
Status Check View is available at /home/status-check
{
path: '/home/status-check',
element: <DatabaseLayout />,
children: [
{
index: true,
element: (
<ProviderWrapper client={clientValueAtfp}>
<StatusCheckView />
</ProviderWrapper>
),
},
],
}