reactstream-web
v1.0.4
Published
Web interface for ReactStream analysis and component development
Readme
ReactStream Web Interface
A web-based interface for ReactStream that provides an interactive environment for React component development, testing, and analysis. Similar to playcode.io, it features a 4-panel layout with code editor, component preview, analysis results, and console output.

Features
- Interactive Code Editor - Monaco-based editor with syntax highlighting and code completion
- Live Component Preview - Real-time rendering of your React components
- Component Analysis - Analyze your components for best practices and potential issues
- Console Output - View logs, errors, and warnings in real-time
Getting Started
Prerequisites
- Docker and Docker Compose
- Node.js (v14 or higher) and npm (for local development)
Quick Start with Docker
- Clone the repository:
git clone [email protected]:reactstream/server.git
git clone https://github.com/reactstream/web.git
cd server- Start the application using Docker Compose:
docker-compose up -d- Access the application in your browser:
- Open http://localhost or http://www.reactstream.com (if you've configured your hosts file)
Environment
sudo apt update && sudo apt upgrade -y
sudo apt install -y git nodejs npm nginx certbot python3-certbot-nginxLocal Development Setup
Install dependencies:
npm installBuild the frontend:
npm run buildStart the server:
npm start- Access the application in your browser:
- Open http://localhost:80
Project Structure
reactstream-web/
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker image definition
├── package.json # Node.js dependencies and scripts
├── webpack.config.js # Webpack configuration
├── server.js # Express server handling API and socket.io
├── src/ # Frontend source code
│ ├── index.html # Main HTML template
│ ├── index.js # React entry point
│ ├── App.js # Main React component
│ ├── styles.css # Global styles
│ └── components/ # React components
│ ├── Editor.js # Code editor component
│ ├── Preview.js # Component preview panel
│ ├── Analysis.js # Analysis results panel
│ └── Console.js # Console output panel
├── temp/ # Temporary storage for component files
└── dist/ # Built frontend files (generated)Usage
- Write or paste your React component code in the editor panel
- Click "Analyze" to check your component for issues and best practices
- Click "Run" to see your component rendered in the preview panel
- View console output for logs, errors, and warnings
Domain Configuration
To use the custom domain (www.reactstream.com):
- Add an entry to your hosts file:
# On Linux/Mac
sudo nano /etc/hosts
# On Windows
# Edit C:\Windows\System32\drivers\etc\hosts as administrator- Add the following line:
127.0.0.1 www.reactstream.com- Save the file and restart your browser
Development
Building the Frontend
npm install dotenv babel-loader webpack webpack-cli html-webpack-plugin css-loader style-loader
# Development build with watch mode
npm run dev
# Production build
npm run buildRunning Tests
npm testLinting
npm run lintTroubleshooting
Common Issues
Port conflicts
- If port 80 or 3000 is already in use, modify the port mappings in docker-compose.yml
Docker permission issues
- Run Docker commands with sudo on Linux or ensure your user is in the docker group
Node modules issues
- Try deleting node_modules folder and package-lock.json, then run npm install again
Preview not loading
- Check if the development server is running on port 3000
- Check browser console for CORS errors
Analysis not working
- Ensure ReactStream CLI is properly installed in the Docker container
- Check server logs for execution errors
Quick Commands Reference
# Start with Docker
docker-compose up -d
# Stop Docker containers
docker-compose down
# View logs
docker-compose logs -f
# Install dependencies
npm install
# Build frontend
npm run build
# Start server
npm start
# Development mode
npm run devContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- ReactStream - The CLI tool that powers the analysis and component serving
- Monaco Editor - The code editor that powers VS Code
- Socket.IO - For real-time communication between client and server
- Express - Web server framework
- React - UI library
