Skip to content

Add frontend Lighthouse performance audit and optimization #296

@sanmipaul

Description

@sanmipaul

Summary

The frontend has no performance baseline. There has been no Lighthouse audit to measure performance, accessibility, SEO, and best practices scores. For a financial application targeting emerging markets with potentially slower connections, performance matters significantly.

Motivation

Google Lighthouse provides actionable, quantified performance metrics. Poor Lighthouse scores (especially performance and accessibility) directly correlate with higher bounce rates and lower user trust. Running a baseline audit reveals the biggest optimization opportunities.

Proposed Work

Step 1: Baseline Audit

Run Lighthouse against the following pages (on testnet with mock data):

  • / (landing page)
  • /dashboard (SME dashboard)
  • /invest (investor page)
  • /invoice/[id] (invoice detail)

Record scores for: Performance, Accessibility, Best Practices, SEO.

Step 2: Fix Critical Issues

Based on typical Next.js app issues, expected fixes:

Performance:

  • Add next/image for all images (automatic WebP conversion, lazy loading)
  • Remove render-blocking resources
  • Enable text compression (Brotli/gzip) in deployment config
  • Reduce unused JavaScript (code splitting)

Accessibility:

SEO:

  • Add <meta name="description"> to all pages
  • Add Open Graph tags for social sharing
  • Ensure robots.txt is present and correctly configured

Best Practices:

  • Ensure all external links use rel="noopener noreferrer"
  • Remove console.log statements in production build

Step 3: CI Integration

Add a Lighthouse CI step that fails if performance score drops below 70:

- uses: treosh/lighthouse-ci-action@v10
  with:
    urls: http://localhost:3000
    budgetPath: ./lighthouse-budget.json

Acceptance Criteria

  • Baseline audit results documented in docs/performance-baseline.md
  • Performance score ≥ 70 on all audited pages
  • Accessibility score ≥ 85 on all audited pages
  • Lighthouse CI added to GitHub Actions
  • CI fails if performance score drops below 70

References

  • frontend/next.config.js — performance configuration
  • .github/workflows/ci.yml — add Lighthouse CI

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendNext.js frontend workgood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions