Sell custom-sized products with confidence. MeasureMate automatically calculates prices based on customer-entered measurements โ width, height, and depth โ and passes the correct amount securely into Shopify checkout.
- Overview
- Features
- Pricing Formulas
- Tech Stack
- Project Structure
- Prerequisites
- Getting Started
- Configuration
- How It Works
- Storefront Widget API
- Security
- Deployment
- Contributing
- Support
MeasureMate is a Shopify embedded app built for merchants who sell products requiring custom measurements โ such as curtains, blinds, glass panels, tiles, flooring, signage, or any made-to-measure items.
Instead of requiring separate SKUs for every possible size, MeasureMate lets customers enter their desired dimensions directly on the product page. The app instantly calculates a price using merchant-defined formulas, validates the input server-side, and creates a secure checkout flow with the correct custom amount.
| Feature | Description |
|---|---|
| ๐ Measurement Input | Collects width, height, and optional depth from customers on the storefront |
| ๐ฐ Dynamic Pricing | Calculates price in real-time as the customer types their dimensions |
| ๐งฎ Multiple Formulas | Area, Area + Depth, and Volume pricing models |
| โ๏ธ Crop Support | Optional crop requirement step before checkout |
| โ๏ธ Merchant Config | Admin interface for pricing rules, units, rounding, and min/max constraints |
| ๐ Server-Side Validation | All pricing is recalculated and verified on the backend before checkout |
| ๐ Secure Checkout | Shopify-native checkout handoff via backend order creation โ no unsafe browser-side Admin API calls |
| ๐ Unit Flexibility | Support for cm, mm, inches, and other measurement units |
MeasureMate supports three calculation models:
Final Price = Base Price + (Width ร Height ร Area Rate)
Final Price = Base Price + (Width ร Height ร Area Rate) + (Depth ร Depth Rate)
Final Price = Base Price + (Width ร Height ร Depth ร Volume Rate)
All formulas support configurable rounding, minimum price floors, and maximum constraints.
| Layer | Technology |
|---|---|
| App Framework | Shopify CLI + React Router Template |
| Frontend (Admin) | React + TypeScript |
| Storefront UI | Theme App Extension (JavaScript + Liquid) |
| Backend | Shopify App Server (Node.js) |
| API | Shopify Admin GraphQL API |
| Database | Prisma ORM |
| Styling | CSS |
| Containerization | Docker |
| Linting/Formatting | ESLint + Prettier |
| Build Tool | Vite |
MeasureMate-Custom-Price/
โโโ app/ # Remix/React Router app โ admin UI & backend routes
โ โโโ routes/ # App routes (admin pages, API endpoints, app proxy)
โ โโโ components/ # Reusable React components
โ โโโ shopify.server.ts # Shopify auth & session handling
โโโ extensions/ # Shopify theme app extension
โ โโโ measuremate-widget/ # Storefront measurement input widget
โ โโโ assets/ # Widget JavaScript logic
โ โโโ blocks/ # Liquid theme blocks
โโโ prisma/ # Database schema & migrations
โ โโโ schema.prisma
โโโ public/ # Static assets
โโโ shopify.app.toml # App configuration
โโโ shopify.web.toml # Web configuration
โโโ Dockerfile # Container setup
โโโ package.json
โโโ README.md
Before getting started, make sure you have:
- Node.js v18 or higher
- Shopify CLI v3+
- A Shopify Partner account
- A Shopify development store
- npm or yarn
git clone https://github.com/ankitpatel28/MeasureMate-Custom-Price.git
cd MeasureMate-Custom-Pricenpm installnpx prisma migrate devnpm run devThis will use Shopify CLI to:
- Authenticate with your Partner account
- Create a tunnel to your local server
- Launch the app on your development store
- Go to your Shopify Admin โ Online Store โ Themes
- Click Customize on your active theme
- Navigate to a product page template
- Add the MeasureMate Widget app block
- Save your theme
Once the app is installed, configure your pricing rules from the App Admin:
- Select a Product โ choose which products use custom pricing
- Set Formula Type โ Area, Area + Depth, or Volume
- Define Rates โ enter base price, area rate, and depth/volume rates
- Set Units โ choose measurement units (cm, mm, inches, etc.)
- Configure Constraints โ set min/max dimensions and min price floor
- Enable Rounding โ choose rounding strategy (none, up, nearest)
- Crop Requirement โ optionally require crop data before checkout
Customer enters measurements on storefront
โ
Widget calculates live price estimate
โ
Customer clicks "Add to Cart" / "Buy Now"
โ
App Proxy sends measurement data to backend
โ
Backend validates input against merchant rules
โ
Backend recalculates final price (server-side)
โ
Backend creates secure checkout via Admin API
โ
Customer is redirected to Shopify checkout
with the correct custom price
The widget exposes a global JavaScript API for integration with external tools (e.g., image croppers):
// Set crop data from an external cropper integration
window.MeasurementPricer.setCropData({
x: 10,
y: 20,
width: 300,
height: 200
});
// Get current measurement values
const measurements = window.MeasurementPricer.getMeasurements();
// Returns: { width, height, depth, unit, estimatedPrice }The widget also dispatches custom DOM events you can listen to:
document.addEventListener('measuremate:price-updated', (e) => {
console.log('New estimated price:', e.detail.price);
});MeasureMate is built with Shopify's security best practices:
- No Admin API access from the browser โ All Admin API calls (e.g., draft order creation) happen exclusively on the app's backend server, never in client-side JavaScript.
- Server-side price recalculation โ The final price is always recalculated on the server before checkout is created, preventing price manipulation via browser dev tools.
- App Proxy validation โ Storefront-to-backend communication goes through Shopify's authenticated App Proxy, ensuring request integrity.
- Session-based auth โ Admin access uses Shopify's OAuth session flow managed by
@shopify/shopify-app-remix.
# Build the image
docker build -t measuremate-custom-price .
# Run the container
docker run -p 3000:3000 \
-e SHOPIFY_API_KEY=your_api_key \
-e SHOPIFY_API_SECRET=your_api_secret \
-e SCOPES=write_products,write_draft_orders \
-e HOST=https://your-app-domain.com \
measuremate-custom-price| Variable | Description |
|---|---|
SHOPIFY_API_KEY |
Your app's API key from the Partner Dashboard |
SHOPIFY_API_SECRET |
Your app's API secret |
SCOPES |
Required Shopify API scopes |
HOST |
Your app's public URL |
DATABASE_URL |
Prisma database connection string |
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add your feature' - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
Please make sure your code follows the existing ESLint + Prettier configuration.
See CHANGELOG.md for a history of changes.
Have a question or found a bug?
- ๐ Website: ankitdevhub.info
- ๐ง Email: ankitjpatel28@gmail.com
- ๐ GitHub: @ankitpatel28
- ๐ Issues: Open an issue
If MeasureMate has been useful to you, please consider showing your support:
- โญ Star this repo โ it helps others discover the project
- ๐ด Fork it โ build something great on top of it
- ๐ Report bugs โ help make it better for everyone
- ๐ฌ Share feedback โ open a Discussion or reach out via the website
This project is licensed under the MIT License.
Made with โค๏ธ for Shopify merchants who sell custom-sized products