So, for my next project I have to learn how to make a website. I dabbled in PHP and html when I was 17. Needless to say, I know jack shit about the current state of web design.
This was my thought process:
Let’s start with a basic google search “How to build a web app”:
Most popular choice these days seems to be either PHP or Python?
Let’s go with PYTHON
Looks like I need a framework to make things a bit easier and to avoid boilerplate code:
Most popular ones seem to be Django and Flask:
Let’s go with FLASK because it’s simpler and more flexible (even though more limited).
Where do I host the site? Heroku? Linode? EC2? Shared hosting?
I don’t want shared hosting so Dreamhost, my current provider is out for this project.
I’ve used Heroku before so let’s find out a bit more about whether or not I should use it:
Linode and EC2 are unmanaged solutions. I don’t feel like learning server/ops, I’m just hacking something together so no need to learn everything in one go. Let’s save some time and go with Heroku which is fully managed. No need to worry about upgrading/managing servers.
Heroku tends to become prohibitively expensive once you get to a certain amount of traffic though. My goal is to get to Reddit and HN frontpage so how much would that cost?
OK so at the moment let’s go with HEROKU, then later on I can switch to Linode/EC2 if/when I get traffic
I want to set up Heroku with Flask:
Super basic setup to run my first Flask app. It’s running. Yay!
Let’s find out a bit more about Flask and build a basic app:
Looks like I’m going to need Twitter’s Bootstrap to make it look nice!
Should I use Bootflat? Looks even better than Bootstrap.. but based on older Bootstrap version..
Holy crap clusterfuck Bootstrap 3.3 vs 4. Need popper.js for Bootstrap 4???
OK in the end using Bootstrap 4 beta, looks to be working.
Let’s create a mysql database on Amazon RDS and connect through Flask.
SQLAlchemy? Do I need an ORM?
If I use it, I don’t need to write all the SQL CRUD queries from scratch, so yes let’s do it.
How do I connect?
Can connect and display data from the mysql database on the page.
Let’s create a form and put some stuff in the database.
Want to prevent bots from filling the form. Let’s use Google’s invisible RECAPTCHA api.
I want a location autofill in the form. Let’s use Google Map’s autofill api.
That’s where I’m at right now. Few more days of hacking and I’ll show you what I made 🙂
If you have any comments or noticed I did something stupid, do let me know in the comments.