Chad Krause

A small blog about my projects

Category: Programming

How To Broach In Fusion 360
How to linear broach in Fusion 360

Chad's URL Shortener Part 4 - Done for a bit

Front End Time

4/7/2018 2:00PM

I chose Angular. I use material design most of the time but I want to change things up. I will use PrimeNG for my UI because I want to try something new.

Here's the plan:

  1. Make a simple simple simple front page. You paste the link, I give you shorter link. Single page only.
  2. Make about us page (eventually)
  3. Make statistics page. PrimeNG makes it easy to display graphs so why not? You paste my link, and I'll show you the statistics.

Will this site be popular? Absolutely not. I will be shocked if anyone uses it besides me. But it will be cool, and I need something t...

Chad's URL Shortener Part 3 - Meat & Bones

4/2/2018 1:00PM

What have I done so far, code wise?

  • Designed database
  • Wrote migrations

I'm going to avoid making this a How-To and more of just sprawl of my thoughts

4/2/2018 4:00PM

I have done some more work:

  • Created models for my database
  • Created and connected database to project
  • Made RedirectController
  • New Log table for short codes that aren't valid

So far, if you go to a vaild short code, it will return some JSON that includes the model for the URL and the IPAddress:

http://127.0.0.1:8000/chad

[
    {
        "id": 1,
        "url": "https://chadkrause.com",
        "short_code": "chad...

Chad's URL Shortener Part 2 - Database and Project Setup

So now it's time to get to some code. However, some planning is required. How is this database going to look?

I have 3 tables in mind so far:

  • urls and their shortened code
  • clicks and user information
  • IP Address - to save on database space

For now, it looks like this:

Starting the project

Like I said in the intro, I am going to use laravel. I created a new project, now I need to make a database migration:

php artisan make:migration inital_schema

And I need to fill it in. Note that it's not exact because I'm still learning.

class InitalSchema extends Migration
{
    /**
     * Run the migrati...