AWS Billing Dashboard
A real-time AWS billing dashboard web application that tracks cloud usage and costs with comprehensive filtering and grouping capabilities.
I built this app because I was tired of constantly going into the AWS console just to check billing information. As the commit messages show, the entire project was generated using Claude Code. I’m using this as a way to explore Claude Code and learn how to use it more effectively.
Features
- ✅ User-configurable AWS credentials (no server-side .env required)
- ✅ Stateless backend supporting multiple users
- ✅ AWS Cost Explorer API integration with real-time data
- ✅ Interactive Chart.js visualizations (bar/line charts)
- ✅ Advanced filtering and grouping by AWS dimensions
- ✅ Service breakdown analysis and cost rankings
- ✅ Data export functionality (CSV, JSON, reports)
- ✅ Docker containerization for easy deployment
- ✅ Responsive design with Tailwind CSS
Quick Start (Docker - Recommended)
Prerequisites
- Docker and Docker Compose
- AWS account with Cost Explorer API access
Running with Docker
Option 1: Root Path Deployment (Default)
-
Start the application:
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
Option 2: Sub-path Deployment
For reverse proxy setups (nginx, Apache, etc.) where you want to serve the app under a sub-path:
-
Start the application with sub-path:
REACT_APP_BASE_PATH=/aws-billing docker compose up -d
-
Access the application:
- Frontend: http://localhost:3000/aws-billing
- Backend API: http://localhost:8000/api (root) or http://localhost:8000/aws-billing/api (sub-path)
-
Apache ProxyPass Example:
# Proxy all /aws-billing requests to the Docker containers ProxyPass /aws-billing/ http://localhost:3000/aws-billing/ ProxyPassReverse /aws-billing/ http://localhost:3000/aws-billing/
Configuration and Access
-
Configure AWS credentials in the web interface:
- Open http://localhost:3000 (or http://localhost:3000/aws-billing for sub-path)
- Click "Manage Credentials" to enter your AWS credentials
- Credentials are stored securely in your browser
-
Stop the application:
Development Setup
Prerequisites
- Python 3.8+
- Node.js 16+
- AWS account with Cost Explorer API access
Local Development
Option 1: Root Path Development (Default)
-
Start Backend:
cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ./start.sh
-
Start Frontend:
cd frontend npm install ./start.sh
Option 2: Sub-path Development
For testing sub-path deployment in development:
-
Start Backend with sub-path support:
cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt API_BASE_PATH=/aws-billing ./start.sh
-
Start Frontend with sub-path:
cd frontend npm install REACT_APP_BASE_PATH=/aws-billing PUBLIC_URL=/aws-billing ./start.sh -
Access the development server:
- Frontend: http://localhost:3000/aws-billing
- Backend API: http://localhost:8000/api or http://localhost:8000/aws-billing/api
AWS Permissions Required
Ensure your AWS credentials have the following permissions:
ce:GetCostAndUsagece:GetDimensionValues
Testing the Setup
- Backend health check: http://localhost:8000/api/health
- API documentation: http://localhost:8000/docs
- Frontend application: http://localhost:3000
API Reference
Core Endpoints
GET /api/health- Health check and system statusPOST /api/credentials/validate- Validate AWS credentialsPOST /api/cost-data- Retrieve cost and usage data (requires credentials)POST /api/dimensions/{dimension}- Get available dimension values (requires credentials)
Usage
All cost data endpoints require AWS credentials to be passed in the request body. The frontend handles this automatically through the credential management system.
Configuration
Environment Variables
The application supports configurable sub-path deployment through environment variables:
Frontend Configuration
REACT_APP_BASE_PATH: Sets the base path for the React app (default: empty/root)PUBLIC_URL: Controls static asset serving path (should matchREACT_APP_BASE_PATH)REACT_APP_API_URL: API endpoint path (default:/api)
Backend Configuration
API_BASE_PATH: Enables dual API endpoint support (default: empty)DEBUG: Enable debug mode (default:false)DEFAULT_AWS_REGION: Fallback AWS region (default:us-east-1)ALLOWED_ORIGINS: CORS allowed origins (default:*)
Docker Compose Configuration
BACKEND_PORT: Backend container port mapping (default:8000)FRONTEND_PORT: Frontend container port mapping (default:3000)
Examples
Environment file (.env):
# For sub-path deployment
REACT_APP_BASE_PATH=/aws-billing
BACKEND_PORT=8000
FRONTEND_PORT=3000Command line:
# Development with sub-path REACT_APP_BASE_PATH=/aws-billing API_BASE_PATH=/aws-billing ./start.sh # Docker with sub-path REACT_APP_BASE_PATH=/aws-billing docker compose up -d
Architecture
- Backend: FastAPI with stateless design and configurable sub-path support
- Frontend: React with TypeScript, Tailwind CSS, and React Router
- AWS Integration: boto3 for Cost Explorer API
- Storage: Client-side encrypted credential storage
- Containerization: Docker with multi-stage builds and dynamic nginx proxy
- Deployment: Supports both root path and sub-path configurations
