Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

HuskyNZ's Url Shortner


Contributors Issues License

About The Project

A URL shortener built on .NET 10, split into three deployable services (public web, admin console, and API) backed by PostgreSQL. It provides short-path redirects, a public link listing, a password-protected link flow, an admin panel with analytics, and an API-key–authenticated JSON API.

Project Role
UrlShortener.Public Blazor SSR — public site, /{id} redirects, link hub
UrlShortener.Admin Blazor Interactive Server — admin console
UrlShortener.Api ASP.NET Core Web API — /api/*, API-key auth
UrlShortener.Shared EF Core data layer, services, auth, caching

Built With

How to run?

You need a PostgreSQL instance and the .NET 10 SDK. Point the services at your database and run them — each applies the schema itself on startup (idempotent):

export ConnectionStrings__Postgres="Host=localhost;Port=5432;Database=urlshortener;Username=postgres;Password=postgres"

dotnet run --project src/UrlShortener.Public   # public site
dotnet run --project src/UrlShortener.Admin    # admin console
dotnet run --project src/UrlShortener.Api      # API

Route the root domain to Public — it owns the catch-all /{id} redirect — and give Admin and API their own host or path.

Configuration

Every setting is documented in .env.example. The ones you are most likely to touch:

  • ConnectionStrings__Postgres — database connection.
  • UrlShortener__{UrlsTable,AdminsTable,ApiKeysTable} — table names.
  • UrlShortener__RedirectCacheTtlSeconds — redirect cache TTL.
  • Auth__CookieDomain + DataProtection__KeyRingPath — set both (shared parent domain and shared key ring) if you want the Admin session cookie to also authenticate the API. Otherwise the API is used via API keys (X-API-Key / Authorization: Bearer <key>).

Roadmap

Polishing the UI and backend.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit a file with necessary changes. I only accept incoming pull requests on the dev branch for my sanity
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.

License

Distributed under the MIT License. See LICENSE for more information.

Authors

Acknowledgements

About

Mirror of HuskyNZ's URL shortner

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages