Skip to content

Piggybank ๐Ÿ– ~ a simple-to-use web app that allows you to easily calculate the total registration and renewal costs of your Porkbun domains.

License

Notifications You must be signed in to change notification settings

jj15asmr/piggybank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿท๐Ÿ’ฐ Piggybank โ€ข Porkbun Domain Costs Calculator

Deployed with FTP Deploy Action

I used to have a domain name addiction (and still kind of do... but, hey, baby steps!) with Porkbun being my registrar of choice.

While their prices and overall experience is good, there didn't seem to be an easy way to see how much your total renewal costs would be for the year, which I personally really wanted so I'd be able to budget accordingly.

Introducing Piggybank ๐Ÿ– ~ a simple-to-use web app that allows you to easily calculate the total registration and renewal costs of your Porkbun domains.

All you need to do is copy-and-paste your simple list of domains from Porkbun (or if you're just brainstorming, type in any domain offered by Porkbun on a new line) into the box on the homepage and hit "Calculate".

Your total registration and renewal costs will then be calculated and displayed for you to marvel at. ๐Ÿคฉ

This repository contains the full source code for Piggybank which is open-sourced under the MIT License - see the LICENSE file for details. Piggybank is not affiliated with Porkbun LLC and was made for fun.

How It Works

Porkbun allows you to view a plain text or "simple" list of your currently registered domains as well as offers a public API for accessing their pricing data.

Piggybank is set up to make an API request twice per week (Tuesdays and Fridays) for this pricing data which is then stored in the database.

When you copy-and-paste or enter a list of domains into the box, it is then parsed to extract the TLD (top-level domain or its "extension") from each individual domain name which is then finally used to calculate the total registration and renewal costs using the stored pricing data.

โ˜๏ธ Please note that there are a couple of small caveats with Piggybank:

  • Domain prices can and will fluctuate over time due to registry (the company that owns the TLD) changes or special offers by Porkbun, the calculated costs should be seen more as an estimation or "ballpark" figure to help you budget your domains.
  • Some domain names are considered "premium" by their registry in which Porkbun is charged a higher-than-normal cost to register and/or renew it, which is then passed onto you. Pricing data from Porkbun is based on TLD and thus Piggybank has no knowledge of which names may be considered premium.

Installation

You can set up and run Piggybank yourself by following the below instructions:

  1. Download (and extract) or clone Piggybank's repository to your local machine or server.

  2. Enter Piggybank's directory and via the terminal execute the following commands:

    composer install
    
    cp .env.example .env
    
    php artisan key:generate
  3. In the .env file ensure that your database details are correct and then run the below command:

    php artisan migrate

    Your database should now be filled with the required tables.

  4. To fetch and store the current domain prices from Porkbun run the below command (Porkbun currently offers around 800 different TLDs, so it may take a minute):

    php artisan piggybank:get-domain-prices
  5. If you'd like the domain prices to be automatically fetched and stored as described in the "How it Works" section you'll need to do the following:

    • In the .env file, set the PIGGYBANK_EMAIL_TO_SEND_TO_ON_FAILURE key to a valid email address. The details of any failed API requests will be sent there.

    • Add the below CRON entry to your server/machine (this process may vary depending on your OS and any hosting control panel you may be running in addition, use Google if you're unsure):

      * * * * * cd /path/to/piggybank && php artisan schedule:run >> /dev/null 2>&1

      The automatic fetch is powered by Laravel's built-in task scheduler and so it might be helpful to view its documentation if you'd like to modify things further.

  6. Lastly, ensure that the APP_URL and ASSET_URL keys in the .env file are correct for your case, and then run the below command to host Piggybank locally on your machine:

    php artisan serve

    Go to the URL given in your browser and you should be all set! Enter some domains to calculate the costs and have fun!

Running Tests

Piggybank, as any good project should ๐Ÿ˜‰, includes automated tests powered by PHPUnit. You can run them by running the below command:

php artisan test --order-by random

If you'd like to view or edit the tests you can find them all within the tests/Unit and tests/Feature directories, organized accordingly.

Any tests that involve the DB are configured to use an in-memory SQLite database, if you'd like to change this, you can do so in the phpunit.xml file in the project's root.

Credits

I built Piggybank using these awesome things made by awesome people, here's a big thanks to them:

And an honorable mention to this article on Laravel Daily that helped me with how to handle storing and displaying the domain prices.

Extra Notes

I've only been working with Laravel since last November. ๐Ÿ˜ If you spot anything wrong with my code or it's design then please feel free to submit an issue or PR. I'd really appreciate it.

About

Piggybank ๐Ÿ– ~ a simple-to-use web app that allows you to easily calculate the total registration and renewal costs of your Porkbun domains.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published