Skip to content

trackit/virtual-try-on-nova-demo

Repository files navigation

Virtual Try-On Nova Demo

Full-stack demo for building virtual try-on experiences with Amazon Nova Canvas (AWS Bedrock). The frontend lets you pick or upload model and garment images, tune Nova Canvas parameters, and download the generated result.

Table of contents

Features

  • Modern React 19 + Vite UI with Material UI and Tailwind styling
  • Model and garment picker with uploads, local persistence, and a built-in sample model library
  • Nova Canvas parameter editor (mask shape, garment class, merge style, quality, cfg scale, seed)
  • Bedrock-backed NestJS API with form-data support for files or paths and data URL inputs
  • Downloadable PNG output plus metadata echoing the Nova Canvas payload

Architecture

Architecture Diagram

Requirements

  • Node.js 20+
  • pnpm 9+
  • AWS account with Bedrock access to Nova Canvas in us-east-1

Setup

pnpm install

Backend (NestJS)

  • AWS credentials: use an AWS_PROFILE with Bedrock permissions or export AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and optionally AWS_SESSION_TOKEN.
  • Region: Nova Canvas runs in us-east-1 (the client is created with that region).
  • Optional env:
    • PORT (default 3333)

Run in watch mode:

pnpm nx serve backend

The API is served at http://localhost:<PORT>/api, with the virtual try-on endpoint at /api/virtual-try-on.

Frontend (Vite + React)

  • Optional env:
    • VITE_API_BASE_URL (defaults to http://localhost:3333/api when dev server runs on port 4200; otherwise /api)

Run in watch mode:

pnpm nx serve frontend

Full-stack local quickstart

  1. In one terminal start the backend: pnpm nx serve backend
  2. In another terminal start the frontend: pnpm nx serve frontend
  3. Open http://localhost:4200 and pick or upload a model and garment, adjust Nova settings, then generate and download the result.

Deployment

Prerequisites:

  • AWS account with Bedrock access in us-east-1
  • S3 bucket virtual-try-on-terraform-state in us-east-1 for Terraform state

One-time bootstrap:

aws s3api create-bucket --bucket virtual-try-on-demo-terraform-state --region us-east-1 --create-bucket-configuration LocationConstraint=us-east-1

Deploy from local:

cd terraform
terraform init
terraform validate
terraform plan -out=tfplan
terraform apply tfplan

Assets and persistence

  • Sample models are bundled in assets/generatedModels and surfaced in the picker.
  • Uploaded models and garments are stored client-side (IndexedDB with a localStorage fallback) so they survive page reloads.

Quality checks

  • Lint: pnpm run lint
  • Tests: pnpm run test
  • Format: pnpm run format

License

Copyright 2025 TrackIt

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

LICENSE

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contact

For questions, suggestions, or support, please open an issue on GitHub or contact us via the blog.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published