diff --git a/README.md b/README.md index 780cc50..353d880 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,61 @@ # SPORE UI -## TODO +A modern web interface for monitoring and managing SPORE embedded systems. + +## Features + +- **🌐 Cluster Monitoring**: Real-time view of all cluster members +- **📊 Node Details**: Expandable cards with detailed system information +- **🚀 Modern UI**: Beautiful glassmorphism design with smooth animations +- **⚡ Auto-refresh**: Keeps data current every 30 seconds +- **📱 Responsive**: Works on all devices and screen sizes + +## Project Structure + +``` +spore-ui/ +├── index.js # Express.js backend server +├── api/ +│ └── openapi.yaml # API specification +├── src/ +│ └── client/ # SPORE API client library +│ ├── index.js # Main client class +│ ├── package.json # Client package info +│ ├── README.md # Client documentation +│ └── example.js # Usage examples +├── public/ # Frontend files +│ ├── index.html # Main HTML page +│ ├── styles.css # All CSS styles +│ ├── script.js # All JavaScript functionality +│ └── README.md # Frontend documentation +└── README.md # This file +``` + +## Completed Tasks - [x] bootstrap an express.js app that serves a simple html page - [x] generate js client from api/openapi.yaml - [x] use getClusterStatus client function to get all members and display these members on the html page, use only vanilla JS -- [x] when clicking on one of the members in the UI, it should expand and display all informations from /api/node/status \ No newline at end of file +- [x] when clicking on one of the members in the UI, it should expand and display all informations from /api/node/status +- [x] create separate files for CSS and JS + +## Getting Started + +1. **Install dependencies**: `npm install` +2. **Start the server**: `npm start` +3. **Open in browser**: `http://localhost:3001` + +## API Endpoints + +- **`/`** - Main UI page +- **`/api/cluster/members`** - Get cluster member information +- **`/api/tasks/status`** - Get task status +- **`/api/node/status`** - Get system status +- **`/api/node/status/:ip`** - Get status from specific node + +## Technologies Used + +- **Backend**: Express.js, Node.js +- **Frontend**: Vanilla JavaScript, CSS3, HTML5 +- **API**: SPORE Embedded System API +- **Design**: Glassmorphism, CSS Grid, Flexbox \ No newline at end of file diff --git a/public/README.md b/public/README.md new file mode 100644 index 0000000..f78226c --- /dev/null +++ b/public/README.md @@ -0,0 +1,38 @@ +# SPORE UI Frontend + +This directory contains the frontend files for the SPORE UI application. + +## File Structure + +- **`index.html`** - Main HTML page with minimal markup +- **`styles.css`** - All CSS styles and animations +- **`script.js`** - All JavaScript functionality and API interactions + +## Features + +- **Responsive Design**: Works on all screen sizes +- **Modern UI**: Glassmorphism design with smooth animations +- **Interactive Cards**: Clickable cluster member cards +- **Real-time Data**: Auto-refreshes every 30 seconds +- **Expandable Details**: Click cards to see detailed node information + +## How It Works + +1. **HTML Structure**: Clean, semantic markup +2. **CSS Styling**: Modern design with CSS Grid and Flexbox +3. **JavaScript Logic**: API client, event handling, and DOM manipulation + +## Browser Support + +- Modern browsers with ES6+ support +- CSS Grid and Flexbox support required +- Fetch API support required + +## Development + +To modify the UI: +- **Layout**: Edit `index.html` +- **Styling**: Edit `styles.css` +- **Functionality**: Edit `script.js` + +All files are automatically served by the Express backend. \ No newline at end of file diff --git a/public/index.html b/public/index.html index 59e3d94..cbb9567 100644 --- a/public/index.html +++ b/public/index.html @@ -4,293 +4,7 @@