ChatQuota lets you ask about your AWS account usage and service quotas in plain English. No more digging through the Console.
Built with Next.js, Ant Design, and Tauri.
This project demonstrates how to:
- Build a Java 17 Lambda using AWS SAM
- Deploy infrastructure using AWS CDK
- Expose the function through Amazon API Gateway
- Chat with the API via a Next.js + Ant Design client on GitHub Pages
- Package as a macOS desktop app with Tauri (Rust)
- Java 17+
- Node.js 18+
- AWS CLI
- AWS SAM CLI
- AWS CDK CLI
- Rust (for Tauri desktop build)
aws configureVerify Java:
java --versionCreate the SAM project:
sam init -r java17Inside sam-app:
# Ensure JAVA_HOME is set (if using Homebrew on macOS)
export JAVA_HOME=/opt/homebrew/opt/openjdk@17
export PATH="$JAVA_HOME/bin:$PATH"
# Use pip-installed SAM (brew version 1.159.1 has Python 3.13 compatibility issue)
export PATH="/Users/aniu/Library/Python/3.9/bin:$PATH"
sam build && sam local invoke HelloWorldFunction --event events/event.jsonCreate CDK app:
mkdir cdk
cd cdk
cdk init app --language typescriptBuild:
npm run buildDeploy:
npm run cdk deploy InfraStackThe project uses GitHub Actions for CI/CD (no CodePipeline needed).
Two independent workflows run on push to main:
Triggers on changes to sam-app/, sam-app-integ/, cdk/, or the workflow file itself.
- Builds the SAM Java Lambda (Gradle) and runs unit tests
- Deploys
InfraStack-Betato AWS - Runs Java integration tests against the Beta API
- Deploys
InfraStack-Prodto AWS (only if integ tests pass)
This gives a beta → test → prod pipeline: if the integration tests fail, the workflow stops and Prod is not deployed.
Triggers on changes to chat-app/ or the workflow file itself.
- Builds the Next.js static site
- Deploys to GitHub Pages
| Stack | Purpose | API URL | API Key |
|---|---|---|---|
InfraStack-Beta |
Test environment — deployed first, verified by integ tests | Get from CDK output ApiUrl |
Get from CDK output ApiKeyId |
InfraStack-Prod |
Production environment — deployed only after tests pass | Get from CDK output ApiUrl |
Get from CDK output ApiKeyId |
| Secret | Description |
|---|---|
AWS_ACCESS_KEY_ID |
AWS IAM access key |
AWS_SECRET_ACCESS_KEY |
AWS IAM secret key |
The IAM user needs permissions for:
- CloudFormation (deploy stacks)
- API Gateway (create/update APIs, manage API keys)
- Lambda (create/update functions)
- IAM (create roles/policies)
- S3 (CDK bootstrap bucket)
A single Next.js project with two pages:
| Route | Page | Description |
|---|---|---|
/ |
Landing page | Marketing site with DMG download link |
/chat |
Chat app | Login + chat interface for your API |
It can run as:
- GitHub Pages — static site in browser (landing + chat)
- Tauri Desktop App — native macOS app (Rust → DMG, opens directly to chat)
Landing Page (/) → Download DMG
Chat App (/chat) → API Gateway (x-api-key auth) → Lambda → AWS Usage Data
| Layer | Technology |
|---|---|
| UI Framework | Next.js 16 (React 19) |
| Design System | Ant Design |
| Desktop | Tauri 2 (Rust) |
| Deployment | GitHub Actions → GitHub Pages |
cd chat-app
# Install dependencies
npm install --legacy-peer-deps
# Dev server (hot reload)
npm run dev
# Build static export
npm run build
# Serve locally
cd out && python3 -m http.server 8080
# Open http://localhost:8080- Enable GitHub Pages in repo Settings → Pages → Source: GitHub Actions
- Push to
main— the workflow in.github/workflows/deploy-pages.ymlauto-deploys - Or manually trigger from Actions → Deploy to GitHub Pages → Run workflow
The deployed site will have:
https://<user>.github.io/aniu-lambda/→ Landing pagehttps://<user>.github.io/aniu-lambda/chat→ Chat app
- Update version in
chat-app/config.json - Commit and tag:
git add chat-app/config.json git commit -m "chore: bump to v0.0.4" git tag v0.0.4 && git push origin v0.0.4
- GitHub Actions auto-creates a Release with DMG and updates the landing page
Download ChatQuota.dmg from Releases.
First time opening? Run this in Terminal to bypass Gatekeeper:
xattr -d com.apple.quarantine /Applications/ChatQuota.appcd chat-app
# Development mode (hot reload in native window)
npm run tauri:dev
# Production build → .app + .dmg
npm run tauri:buildOutput:
src-tauri/target/release/bundle/macos/ChatQuota.appchat-app/dist/ChatQuota.dmg
- Landing Page (
/) — Marketing site with features, architecture diagram, and DMG download - Login Screen (
/chat) — Enter API Gateway URL + API Key (Ant Design Card + Input) - GET / health check — Verifies the connection before entering chat
- Chat Interface — Send messages via POST to API Gateway
- Settings panel — Sign out or modify API credentials at any time
- API Gateway validates the
x-api-keyheader via Usage Plan - Lambda processes the message and returns a response
Credentials are saved to localStorage for convenience.
Client (GitHub Pages / Tauri) → API Gateway (API Key auth) → Lambda → Response