Comprehensive gap analysis and action items for the modernized RingID web frontend.
- P0 (Critical): Security vulnerabilities, blocking issues
- P1 (High): Code quality, CI/CD, major cleanup
- P2 (Medium): Modernization, documentation
- P3 (Low): Nice-to-have improvements
- Fix AngularJS 1.x XSS vulnerabilities - Plan migration to modern framework (Angular/React/Vue)
- Current versions have known XSS via
$resource, ReDoS vulnerabilities - Workaround: Implement strict CSP, DOM sanitization
- Current versions have known XSS via
- Upgrade Bootstrap 3.x - Vulnerable to XSS in Popover/Tooltip
- Migrate to Bootstrap 4/5 or modern CSS framework (Tailwind)
- Fix angular-ui-notification XSS - Version 0.3.6 vulnerable
- Find alternative (ngToast, angular-toastr) or upgrade
- Fix high: angular super-linear runtime - ReDoS via backtracking
- Package: angular 1.3.15 (all 1.x vulnerable)
- CVE: GHSA-4w4v-5hc9-xrr2
- Updated to angular 1.8.3 (latest 1.x)
- Fix moderate: angular XSS - Cross-Site Scripting vulnerabilities
- Via
$resource,angular.copy(),<input type="url"> - Multiple CVEs
- Updated to angular 1.8.3
- Via
- Fix moderate: Bootstrap XSS - Popover, Tooltip, data-* attributes
- Package: bootstrap 3.3.5 (upgrade to 4.x+)
- Updated to bootstrap 5.3.8
- Fix moderate: angular-ui-notification XSS - Version 0.3.6
- Replaced with @uirouter/angularjs@1.1.0
- Fix low: AngularJS SVG sanitization - Improper SVG handling
- Fix low: Image source restrictions bypass - Multiple bypass vectors
- Consolidate templates - Remove duplication between:
apps/main-app/templates/andpackages/templates/- Keep in
packages/templates/, update Vite alias@templates
- Remove legacy minified files from source (should be in
dist/)apps/main-app/newsportal/app.min.js,styles.min.cssapps/main-app/mobile/,m.ringid.com/minified files
- Set up GitHub Actions workflow
- Create
.github/workflows/ci.yml - Jobs: install (pnpm), lint, test, build, security audit
- Create
- Configure branch protection on
main(manual step in GitHub)- Go to Settings → Branches → Add rule for
main - Require PR reviews (at least 1)
- Require status checks to pass (CI)
- Require branches to be up to date before merging
- Include administrators (optional)
- Go to Settings → Branches → Add rule for
- Add deployment pipeline
- Build → Upload to CDN/S3/static server
- Staging and production environments
- Install pre-commit hooks (Husky + lint-staged)
- Configured in
package.jsonwith lint-staged - Runs ESLint + Prettier on staged files
- Configured in
- Expand ESLint configuration
- Added
eslint-plugin-angularwith AngularJS best practice rules - Updated
ecmaVersionto 2020 - Added angular directive restrict, no-service-method rules
- Added
- Align EditorConfig with Prettier
- Both use 2 spaces for JS files
- Remove legacy linter configs
- Deleted
.jshintrc,.bowerrc,.tern-project
- Deleted
- Expand test coverage (currently 8 test files)
- Create tests for: auth, chat, feed, notification modules
- Target: 60%+ coverage
- Fix Karma configuration
- Include all app directories (newsportal, mobile, etc.)
- Ensure ChromeHeadless works in CI
- Add E2E tests (Playwright or Cypress)
- Puppeteer is installed but not configured
- Add test coverage tool (karma-coverage or vite-plugin-istanbul)
- Remove legacy backup files
*_old*.html,*_backup*.html,*_old*.css,*_old*.js- Examples:
index-dashboard-headbar_backup_1_2_2016.html
- Fix package.json files
- Add
main/exportsfields to packages - Remove
"setup": "grunt build"from apps
- Add
- Update README.md
- Fix Node.js version (≥18, not ≥4)
- Document pnpm commands (not npm)
- Update migration notes
- Create CONTRIBUTING.md
- Branch naming, commit conventions, PR template
- Create CHANGELOG.md
- Document changes from v0.1.0 to v0.2.0
- Create ARCHITECTURE.md
- Explain AngularJS module structure
- Document shared services, WebSocket protocol
- Update MIGRATION.md
- Reflect actual monorepo structure (not
content/→src/) - Archive obsolete migration script
- Reflect actual monorepo structure (not
- Create
.env.exampleVITE_API_URL=http://localhost:3000 VITE_WS_URL=ws://localhost:3000 VITE_DEBUG=false - Add environment modes to Vite
.env.development,.env.staging,.env.production- Use
modeparameter:vite build --mode staging
- Move debug flags from
developer.config.js- Use
import.meta.env.VITE_DEBUG_*instead of hardcoded values
- Use
- Refactor to AngularJS components (partial)
- Use
.component()method (available in 1.5+) - Refactored:
rgPortalTabNav,rgTabNav - Eases future migration to Angular/React
- Use
- Enable modern JS features
- Arrow functions, template literals, destructuring
- Update ESLint
ecmaVersionto 2020
- Add CSS preprocessing (Sass/PostCSS)
- Vite has built-in Sass support
- 82 CSS files and 92 SCSS files exist
- Sass package already installed
- Optimize images
- Added
vite-plugin-imagemin - Compress images in
apps/main-app/images/
- Added
- Expand Vite configuration
- Add template cache plugin for AngularJS
- Configure bundle analyzer (
rollup-plugin-visualizer) - Fix HMR for AngularJS (replace
require.contextwith dynamic imports)
- Add build validation
- Check
dist/contains expected files - Smoke test with local HTTP server
- Check
- Consider TypeScript gradual adoption
- Add
allowJs: trueinitially - Rename files to
.tsgradually
- Add
- Add JSDoc documentation
- Document functions, services, factories
- Set up documentation generation (jsdoc)
- Create Docker configuration
Dockerfilefor production (multi-stage build)docker-compose.ymlfor local development
- Add state management (for future framework migration)
- Consider
angular-reduxfor current setup
- Consider
- Set up bundle size monitoring
- Track JS/CSS bundle sizes over time
- Alert on significant increases
- Fix module registration pattern
- Current:
try { module('ringid.feed') } catch { module('ringid.feed', [...]) } - Better: Check if module exists before registering
- Affects:
feed,profile,newsportalmodules
- Current:
- Consolidate sub-modules
ringid.feedregistered in 30+ files with try/catchringid.profileregistered in multiple directive files- Create a single module definition file for each sub-module
- Remove circular dependencies
lazyload.config.jsreferencesjs/build/modules/(non-existent paths)- Digits SDK loaded from CDN but also configured in lazyload
- Update template URLs to use
@templatesalias- Current:
templateUrl: 'templates/home/feed.html' - Should be:
templateUrl: '@templates/home/feed.html' - Affects 100+ template references in JS files
- Current:
- Fix hardcoded
pages/paths- Some templates use
pages/index.html,pages/profile/profile.html - Should consolidate to
@templates/structure
- Some templates use
- Template cache not properly populated
template-loader.jscreated but not integrated with AngularJS$templateCache- Need to call
loadTemplates()during app bootstrap
- Modernize WebSocket handling
- Current: Custom binary protocol in
worker/ - Consider: Socket.io client (already in node_modules/.ignored)
- Document WebSocket message types (OPERATION_TYPES)
- Current: Custom binary protocol in
- Fix worker files
worker.jshas syntax errors (fixedipiptypo, but may have more)wat.fall.jsandsender.jsuse legacy patterns- Consider migrating to modern Web Worker API
- WebSocket dependency in
packages/scripts/chatwindow.js(2279 lines) contains WebSocket logic- Should be in a dedicated service/factory
- Refactor feed controllers (partial)
- 15+ feed controllers in
app/feed/controllers/ - Consolidated 6 wrapper controllers into
feed.wrappers.js - Remaining: refactor base controllers (share, edit, tag, whoshare, sub)
- 15+ feed controllers in
- Fix feed directive registration
- Directives register
angular.module('ringid.feed')repeatedly - Should import the module once and add directives
- Directives register
- Remove commented lazy-load code
app.routes.jshas 50+ lines of commented$ocLazyLoadcode- Either implement lazy loading properly or remove comments
- Consolidate auth modules
- Auth logic scattered:
app/auth/,app/global/,app/friend/ - Create unified auth service
- Auth logic scattered:
- Fix social login flow
- Digits SDK loaded from CDN (deprecated)
digit.service.jsandrg-verify-phone.directive.jsneed update
- Remove hardcoded debug flags
developer.config.jshasALL_CHAT = true/false- Move to environment variables
- Remove global variable pollution
- Files use
var app;thenapp = angular.module(...) - Should use IIFE or strict mode consistently
- Files use
- Fix AngularJS injection
- Some files use implicit injection instead of
$inject - Affects minification (though Vite handles this now)
- Some files use implicit injection instead of
- Remove jQuery dependency (partial - removed from HTML)
- ✅ Deleted:
apps/main-app/newsportal/app/image_slider.js(jQuery plugin) - ✅ Removed: Script reference from
dashboard.html - Partial:
packages/scripts/utils_script.js- removedjQuery(document).ready() - Remaining:
utils_script.jsstill has$.cookie()dependency - ESLint rules disabled in
eslint.config.js(migrating to React) - Note: Mobile HTML files still reference
image_sliderID (cleanup during React migration)
- ✅ Deleted:
- ✓ Delete legacy files:
.bowerrc,.jshintrc,.tern-project - ✓ Fix
.npmrc: Add comments about pnpm settings - ✓ Align EditorConfig/Prettier: Both use 2 spaces for JS
- Add npm scripts:
preparefor Husky,auditfor security - ✓ Update README: Fix Node version, document pnpm commands
- ✓ Consolidate templates: Deleted
apps/main-app/templates/ - ✓ Create
.env.example: Basic Vite environment variables - ✓ Set up GitHub Actions CI/CD: Created
.github/workflows/ci.yml
See MIGRATION-PLAN.md for the detailed migration strategy.
Summary:
- Recommended: React with micro-frontends for gradual migration
- Alternative: Vue (easier transition from AngularJS)
- Timeline: 6-12 months for complete migration
- Preparation (2-4 weeks): Audit, infrastructure, planning
- Incremental Migration (3-6 months): Route-by-route migration
- Deprecation (1-2 months): Sunset AngularJS
Recommendation: React with micro-frontends (see MIGRATION-PLAN.md for details)
- Migrate Bower → npm
- Migrate Grunt → Vite
- Add ESLint + Prettier
- Migrate npm → pnpm
- Create
pnpm-workspace.yaml - Flatten nested package directories
- Add
package.jsonto all workspace packages - Update
.nvmrc(Node 18) - Set up CI/CD (GitHub Actions)
- Fix
.npmrc(added comments) - Consolidate templates into
packages/templates/ - Install pre-commit hooks (Husky + lint-staged)
- Expand test coverage
- Fix security vulnerabilities (AngularJS 1.x - updated to 1.8.3)
- Create documentation (CONTRIBUTING, ARCHITECTURE, CHANGELOG)
- Plan AngularJS migration strategy
- Fix template URLs to use
@templatesalias - Modernize WebSocket handling (partial - documented protocol)
- Refactor feed controllers (consolidate 15+ controllers)
- Create Docker configuration (Dockerfile, docker-compose.yml)
- Add npm scripts (audit, prepare for Husky)
- Fix Karma config (include all app directories, coverage)
Last updated: 2026-05-01