Introduction
The Incidents App web dashboard is a Next.js application that provides administrators with a complete interface for managing hotel operations. Built with Next.js 16 and React 19, it offers real-time analytics, user management, and incident oversight.Technology Stack
The web dashboard leverages modern web technologies:Next.js 16
App Router with server-side rendering and React Server Components
Supabase SSR
Server-side authentication and real-time data synchronization
Tailwind CSS 4
Utility-first styling with custom design system
shadcn/ui
High-quality accessible component library
Key Features
Dashboard Analytics
The main dashboard provides real-time insights into hotel operations:- Incident Metrics: Total, pending, in-progress, and resolved incident counts
- Trend Charts: 90-day historical data showing created vs. resolved incidents
- Data Tables: Complete incident list with filtering, sorting, and pagination
- Status Overview: Visual indicators for operational health
User Management
Comprehensive employee management system:- Create, edit, and delete employee accounts
- Assign roles (employee vs. admin)
- Configure area assignments for staff routing
- Manage access permissions
Incident Management
Full incident lifecycle management:- View all incidents across the property
- Filter by status, priority, area, or room
- Assign incidents to specific employees
- Track resolution progress
- Export reports
Session Management
Guest check-in and QR code generation:- Create temporary guest sessions
- Generate unique access codes
- Generate QR codes for rooms
- Manage session expiration
Architecture
App Router Structure
The dashboard uses Next.js App Router with file-based routing:Authentication Flow
The dashboard implements secure authentication with middleware protection:middleware.ts
Data Fetching
The dashboard uses React Server Components for efficient data fetching:page.tsx
Components
The dashboard includes several custom components:SectionCards
Displays key metrics with visual indicators:- Total incidents count
- Pending incidents (yellow badge)
- In-progress incidents (blue badge)
- Resolved incidents (green badge)
ChartAreaInteractive
Interactive chart showing incident trends:- 90-day historical data
- Created vs. resolved comparison
- Hover tooltips with daily details
- Responsive design
DataTable
Full-featured data table powered by TanStack Table:- Sorting and filtering
- Pagination
- Column visibility controls
- Export functionality
- Row selection
AppSidebar
Navigation sidebar with sections:- Dashboard overview
- Incident management
- User management
- Analytics
- Settings
Performance Optimizations
Server Components
Data fetching happens on the server, reducing client-side JavaScript
Streaming
Progressive page rendering for faster perceived load times
Image Optimization
Next.js Image component for automatic optimization
Code Splitting
Automatic route-based code splitting
Security Features
- Middleware Protection: All dashboard routes require authentication
- Row Level Security: Database queries enforce user permissions
- CSRF Protection: Built-in Next.js security features
- Secure Cookies: HttpOnly cookies for session management
- Environment Variables: Sensitive data stored securely
Next Steps
Installation
Set up the web dashboard locally
Configuration
Configure environment variables and settings
Analytics
Explore analytics features
Deployment
Deploy to production