Cloud VM Price Finder is designed to aggregate, store, and display virtual machine pricing data from multiple cloud providers. It features a high-performance FastAPI backend, a PostgreSQL database, and a modern, responsive React frontend built with Vite and Shadcn UI.
The application automatically keeps its pricing data up-to-date with a background scheduler and provides a powerful, filterable interface for users to find and compare virtual machine instances.
All endpoints are available under the /api/v1
prefix.
Method | Endpoint | Description |
---|---|---|
GET | /filters/options | Provides unique, distinct values for all filter dropdowns on the frontend. |
GET | /instances | Fetches a paginated list of VM instances with powerful filtering & sorting. |
GET | /providers | Lists all providers that currently have data in the database. |
GET | /regions | Lists all regions, optionally filtered by provider. |
GET | /metrics | Returns basic metrics like total record count and last update times. |
GET | /health | A simple health check endpoint. |
All VM data is normalized to the following schema:
instance_name
: str — Name/type of the VM instanceprovider
: str — Cloud provider nameregion
: str — Cloud regionvcpus
: int — Number of virtual CPUsmemory_gb
: float — Amount of RAM in GBstorage_gb
: int — Storage size in GBstorage_type
: str — Type of storage (e.g., SSD, HDD, EBS)hourly_cost
: float — On-demand hourly price (USD)monthly_cost
: float — Estimated monthly price (USD)spot_price
: float (optional) — Spot/preemptible price (if available)currency
: str — Currency (default: USD)instance_family
: str (optional) — Instance family/typenetwork_performance
: str (optional) — Network performance descriptionlast_updated
: datetime — Timestamp of last data refreshapp/providers/
inheriting from BaseProvider
.fetch_data()
method to return a list of VMInstance
objects.git clone https://github.com/frhanjav/vm-pricing-api.git
cd vm-pricing-api
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
.env
file in the project root.# .env
DATABASE_URL="postgresql+asyncpg://user:password@localhost/cloud_pricing"
CORS_ORIGINS="http://localhost:5173"
AWS_ACCESS_KEY_ID="your_key"
AWS_SECRET_ACCESS_KEY="your_secret"
A standalone script test_fetch.py
is provided to test fetching and saving AWS pricing data to CSV:
python -m app.test_fetch
python -m app.migrate_csv_to_postgres
cd frontend
npm install
.env.development
file in the frontend directory.# frontend/.env.development
VITE_API_BASE_URL=http://127.0.0.1:8000/api/v1
Run the backend and frontend servers simultaneously in two separate terminals from the project root.
uvicorn app.main:app --reload
cd frontend
npm run dev
You can now access the frontend at http://localhost:5173.