Implementation:Infiniflow Ragflow Frontend Routes
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Routing |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete route configuration defining the complete URL-to-component mapping for the RAGFlow frontend application.
Description
The routes.tsx module defines the full React Router route tree for the RAGFlow frontend. It maps URL paths to lazy-loaded page components organized into sections: authentication (login), main application (datasets, agents, chats, search, files, memories), admin panel (users, roles, monitoring, settings), embedded views (shared chat/agent/search), and utility routes (404, document viewer).
Usage
This file is consumed by the UmiJS framework at build time to generate the application's routing configuration. Modify this file when adding new pages or restructuring the navigation hierarchy.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/routes.tsx
- Lines: 1-483
Signature
export default [
{ path: '/login', component: LoginPage },
{
path: '/',
component: MainLayout,
routes: [
{ path: '/datasets', component: DatasetsPage },
{ path: '/dataset/:id', component: DatasetPage },
{ path: '/agents', component: AgentsPage },
{ path: '/agent/:id', component: AgentPage },
// ... additional routes
],
},
{ path: '/admin', component: AdminLayout, routes: [...] },
// ... embedded and utility routes
];
Import
// Consumed by UmiJS framework, not directly imported
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | Static configuration; no runtime inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| default export | RouteConfig[] | Route tree consumed by React Router |
Usage Examples
// Routes are automatically consumed by UmiJS
// To add a new page:
// 1. Create page component in web/src/pages/
// 2. Add route entry in routes.tsx
{ path: '/new-feature', component: '@/pages/new-feature/index' }