|
| 1 | +# React + TypeScript + Vite |
| 2 | + |
| 3 | +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
| 4 | + |
| 5 | +Currently, two official plugins are available: |
| 6 | + |
| 7 | +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh |
| 8 | +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
| 9 | + |
| 10 | +## Expanding the ESLint configuration |
| 11 | + |
| 12 | +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: |
| 13 | + |
| 14 | +# AI-Powered Z-Wave JS Log Analyzer |
| 15 | + |
| 16 | +A web-based application that uses Google's Gemini AI to analyze Z-Wave JS network logs and provide intelligent insights about network performance, device behavior, and potential issues. |
| 17 | + |
| 18 | +## Features |
| 19 | + |
| 20 | +- **Smart Log Processing**: Real transform pipeline based on Z-Wave JS code for accurate log parsing |
| 21 | +- **AI-Powered Analysis**: Google Gemini AI provides intelligent insights about your Z-Wave network |
| 22 | +- **RSSI Analysis**: Specialized analysis of signal strength and network quality |
| 23 | +- **Interactive UI**: Modern React interface with drag-and-drop file upload |
| 24 | +- **Real-time Streaming**: Live analysis results as they're generated |
| 25 | +- **Secure**: API keys stored locally in your browser, no data sent to external servers |
| 26 | + |
| 27 | +## Live Demo |
| 28 | + |
| 29 | +Visit the live application at: [https://username.github.io/zwave-js-log-analyzer/](https://username.github.io/zwave-js-log-analyzer/) |
| 30 | + |
| 31 | +## Usage |
| 32 | + |
| 33 | +1. **Get a Google Gemini API Key** |
| 34 | + - Visit [Google AI Studio](https://aistudio.google.com/app/apikey) |
| 35 | + - Create a free API key |
| 36 | + - Enter it in the application (stored locally in your browser) |
| 37 | + |
| 38 | +2. **Upload Your Z-Wave JS Log File** |
| 39 | + - Drag and drop your log file onto the upload area |
| 40 | + - Supports .log and .txt files from Z-Wave JS applications |
| 41 | + |
| 42 | +3. **Ask Questions About Your Network** |
| 43 | + - Use the default query or ask specific questions |
| 44 | + - Examples: |
| 45 | + - "How good are the connections of my devices?" |
| 46 | + - "What errors occurred in this log?" |
| 47 | + - "Which devices have communication issues?" |
| 48 | + - "Analyze the RSSI values and signal quality" |
| 49 | + |
| 50 | +4. **Review AI Analysis** |
| 51 | + - Get real-time insights as the AI analyzes your log |
| 52 | + - Receive actionable recommendations for network optimization |
| 53 | + |
| 54 | +## Supported Log Formats |
| 55 | + |
| 56 | +- Z-Wave JS structured logs (preferred) |
| 57 | +- Raw Z-Wave JS console output |
| 58 | +- Log files from Z-Wave JS applications |
| 59 | + |
| 60 | +## Local Development |
| 61 | + |
| 62 | +### Prerequisites |
| 63 | + |
| 64 | +- Node.js 18 or higher |
| 65 | +- npm |
| 66 | + |
| 67 | +### Installation |
| 68 | + |
| 69 | +```bash |
| 70 | +git clone https://github.com/username/zwave-js-log-analyzer.git |
| 71 | +cd zwave-js-log-analyzer |
| 72 | +npm install |
| 73 | +``` |
| 74 | + |
| 75 | +### Development |
| 76 | + |
| 77 | +```bash |
| 78 | +npm run dev |
| 79 | +``` |
| 80 | + |
| 81 | +Open [http://localhost:5173](http://localhost:5173) in your browser. |
| 82 | + |
| 83 | +### Build |
| 84 | + |
| 85 | +```bash |
| 86 | +npm run build |
| 87 | +``` |
| 88 | + |
| 89 | +The built application will be in the `dist` directory. |
| 90 | + |
| 91 | +## Deployment |
| 92 | + |
| 93 | +This application is configured for GitHub Pages deployment. Push to the `main` branch to automatically deploy via GitHub Actions. |
| 94 | + |
| 95 | +### Manual Deployment |
| 96 | + |
| 97 | +```bash |
| 98 | +npm run build |
| 99 | +# Deploy the contents of the dist/ directory to your web server |
| 100 | +``` |
| 101 | + |
| 102 | +## Architecture |
| 103 | + |
| 104 | +- **Frontend**: React + TypeScript + Vite |
| 105 | +- **Styling**: Tailwind CSS |
| 106 | +- **AI Integration**: Google Gemini AI via @google/genai |
| 107 | +- **Log Processing**: Transform pipeline based on Z-Wave JS core |
| 108 | +- **State Management**: React hooks with localStorage for persistence |
| 109 | + |
| 110 | +## Privacy & Security |
| 111 | + |
| 112 | +- **Local Processing**: Log files are processed entirely in your browser |
| 113 | +- **API Key Storage**: Your Gemini API key is stored locally in your browser |
| 114 | +- **No Data Collection**: No log data or personal information is sent to external servers |
| 115 | +- **Client-Side Only**: This is a static web application with no backend |
| 116 | + |
| 117 | +## Contributing |
| 118 | + |
| 119 | +1. Fork the repository |
| 120 | +2. Create a feature branch |
| 121 | +3. Make your changes |
| 122 | +4. Test thoroughly |
| 123 | +5. Submit a pull request |
| 124 | + |
| 125 | +## License |
| 126 | + |
| 127 | +MIT License - see [LICENSE](LICENSE) for details. |
| 128 | + |
| 129 | +## Acknowledgments |
| 130 | + |
| 131 | +- Built using the real Z-Wave JS transform pipeline from [node-zwave-js](https://github.com/zwave-js/node-zwave-js) |
| 132 | +- Powered by Google's Gemini AI |
| 133 | +- Analysis prompts based on Z-Wave JS project's log analysis tools |
| 134 | + |
| 135 | +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: |
| 136 | + |
| 137 | +```js |
| 138 | +// eslint.config.js |
| 139 | +import reactX from 'eslint-plugin-react-x' |
| 140 | +import reactDom from 'eslint-plugin-react-dom' |
| 141 | + |
| 142 | +export default tseslint.config([ |
| 143 | + globalIgnores(['dist']), |
| 144 | + { |
| 145 | + files: ['**/*.{ts,tsx}'], |
| 146 | + extends: [ |
| 147 | + // Other configs... |
| 148 | + // Enable lint rules for React |
| 149 | + reactX.configs['recommended-typescript'], |
| 150 | + // Enable lint rules for React DOM |
| 151 | + reactDom.configs.recommended, |
| 152 | + ], |
| 153 | + languageOptions: { |
| 154 | + parserOptions: { |
| 155 | + project: ['./tsconfig.node.json', './tsconfig.app.json'], |
| 156 | + tsconfigRootDir: import.meta.dirname, |
| 157 | + }, |
| 158 | + // other options... |
| 159 | + }, |
| 160 | + }, |
| 161 | +]) |
| 162 | +``` |
0 commit comments