Skip to main content

Admin Panel

The Xylem Admin Panel is a React + Vite single-page application that provides internal management tools for the platform. It is deployed as a static build served by Nginx at admin.xylem.city.

Project Structure

xylem-admin/
├── src/
│ ├── App.jsx # Main app with routing
│ ├── main.jsx # Entry point
│ ├── index.css # Global styles (extensive)
│ ├── components/
│ │ └── AdminLayout.jsx # Page layout with sidebar navigation
│ ├── pages/
│ │ ├── LoginPage.jsx # Admin authentication
│ │ ├── DashboardPage.jsx # Overview dashboard
│ │ ├── LayersPage.jsx # GIS layer management
│ │ ├── FloorplansPage.jsx # Floorplan catalog management
│ │ ├── RegulatoryPage.jsx # Regulatory rules editor
│ │ ├── ProjectsPage.jsx # Project listing/management
│ │ ├── UsersPage.jsx # User management
│ │ └── OrgsPage.jsx # Organization management
│ ├── context/ # Auth context provider
│ └── regulatory/ # ReactFlow regulatory rule editor
├── public/ # Static assets
└── dist/ # Production build (served by Nginx)

Pages Overview

PageRouteDescription
Login/loginAdmin authentication
Dashboard/Overview with stats and quick actions
Layers/layersManage GIS layers (raster/vector)
Floorplans/floorplansManage catalog unit templates
Regulatory/regulatoryVisual rules editor
Projects/projectsView and manage all projects
Users/usersUser account management
Organizations/orgsOrganization management

Technology Stack

LibraryPurpose
React 19UI library
React Router DOM 7Client-side routing
Vite 7Bundler and dev server
ReactFlow 11Visual node graph editor (regulatory rules)
Lucide ReactIcon library
math.jsMathematical expression evaluation

Design

The admin panel uses a dark-themed design with:

  • Sidebar navigation — Collapsible side menu with icon + label links
  • Dark glassmorphic aesthetic — Matching the frontend's visual style
  • Responsive modals — For create/edit forms
  • Data tables — For listing entities with sort, filter, and pagination

Authentication

The admin panel shares the same JWT auth system as the main frontend:

  • Login via the backend's /auth/login endpoint
  • JWT token stored in context
  • Protected routes redirect to login

Development

# Install dependencies
npm install

# Start dev server
npm run dev

# Build for production
npm run build
# Output: dist/ (served by Nginx at admin.xylem.city)