Skip to content

Latest commit

 

History

History
92 lines (59 loc) · 2.68 KB

File metadata and controls

92 lines (59 loc) · 2.68 KB

Getting Started

Welcome to the URL Shortener sample project. This guide will help you set up the application locally and understand the basic workflow.

Prerequisites

  • .NET 10.0.xDownload here
  • Git — For cloning and version control
  • A text editor or IDE — Visual Studio, Visual Studio Code, or Rider are recommended

Local Setup

1. Clone the Repository

git clone https://github.com/mddennis-emburse/si-test.git
cd si-test

2. Restore Dependencies

dotnet restore UrlShortener.slnx

3. Build the Solution

dotnet build UrlShortener.slnx -c Release

4. Run the Application

dotnet run --project src/UrlShortener.Web/UrlShortener.Web.csproj

The application will start on http://localhost:5000 by default.

First Steps

Once the application is running:

  1. Shorten a URL — Navigate to the home page and use the form to convert a long URL into a short code

    • Enter any valid HTTP/HTTPS URL
    • The system generates a 7-character short code
    • Copy the short link to share with others
  2. Use your shortened link — Share the /r/{shortCode} link with others or test it directly

    • The redirect endpoint automatically tracks click counts
    • You'll be redirected to the original URL with a 302 status code
  3. View your links — Visit /links to see your complete inventory

    • Browse all created links with their short codes, destinations, creation date, and click counts
    • See a statistics dashboard showing total links, active links, and total click volume

Stopping the Application

Press Ctrl+C in the terminal where the application is running.

Troubleshooting

Port Already in Use

If port 5000 is already in use, you can specify an alternative port:

dotnet run --project src/UrlShortener.Web/UrlShortener.Web.csproj -- --urls "http://localhost:5001"

Build Failures

Ensure you have .NET 10.0.x installed:

dotnet --version

If you're on an older version, update by following the official installation guide.

Database Issues

The SQLite database is automatically initialized on first run at App_Data/url-shortener.db. If you encounter database errors:

  1. Delete the App_Data folder in the application directory
  2. Restart the application — a fresh database will be created

Next Steps

  • Learn the Architecture — Read Architecture to understand system design
  • Contribute — See Developer Guide for how to make changes
  • Follow Development — Check Phase Blog for feature updates and progress