This project is a frontend interface built with React (Next.js) to display and manage sensor data.
It connects to the backend API (FastAPI) and provides a user-friendly way to view alerts and sensor activity.
- Sensor Alerts
- List all alerts from
sensor_alerts
table - Delete alert entries from the interface
- Hover effects for better user experience
- List all alerts from
- Sensor Activity
- Show only the latest activity timestamp for each sensor
- Easily switch between Alerts and Activity tabs
- Modern UI with hover animations
- Responsive UI using Tailwind CSS
next-ui/
├── app/
│ ├── page.js # Main page with tab navigation (Alerts & Activity)
│ ├── layout.js # Root layout for Next.js
│ └── globals.css # Global styling (Tailwind)
├── lib/
│ └── api.js # API functions (fetch alerts, delete alerts, fetch activity)
├── package.json # Project dependencies
├── next.config.mjs # Next.js configuration
└── README.md # Project documentation
- Node.js (>= 18)
- npm or yarn
-
Clone the repository:
git clone https://github.com/aliefecakir/ReactNextjsUI.git cd ReactNextjsUI/next-ui
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open in browser:
http://localhost:3000
This frontend communicates with the FastAPI backend.
Set the API URL in .env.local
:
NEXT_PUBLIC_API_URL=http://127.0.0.1:8000
- Sensor Alerts Tab
- Shows alert list with delete option
- Sensor Activity Tab
- Shows the latest activity per sensor
This project is licensed under the MIT License.