Price Genie is a simple yet powerful pricing calculator that helps entrepreneurs, freelancers, and small businesses determine fair, profitable rates for their products or services. Designed with cost-based pricing principles, Price Genie empowers you to make informed decisions based on your actual costs, expenses, and target profit margins.
π‘ βTake control of your pricing with logic, not guesswork.β
Click the image to try the interactive pricing calculator.
- Calculate ideal prices based on costing breakdown
- Transparent computation logic with per-item control
- Built for freelancers, creatives, startups, and service providers
- Written in TypeScript β fully typed, no runtime dependencies
- Supports fixed markup, profit targets, or manual override
- Modular and extensible class structure
- Lightweight β zero dependencies
npm install @thezelijah/price-genieStep 1: Initialize and Setup Price Genie
import { PriceGenie, type CostingItem } from '@thezelijah/price-genie';
const genie = PriceGenie.initialize();
const sampleCostingItems: CostingItem[] = [
{
label: "Labor",
description: "Skilled worker wages for assembly and packaging",
quantity: 20,
unit: "hrs",
unitPrice: 250,
amount: 5000,
costMargin: 0.25,
multipliers: {
quantity: 1,
unitPrice: 1,
},
},
{
label: "Raw Materials",
description: "High-quality wood used for furniture production",
quantity: 10,
unit: "pcs",
unitPrice: 750,
amount: 7500,
costMargin: 0.2,
multipliers: {
quantity: 1,
unitPrice: 1,
},
},
{
label: "Logistics",
description: "Delivery and transportation of finished goods",
quantity: 2,
unit: "trips",
unitPrice: 1200,
amount: 2400,
costMargin: 0.15,
multipliers: {
quantity: 1,
unitPrice: 1,
},
},
{
label: "Packaging",
description: "Custom printed boxes and wrapping materials",
quantity: 100,
unit: "sets",
unitPrice: 35,
amount: 3500,
costMargin: 0.1,
multipliers: {
quantity: 1,
unitPrice: 1,
},
},
];
// Set Name
let updatedInstance = genie.setItemName("My Product")
.setItemDescription("A new product to add")
.setBasePrice(parseFloat("12345.50"))
.setTotalSupply(parseInt("100"))
.setListCostingBreakdown(sampleCostingItems);// Clear and empty List of Items included in the costing breakdown
let updatedInstance = genie.clearListCostingBreakdown();// Returns the most expensive item from the costing breakdown
const mostExpensiveItem = genie.getMostExpensiveCostItem();PriceGenie allows you to simulate pricing strategies without affecting your original data. You can plug these into a visual UI using sliders for dynamic experimentation.
Enable or disable simulation mode for visual controls like sliders:
const handleToggleSimulationMode = (bool: boolean) => {
const updatedInstance = genie.toggleSimulation(bool);
setGenieInstance(updatedInstance);
};When enabled, simulated values (e.g., quantity, unit price) override base values only in calculations and UI, not in stored data.
Each of these methods updates simulated multipliers that affect pricing computation in real time:
const handleSimDataQuantity = (multiplier: number, index?: number) => {
if (!!genie && index !== undefined) {
const updatedInstance = genie.updateCostItemQuantityMultiplier(index, multiplier);
setGenieInstance(updatedInstance);
}
};const handleSimDataUnitPrice = (multiplier: number, index?: number) => {
if (!!genie && index !== undefined) {
const updatedInstance = genie.updateCostItemUnitPriceMultiplier(index, multiplier);
setGenieInstance(updatedInstance);
}
};const handleSimDataTotalSupply = (multiplier: number) => {
if (!!genie) {
const updatedInstance = genie.updateTotalSupplyMultiplier(multiplier);
setGenieInstance(updatedInstance);
}
};const handleSimDataSRP = (multiplier: number) => {
if (!!genie) {
const updatedInstance = genie.updateSRPMultiplier(multiplier);
setGenieInstance(updatedInstance);
}
};- Freelancers quoting custom projects
- Product makers computing ideal selling price
- Startups experimenting with cost inputs
- Visual apps needing real-time pricing logic
- CAPEX / OPEX breakdown support
- Tax-aware calculations (e.g., VAT, withholding)
These features are not yet available in the current release but are in active development.
.
βββ src/ # Source TypeScript file
βββ dist/ # Build output (generated)
βββ demo/ # Optional usage demo (ignored in build)
βββ README.md
βββ package.json
βββ tsconfig.json
π The
/demofolder contains illustrative.tsxusage examples. It is excluded from the npm package and TypeScript build.
Contributions, bug reports, and suggestions are welcome! Feel free to fork and open a pull request.
ISC β free for personal and commercial use.
Made with π by @thezelijah
- Developer: Josef Elijah Fabian
- GitHub: https://github.com/jedlsf
- Project Repository: https://github.com/jedlsf/thezelijah-world
- Business Email: business@thezelijah.world
- Official Website: https://www.thezelijah.world
