Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/pricegun. Estimate how much to charge users for your SaaS side project. pricegun.twos.dev
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186import React from "react";
import Form from "react-bootstrap/Form";import InputGroup from "react-bootstrap/InputGroup";
export default class Questionnaire extends React.Component { constructor(props) { super(props); this.state = { hoursPerWeek: 10, hostingDollarsPerMonthFixed: 100, hostingDollarsPerMonthVariable: 100, conversionRate: 0.1, opportunityCostDollarsPerYear: 100000, margin: 0.2, numUsers: 1000, };
this.handleChange = this.handleChange.bind(this); this.handleChange({ target: "" }); }
async handleChange(event) { let val; switch (event.target.name) { case "margin": val = Number(event.target.value) / 100; break; case "conversionRate": val = Number(event.target.value) / 100; break; default: val = Number(event.target.value); }
await this.setState({ [event.target.name]: val, });
const monthlyRate = (this.state.opportunityCostDollarsPerYear / 12) * (this.state.hoursPerWeek / 40); const monthlyCosts = this.state.hostingDollarsPerMonthFixed + (this.state.hostingDollarsPerMonthVariable / 1000) * this.state.numUsers; const costPerUser = (monthlyRate + monthlyCosts) / this.state.numUsers; const pricePerUser = costPerUser * (1 / this.state.conversionRate) * (1 + this.state.margin);
this.props.onFormChange({ monthlyRate: Math.floor(monthlyRate), monthlyCosts: Math.floor(monthlyCosts), costPerUser: Math.floor(costPerUser), pricePerUser: Math.floor(pricePerUser), }); }
render() { return ( <Form> <Form.Group> <Form.Label>How much do you want to work on it?</Form.Label> <InputGroup> <Form.Control type="text" placeholder="10" name="hoursPerWeek" onChange={this.handleChange} autoFocus /> <InputGroup.Append> <InputGroup.Text>hours per week</InputGroup.Text> </InputGroup.Append> </InputGroup> </Form.Group> <Form.Group> <Form.Label> What are your <b>fixed</b> costs? </Form.Label> <InputGroup> <InputGroup.Prepend> <InputGroup.Text>$</InputGroup.Text> </InputGroup.Prepend> <Form.Control type="text" placeholder="100" name="hostingDollarsPerMonthFixed" onChange={this.handleChange} /> <InputGroup.Append> <InputGroup.Text>per month</InputGroup.Text> </InputGroup.Append> </InputGroup> <Form.Text> i.e. how much would it cost to run with zero users? </Form.Text> </Form.Group> <Form.Group> <Form.Label> What are your <b>variable</b> costs? </Form.Label> <InputGroup> <InputGroup.Prepend> <InputGroup.Text>$</InputGroup.Text> </InputGroup.Prepend> <Form.Control type="text" placeholder="100" name="hostingDollarsPerMonthVariable" onChange={this.handleChange} /> <InputGroup.Append> <InputGroup.Text>per month per 1k users</InputGroup.Text> </InputGroup.Append> </InputGroup> <Form.Text>Use your best guess.</Form.Text> </Form.Group> <Form.Group> <Form.Label>What percentage of users will pay?</Form.Label> <InputGroup> <Form.Control type="text" placeholder="10" name="conversionRate" onChange={this.handleChange} /> <InputGroup.Append> <InputGroup.Text>%</InputGroup.Text> </InputGroup.Append> </InputGroup> </Form.Group> <Form.Group> <Form.Label>How much do you make at your traditional job?</Form.Label> <InputGroup> <InputGroup.Prepend> <InputGroup.Text>$</InputGroup.Text> </InputGroup.Prepend> <Form.Control type="text" placeholder="100000" name="opportunityCostDollarsPerYear" onChange={this.handleChange} /> <InputGroup.Append> <InputGroup.Text>per year</InputGroup.Text> </InputGroup.Append> </InputGroup> </Form.Group> <Form.Group> <Form.Label>What margins do you want?</Form.Label> <InputGroup> <Form.Control type="text" placeholder="20" name="margin" onChange={this.handleChange} /> <InputGroup.Append> <InputGroup.Text>%</InputGroup.Text> </InputGroup.Append> </InputGroup> <Form.Text> i.e. after your labor and costs are paid for, how much more do you want as profit? </Form.Text> </Form.Group> <Form.Group> <Form.Label>How many users will you have?</Form.Label> <InputGroup> <Form.Control type="text" placeholder="1000" name="numUsers" onChange={this.handleChange} /> <InputGroup.Append> <InputGroup.Text>users</InputGroup.Text> </InputGroup.Append> </InputGroup> <Form.Text>Whether paying or non-paying.</Form.Text> </Form.Group> </Form> ); }}