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 |
- .NET 10 — ASP.NET Core + Blazor
- Entity Framework Core + Npgsql
- PostgreSQL
- Tailwind CSS
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 # APIRoute the root domain to Public — it owns the catch-all /{id} redirect — and give
Admin and API their own host or path.
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>).
Polishing the UI and backend.
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.
Distributed under the MIT License. See LICENSE for more information.