Skip to main content

Routing Architecture

Vartovii Dashboard uses React Router v6 for URL-based navigation.

Route Structure

RouteComponentDescription
/appLandingPageHome page with search
/app/crypto/:slugCryptoPageCrypto project analysis
/app/company/:slugReportViewerCompany report
/app/overviewOverviewCorporate overview
/app/sentimentSentimentSentiment analysis
/app/topicsTopicAnalysisTopic analysis
/app/marketMarketPulseMarket pulse
/app/battleBattleModeCompare companies
/app/crypto-battleCryptoBattleModeCompare crypto projects
/app/live-searchLiveScrapingFlowReal-time scraping
/app/adminAdminPanelAdmin panel

Key Files

dashboard_app/src/
├── router.jsx # Route definitions
├── main.jsx # RouterProvider setup
├── layouts/
│ └── DashboardLayout.jsx # Shared layout (Sidebar, Header)
└── pages/
└── crypto/
└── CryptoPage.jsx # Uses useParams()

Programmatic Navigation

import { useNavigate } from 'react-router-dom';

const MyComponent = () => {
const navigate = useNavigate();

const goToCrypto = (slug) => {
navigate(`/app/crypto/${slug}`);
};
};
import { Link } from 'react-router-dom';

<Link to="/app/crypto/bitcoin">Bitcoin</Link>

URL Parameters

import { useParams } from 'react-router-dom';

const CryptoPage = () => {
const { slug } = useParams(); // e.g., "bitcoin"
// ...
};

Lazy Loading

Heavy components are lazy-loaded for performance:

const CryptoPage = lazy(() => import('./pages/crypto/CryptoPage'));

This reduces initial bundle from ~1.5MB to ~300KB.

Adding New Routes

  1. Add route to router.jsx:
{ path: 'new-feature', element: <NewFeature /> }
  1. Add sidebar link in Sidebar.jsx:
{ id: 'new_feature', label: 'New Feature', icon: Star, path: '/app/new-feature' }