Complete setup instructions for the WebTop 2.0 project with file browser, process transparency, and miniature previews.
Create the following directory structure:
webtop/
├── README.md
├── SETUP.md # This file
├── CHANGELOG.md
├── LICENSE
├── pyproject.toml
├── .gitignore
├── webtop/ # Python package
│ ├── __init__.py
│ ├── main.py
│ ├── server.py
│ └── static/ # Web assets
│ ├── index.html
│ ├── styles.css
│ ├── webtask.js
│ ├── process-data.js
│ ├── file-system.js
│ ├── file-icons.css
│ ├── config.json
│ ├── manifest.json
│ └── favicon.ico # Optional
├── tests/ # Test suite
│ ├── __init__.py
│ └── test_webtop.py
└── docs/ # Documentation
├── installation.md
├── usage.md
└── development.md
Create this setup script as setup.sh:
#!/bin/bash
set -e
echo "🚀 Setting up WebTop 2.0..."
# Create directory structure
mkdir -p webtop/{webtop/static,tests,docs}
echo "📁 Directory structure created"
# Initialize git repository
git init
echo "📝 Git repository initialized"
# Create .gitignore if it doesn't exist
if [ ! -f .gitignore ]; then
cat > .gitignore << 'EOF'
__pycache__/
*.py[cod]
*$py.class
dist/
build/
*.egg-info/
.pytest_cache/
.coverage
htmlcov/
.env
.venv
venv/
ENV/
.DS_Store
Thumbs.db
poetry.lock
node_modules/
EOF
echo "📄 .gitignore created"
fi
# Initialize Poetry project
if command -v poetry &> /dev/null; then
echo "📦 Initializing Poetry project..."
poetry init --no-interaction
poetry add --group dev pytest black flake8 mypy pytest-cov
echo "✅ Poetry setup complete"
else
echo "⚠️ Poetry not found. Please install Poetry first:"
echo " curl -sSL https://install.python-poetry.org | python3 -"
fi
echo "🎉 WebTop setup complete!"
echo ""
echo "Next steps:"
echo "1. Copy all files from the artifacts to their respective locations"
echo "2. Run: poetry install"
echo "3. Run: poetry run webtop"Make it executable and run:
chmod +x setup.sh
./setup.sh- Create directory structure:
mkdir -p webtop/{webtop/static,tests,docs}
cd webtop- Initialize Poetry:
poetry init --no-interaction
poetry add --group dev pytest black flake8 mypy pytest-cov- Copy files from the artifacts provided above to their respective locations.
Copy each file from the artifacts to the correct location:
-
webtop/__init__.py- Package initialization -
webtop/main.py- CLI entry point -
webtop/server.py- HTTP server implementation
-
webtop/static/index.html- Main HTML structure -
webtop/static/styles.css- Core styling and layout -
webtop/static/webtask.js- Main application logic -
webtop/static/process-data.js- Process simulation engine -
webtop/static/file-system.js- Virtual file system -
webtop/static/file-icons.css- File type styling -
webtop/static/config.json- Application configuration -
webtop/static/manifest.json- PWA manifest
-
pyproject.toml- Poetry configuration -
.gitignore- Git ignore patterns -
LICENSE- MIT license -
README.md- Main documentation -
CHANGELOG.md- Version history
-
tests/__init__.py- Test package -
tests/test_webtop.py- Test suite -
docs/installation.md- Installation guide -
docs/usage.md- Usage documentation -
docs/development.md- Development guide
After copying all files:
- Install dependencies:
poetry install- Verify installation:
poetry run webtop --version- Run WebTop:
poetry run webtopRun the test suite:
# Run tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=webtop --cov-report=html
# Run specific test
poetry run pytest tests/test_webtop.py::TestWebTopServer# Format code
poetry run black webtop tests
# Lint code
poetry run flake8 webtop tests
# Type checking
poetry run mypy webtopFor development with auto-reload:
# Run in development mode
poetry run webtop --host 0.0.0.0 --port 8000
# Run without auto-opening browser
poetry run webtop --no-browserpoetry buildThis creates distribution files in dist/:
webtop-2.0.0.tar.gz(source distribution)webtop-2.0.0-py3-none-any.whl(wheel distribution)
# Install in editable mode
pip install -e .
# Install from wheel
pip install dist/webtop-2.0.0-py3-none-any.whl# Test on TestPyPI first
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi
# Publish to PyPI
poetry publishAfter setup, verify these features work:
- WebTop starts and opens in browser
- Process list displays with simulated data
- CPU and memory bars update in real-time
- Process selection works (click on process)
- F1: Advanced controls panel opens
- F2: File browser modal opens
- F9: Kill selected process works
- ESC: Closes modals and dropdowns
- Navigate through directories (/bin, /etc, /var)
- File previews show content
- Breadcrumb navigation works
- Different file types show appropriate icons
- Process transparency levels visible
- Miniature previews show for different process types
- Kill dropdown shows signal options
- Advanced kill by PID/service/port/user works
- Process hierarchy indicators visible
- Works on desktop (1200px+)
- Works on tablet (800px-1200px)
- Mobile layout adapts (800px-)
Port already in use:
webtop --port 8080Permission denied:
# On Linux/Mac, you might need:
sudo webtop --host 0.0.0.0 --port 80Poetry not found:
# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -Browser doesn't open:
webtop --no-browser
# Then manually navigate to http://localhost:8000For debugging, modify webtop/static/webtask.js and add:
// Add at the top of WebTop class constructor
console.log('WebTop Debug Mode: ON');
this.debug = true;See docs/development.md for detailed contribution guidelines.
If you encounter issues:
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with:
- Your operating system
- Python version (
python --version) - Poetry version (
poetry --version) - Complete error message
- Steps to reproduce
Happy monitoring with WebTop 2.0! 🚀