-
Notifications
You must be signed in to change notification settings - Fork 0
Development
Marko Trapani edited this page Mar 24, 2026
·
2 revisions
Guide for developers contributing to Redis ACL Builder.
See CONTRIBUTING.md for full contribution guidelines.
- Python 3.10+ (3.12+ recommended)
- Node.js 18+
- Git
git clone https://github.com/markotrapani/redis-acl-builder.git
cd redis-acl-builder# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
# Install dependencies
pip install -r backend/requirements.txt# Option 1: Helper script
./scripts/run-web.sh
# Option 2: Direct execution
python backend/app.pyAccess at http://localhost:7380
cd electron
npm install
npm start# All backend tests
pytest tests/backend/ -v
# With coverage
pytest tests/backend/ --cov=backend --cov-report=html
# Specific test file
pytest tests/backend/test_app.py -v
# Property-based tests
pytest tests/backend/test_property_based.py -v# Install Playwright (first time)
npx playwright install
# Run all E2E tests
npx playwright test
# Run specific test
npx playwright test tests/e2e/01-page-load.spec.js
# Run with UI
npx playwright test --ui
# Debug mode
npx playwright test --debugpytest tests/backend/test_benchmarks.py -v# Minify CSS and JavaScript
python3 scripts/build_minified.pycd docker
# Build image
./build-multi-arch.sh
# Test image
docker run --rm -p 7380:7380 redis-acl-builder:localcd electron
# macOS
npm run build:mac
# Windows
npm run build:win
# Linux
npm run build:linuxredis-acl-builder/
├── backend/ # Python Flask backend
│ ├── app.py # Main application
│ ├── helpers/ # Core logic
│ │ ├── data_loader.py
│ │ └── acl_parser.py
│ └── models/ # Pydantic models
├── frontend/ # Web UI
│ ├── static/
│ │ ├── css/ # Modular CSS (6 modules)
│ │ └── js/ # Modular ES6 (13 modules)
│ └── templates/
│ ├── index.html
│ └── info.html
├── electron/ # Desktop app
│ ├── main.js # Electron main process
│ └── preload.js # Preload script
├── tests/ # Test suite
│ ├── backend/ # Backend tests (227+)
│ └── e2e/ # E2E tests (65)
├── docs/ # Documentation
└── scripts/ # Helper scripts
Flask Application (backend/app.py)
- RESTful API with 12 endpoints
- Pydantic request/response validation
- Comprehensive error handling
Data Loader (backend/helpers/data_loader.py)
- Redis command database
- Category-command mappings
- Supports Redis 7 (379 commands) and Redis 8 (488 commands)
ACL Parser (backend/helpers/acl_parser.py)
- Rule parsing engine
- Command permission evaluation
- Optimization suggestions
- Redundancy detection
Modular ES6 Architecture:
- 13 JavaScript modules
- Clear separation of concerns
- Event-driven architecture
Key Modules:
-
interactive-acl-builder.js- Main UI logic -
acl-optimizer.js- Optimization engine -
acl-category-manager.js- Category management -
api-client.js- Backend communication
Modular CSS:
- 6 CSS modules
- Theme system (light/dark)
- Responsive design
- Follow PEP 8 style guidelines
- Use type annotations
- Docstrings for all public functions
- Maximum line length: 88 characters (Black formatter)
- ES6+ syntax
- Modular structure (import/export)
- camelCase for variables/functions
- PascalCase for classes
- Comprehensive JSDoc comments
- BEM naming convention
- CSS custom properties for theming
- Mobile-first responsive design
-
feat/feature-name- New features -
fix/bug-name- Bug fixes -
docs/doc-name- Documentation -
chore/task-name- Maintenance
Follow Conventional Commits:
feat: Add support for Redis 9 commands
fix: Correct category detection logic
docs: Update API documentation
chore: Update dependencies
- Create feature branch from
main - Make changes with clear commits
- Add tests for new functionality
- Update documentation
- Submit PR with description
- Address code review feedback
# Enable debug mode
export FLASK_DEBUG=True
python backend/app.py- Use browser DevTools (F12)
- Check Console for errors
- Network tab for API calls
- Lighthouse for performance
# Run with DevTools
cd electron
npm start # DevTools open automatically in debug buildsDocker Builds:
.github/workflows/docker-publish.yml- Triggers on version tags
- Multi-arch builds (AMD64, ARM64)
- Publishes to Docker Hub
Desktop Builds:
.github/workflows/build-desktop.yml- Builds for macOS, Windows, Linux
- Creates GitHub releases
- Code signing and notarization
Questions? Visit GitHub Discussions!