A 3D sorting algorithm Progressive Web App (PWA).
This project helps users understand how sorting algorithms work in a visual and interactive way. It supports offline usage thanks to PWA technology and lets users control the speed of animations to match their learning pace.
- Offline and app support (PWA)
- Choose from multiple sorting algorithms
- Adjustable animation speed
- Mobile responsive
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
Installs all necessary dependencies.
Starts the app in development mode.
The page will automatically reload if you make edits.
This project includes a comprehensive test suite with 82+ tests covering sorting algorithm correctness, edge cases, and visualization data validation.
# Run tests in watch mode (interactive)
npm run test
# Run tests once and exit
npm run test:run
# Run tests with UI (browser-based test runner)
npm run test:ui
The test suite includes:
- Correctness validation for all 6 algorithms
- Edge cases: empty arrays, single elements, sorted/reverse sorted data, duplicates, negative numbers
- Generator behavior: ensures proper step-by-step data for 3D visualization
findMaxValue
: maximum value detectionshuffle
: array randomization with element preservation
- Array length consistency throughout sorting
- Element preservation (no data loss)
- Valid index bounds checking
- Proper animation state indicators
- Large arrays (100+ elements)
- Extreme values (MAX_SAFE_INTEGER/MIN_SAFE_INTEGER)
- Floating-point number handling
- Two-element arrays
- Arrays with identical elements
All tests ensure both mathematical correctness and proper 3D visualization data generation for the sorting animations.
This project uses GitHub Actions for continuous integration and deployment with comprehensive testing and quality assurance:
- Test Workflow (
test.yml
): Runs on every push and pull request- Multi-Node Testing: Tests against Node.js 18.x and 20.x
- Comprehensive Test Suite: Runs the full test suite with 82+ tests
- Coverage Reports: Generates and uploads test coverage to Codecov
- TypeScript Validation: Ensures code compiles without errors
- Separate Jobs:
test
,lint
, andtest-coverage
for parallel execution
- Build Workflow (
build.yml
): Validates application build and performance- Build Verification: Ensures the application builds successfully
- Lighthouse CI: Performance, accessibility, and PWA testing on pull requests
- Artifact Storage: Saves build outputs and test results for review
- Performance Thresholds:
- Performance: ≥80% (warning)
- Accessibility: ≥90% (error)
- Best Practices: ≥80% (warning)
- SEO: ≥80% (warning)
- PWA: ≥80% (warning)
- ✅ All tests must pass before merging (82+ tests across all algorithms)
- ✅ TypeScript compilation must succeed
- ✅ Build must complete successfully
- ✅ Lighthouse performance thresholds must be met
- ✅ Code coverage tracking via Codecov integration
.github/workflows/
├── test.yml # Comprehensive test suite with multi-node testing
└── build.yml # Build validation and Lighthouse performance testing
Key Features:
- npm-based: All workflows use npm with proper
package-lock.json
caching - Parallel Execution: Tests run on multiple Node.js versions simultaneously
- Performance Monitoring: Lighthouse CI ensures optimal user experience
- Coverage Tracking: Codecov integration with detailed test coverage reports
- Artifact Management: Build outputs and test results preserved for debugging
Contributions make the open source community amazing. Any contributions you make are greatly appreciated.
- Fork the repository
- Create your feature branch (
git checkout -b feature
) - Commit your changes (
git commit -m 'Add new feature'
) - Push to the branch (
git push origin feature
) - Open a Pull Request
- Email: marcelorissette15@gmail.com
- Project Link: https://github.com/marcelo-schreiber/3d-sort