Finished the entire Python backend!

Reilly Chase
Nov 30, 2018 · 2 min read

GhostiFi Update #11

I finished writing the entire backend of GhostiFi with only 863 lines of Python.

I’m really pushing to launch by December 9, which will be 1 month since I started development. I’ve been feeling this pressure to keep up with Jon Yongfook who is doing Pieter Levels’ “12 startups in 12 months” challenge. He’s already launched 3 startups since September!

I livestreamed GhostiFi development for about 2 hours last night, and it was a very productive session this time. Here’s what I was able to get working:

  • Refactored the existing script to improve code reusability. I moved the SQLAlchemy classes into “” then imported them into “”, “”, “”, “”, and “”.
  • Refactored the server.rebuild() function to accommodate different types of rebuilds — “rebuild now” or “rebuild schedule”
  • Wrote the rebuild daily/weekly/monthly scripts which will run on crons, rebuilding servers according to the users’ Rebuild Scheduler preferences.
  • Wrote — resets bandwidth tracking back to 0 for each server. Will run on a monthly cron.
  • Wrote some code to handle “Random” VPS location option by selecting a random number between 0 and 14, then inputting that into a list which returns the datacenter code of a real location to use in the Vultr API call.
  • Tested extensively, and was able to get everything working!

With the backend done, I can finally move on to making the user interface. My next post will probably be writing the pseudocode for that.

It’s going to be integrated into WordPress. Will be writing PHP, HTML, CSS, Javascript, and it will include a “mini API” built into the dashboard page to handle backend requests without having to refresh the page.

Closing thoughts

I hope this is helpful for anyone who is an aspiring programmer or entrepreneur to see my thought process and the journey from idea, to sketched interface, pseudocode, and finally actual code.

If you have any feedback on how I could improve this please let me know in the comments section!

If you want to know when I release another post about building GhostiFi, you can follow me on Twitter: @_rchase_ or Medium: Reilly Chase

User Dashboard (PHP frontend)

Python Scripts (Backend)





Reilly Chase

Written by

I help IT providers with Ubiquiti server hosting ➡️