Code Monkey home page Code Monkey logo

blazorshortener's Introduction

BlazorShortener

BlazorShortener is a simple and small but complete URL shortener application, created in C# with Blazor Server .NET 7.0, and several essential NuGet packages. This is a simple URL shortening solution with features like captcha verification, Let's Encrypt integration, SQLite database for link management, and a (in my opinion) visually appealing interface.

Project Dependencies

Project Overview

  • Captcha Integration: BlazorShortener uses the BlazorVerificationCaptcha library to implement an easy-to-use captcha solution generated on the server. If running on a Linux server, ensure all SkiaSharp dependencies are installed.

  • Secure HTTPS Connections: Integration with LettuceEncrypt allows for seamless domain integration with Let's Encrypt. Simply update the appsettings.json file with the required information.

  • SQLite Database: BlazorShortener utilizes a small SQLite database named "BlazorShortener.db" with tables for managing short and long URLs, as well as tracking user access (be sure to include this in the privacy policy!)

  • Homepage Design: The homepage features buttons linking to your GitHub profile, the homepage, and a privacy policy template. The dynamic background is fetched from Unsplash's collection (ID: 772336) on each page load.

  • MudBlazor Styling: The project uses MudBlazor for styling components. Notably, toast messages provide user feedback on actions like successful URL shortening, captcha errors, etc.

Installation and Usage

  1. If you dont't want to use LettuceEncrypt:

    • You need to comment out following lines in the program.cs:
    • builder.Services.AddLettuceEncrypt();
     builder.WebHost.UseKestrel(k =>
     {
         IServiceProvider appServices = k.ApplicationServices;
         k.Listen(
             IPAddress.Any, 443,
             o => o.UseHttps(h =>
             {
                 h.UseLettuceEncrypt(appServices);
             }));
     });
    
    • or at least the h.UseLettuceEncrypt(appServices); inside builder.WebHost.UseKestrel()
  2. Install .NET 7 Runtime (Including ASP.NET):

    • Ensure that you have the .NET 7 runtime installed, including ASP.NET support. You can download it from dotnet.microsoft.com.
  3. Publish the Project:

    • Use the dotnet publish command to publish the project. For example: dotnet publish -c Release
    • Note: If you're using Visual Studio, you can also use its graphical interface to export projects.
  4. Configure Appsettings.json:

    • Make sure to configure the appsettings.json file with the required information for BlazorShortener, such as Let's Encrypt integration details and any other relevant settings.
  5. Run the Assembly:

    • After publishing, navigate to the published directory.
    • On Linux, you'll find a .dll file; on Windows, it will be a .exe file. (Depending on the command you used tho)
    • Run the assembly using the dotnet command line tools (Linux): dotnet BlazorShortener.dll
    • Or just run the .exe file on Windows (command line is still an option tho).
    • Ensure to check if everything works as expected.
  6. Access the Application:

    • Open your web browser and navigate to the appropriate URL where the application is hosted (e.g., http://localhost:5000 or the domain you are using).

By following these steps, you should have BlazorShortener up and running. If you encounter any issues during installation or have specific configuration requirements, refer to the project documentation or seek assistance in the GitHub repository issues.

Screenshots / Videos

Homepage

License

Software: BlazorShortener

License: GNU General Public License v3.0

blazorshortener's People

Contributors

liebki avatar

Watchers

 avatar

Forkers

nedimm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.