A professional AWS EC2 cost estimation tool with real-time pricing data. Built with Next.js and Node.js, featuring advanced filtering and cost analysis.
- Web scraping from AWS Calculator using Selenium WebDriver
- Live cost calculator with custom instance count and usage hours
- On-Demand vs Compute Savings Plan pricing comparison
- Professional UI with dark/light theme toggle
- Instance selection with detailed specifications display
- Real-time cost calculations for monthly and total costs
- Breakeven analysis page with detailed cost calculations
aws-ec2-calc/
├── frontend/ # Next.js 15 React application
│ ├── app/
│ │ ├── page.tsx # Main EC2 calculator interface
│ │ ├── cost-calculations/
│ │ │ └── page.tsx # Breakeven analysis page
│ │ ├── layout.tsx # Root layout
│ │ └── globals.css # Global styles
│ ├── components/ui/ # Shadcn/ui components
│ ├── lib/utils.ts # Utility functions
│ ├── package.json # Frontend dependencies
│ ├── vercel.json # Frontend deployment config
│ └── next.config.ts # Next.js configuration
├── backend/ # Serverless API & data processing
│ ├── api/ # Individual serverless endpoints
│ │ ├── index.js # Main API router
│ │ ├── metadata.js # EC2 metadata endpoint
│ │ ├── instances.js # Instances with pagination/filters
│ │ ├── filter-options.js # Available filter values
│ │ ├── refresh-data.js # Data refresh endpoint
│ │ └── health.js # Health check endpoint
│ ├── data/
│ │ └── aws_ec2_instances.xlsx # EC2 instances data
│ ├── server-utils.js # Shared utilities & Excel reader
│ ├── server.js # Local development server
│ ├── scraper.py # Selenium web scraper
│ ├── requirements.txt # Python dependencies
│ ├── package.json # Node.js dependencies
│ └── vercel.json # Backend deployment config
└── README.md # This file
Frontend: Next.js 15, TypeScript, Tailwind CSS, Shadcn/ui
Backend: Node.js, Express.js, XLSX processing
Scraper: Python, Selenium WebDriver, Pandas, OpenPyXL
-
Clone Repository
git clone https://github.com/nerdylua/aws-ec2-calc.git cd aws-ec2-calc
-
Start Backend (Local)
cd backend npm install npm start # Runs on http://localhost:3001
-
Start Frontend
cd frontend npm install npm run dev # Runs on http://localhost:3000
-
Optional: Run Web Scraper
cd backend pip install -r requirements.txt python scraper.py # Requires Chrome browser
Application runs on http://localhost:3000
Method | Endpoint | Description |
---|---|---|
GET |
/api/health |
Health check with timestamp |
GET |
/api/metadata |
AWS configuration (region, tenancy, OS) |
GET |
/api/instances |
Paginated EC2 instances with filtering |
GET |
/api/filter-options |
Available filter values (families, vCPUs, etc.) |
POST |
/api/refresh-data |
Refresh Excel data cache |
Example API Calls:
# Get metadata
GET /api/metadata
# Get instances with filters
GET /api/instances?page=1&limit=10&search=t3&family=t3&vcpus=2
# Get filter options
GET /api/filter-options
- Real-time calculations for custom usage patterns
- Breakeven analysis showing optimal commitment periods
- Multi-instance support for enterprise scenarios
- Professional AWS-style cost breakdowns
# Frontend
npm run dev # Development server
npm run build # Production build
# Backend
npm start # Start server
# Scraper (from backend directory)
cd backend
python scraper.py # Collect fresh data
- Professional AWS-style interface with modern gradients
- Smart pagination with configurable page sizes (10/30/50)
- Advanced search across instance names, memory, network, storage
- Color-coded pricing with currency formatting
- Responsive design for mobile and desktop
- Theme toggle with localStorage persistence