Skip to content

kinson/LnK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lnk

Github Actions

Yet another URL shortener.

Getting Started

Before getting started, the following software needs to be installed:

Setup

From the project root, run make setup to:

  1. Download and start the database Docker image for Postgres
  2. Fetch & compile elixir dependencies
  3. Create & migrate the database
  4. Stop the Docker container

Start the Server

From the project root, run make server to:

  1. Start the Docker container
  2. Start the backend server
  3. Start the frontend web application
  4. Go to http://localhost:8080 to use the web application

Stop the Server

From the project root, run make stop to:

  1. Stop the backend server
  2. Stop the frontend server
  3. Stop the Docker container

Notes on Approach

Dark Mode Toggle

Full disclosure, I took these icons from a project I contributed them to previously, you can find that code here.

Using Next.js

I opted to use Next.js on the frontend because I have found it makes the spin up process for a new react app even quicker (at least for me) than create-react-app.

Using TypeScript

I have not used TypeScript on the frontend before (aside from React Native), but I opted to for this project because it feels like a safer choice than JavaScript in general and it provided piece of mind while rapidly developing this website.

Next Steps

I did not want to overengineer this project at the risk of making it too time consuming to reason about, but some things I would add in the future are:

  • A caching mechanism on the backend (possibly using this library) to avoid a round trip to the database when querying a url
  • Continuous deployment to a free-tier service from a web hosting service
  • Better API response validation and typing using TypeScript
  • A feature to let people choose custom shortened URLs

If you have made it this far, thanks for reading :)