AboutMethodology

Our Methodology

Understanding how we calculate ESG scores and find sustainable investment alternatives

ESG Scoring Algorithm

Environmental

Carbon Footprint

Measures greenhouse gas emissions and carbon intensity

Resource Usage

Evaluates water consumption, waste management, and energy efficiency

Renewable Energy

Assesses commitment to clean energy and sustainability initiatives

Social

Employee Relations

Evaluates workplace safety, diversity, and employee satisfaction

Community Impact

Measures community engagement and social responsibility programs

Human Rights

Assesses supply chain ethics and human rights practices

Governance

Board Structure

Evaluates board independence, diversity, and expertise

Transparency

Measures financial reporting quality and disclosure practices

Ethics & Compliance

Assesses anti-corruption measures and ethical business practices

Risk Scoring System

Score Interpretation

0-10: Negligible Risk
10-20: Low Risk
20-30: Medium Risk
30-40: High Risk
40+: Severe Risk

Data Sources

Alpha Vantage: Real-time ESG ratings and financial data

Yahoo Finance: Market data and company information

SEC Filings: Regulatory compliance and governance metrics

Sustainability Reports: Company ESG initiatives and progress

Vector Similarity Algorithm

How We Find Sustainable Alternatives

1. Company Vectorization

Each company is represented as a multi-dimensional vector containing:

  • Market capitalization (normalized)
  • Revenue and profit margins
  • P/E ratio and beta coefficient
  • Sector and industry classification
  • ESG scores (Environmental, Social, Governance)

2. Similarity Calculation

We use a weighted similarity algorithm that considers:

  • Sector Match (40%): Companies in the same sector get higher similarity scores
  • Financial Metrics (40%): Market cap, revenue, and profitability comparisons
  • Industry Match (20%): Additional points for same industry classification

3. ESG Filtering

Only companies with better ESG scores (lower risk) are shown as alternatives:

if similarity_score ≥ 0.1 AND comp_esg_total < base_esg_total:
    include_in_alternatives()

4. Ranking & Selection

Results are ranked by ESG improvement (better scores first), then by similarity score. We return the top 5 most similar companies with superior ESG performance.

Technology Stack

Frontend

Next.js 14

React framework with App Router for optimal performance

TypeScript

Type-safe development with enhanced developer experience

Tailwind CSS

Utility-first CSS framework for rapid UI development

Recharts

Interactive charts and data visualization

Lucide Icons

Beautiful, customizable SVG icons

Backend

Python 3.9

Core backend language for data processing

Flask

Lightweight web framework for API endpoints

NumPy & Pandas

Data manipulation and numerical computations

yfinance

Real-time stock market data and pricing

Alpha Vantage API

ESG ratings and comprehensive financial data

Infrastructure

Vercel

Serverless deployment platform for both frontend and backend

Serverless Functions

Auto-scaling API endpoints with global CDN

GitHub

Version control and automated deployments

CORS

Cross-origin resource sharing for secure API access

Data & Algorithms

In-Memory Caching

88+ pre-loaded companies for fast autocomplete

Vector Similarity

Custom algorithm for finding similar companies

Real-time Data

Live stock prices and ESG scores via APIs

Error Handling

Comprehensive logging and graceful fallbacks

Code Architecture

Project Structure

Frontend Structure

frontend/
├── app/                    # Next.js App Router
│   ├── page.tsx           # Main dashboard
│   ├── methodology/       # This page
│   └── layout.tsx         # Root layout
├── components/            # Reusable components
│   ├── StockSearch.tsx    # Search functionality
│   └── ui/               # UI components
├── lib/                  # Utilities
│   └── config.ts         # API configuration
└── public/               # Static assets

Backend Structure

vercel-deploy/
├── api/                   # Serverless functions
│   ├── stock_suggestions.py  # Autocomplete API
│   ├── stock_details.py      # Company details API
│   └── health.py            # Health check
├── vector_similarity.py   # Core algorithm
└── vercel.json           # Deployment config

Key Algorithms

Vector Similarity Calculation

Uses weighted Euclidean distance with sector matching and financial metrics comparison

ESG Filtering

Only returns companies with lower ESG risk scores than the searched company

Real-time Price Fetching

Integrates yfinance and Alpha Vantage APIs for live market data

Performance & Scalability

Performance Features

Serverless auto-scaling
Global CDN distribution
In-memory caching (88+ companies)
Debounced search (300ms)
Optimized bundle sizes

Scalability

Handles 1000+ concurrent users
Auto-scales based on demand
99.9% uptime SLA
Global edge locations
Real-time data updates

Ready to Start Sustainable Investing?

Use our advanced ESG scoring algorithm to find companies that align with your values and offer better sustainability performance.

Start Investing