Skip to content

DiscordDungeons/Shurlix

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

A simple but awesome URL Shortener
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

Shurlix main screen

Shurlix is a high-performance URL shortener built with Rust, designed for fast link shortening, custom slugs, and secure link management. Shurlix includes user authentication, link analytics*, and an easy-to-use API for seamless integration.

* Yet to be implemented.

Features

  • Custom Slugs: Create memorable, custom short links.
  • Authentication: Secure your short links with user-based access.
  • Link Analytics*: Track link usage statistics.

* Yet to be implemented.

Project Structure

  • Frontend: Built with Preact, focusing on lightweight and fast performance.
  • Backend: Powered by Axum and Diesel for efficient data handling and API responses.
  • Database: PostgreSQL is used to manage user data and link storage.
  • Authentication: Session tokens are used for secure user identification.

(back to top)

Getting Started

Prerequisites

  • Rust (latest stable version)
  • NodeJS
  • PostgreSQL (configured database for Shurlix)
  • Docker (optional, for containerized deployment)

Installation

  1. Clone the repository:

    git clone https://github.com/DiscordDungeons/Shurlix.git
    cd Shurlix
  2. Environment Configuration

    Create a .env file in the root directory to manage configuration details for the application. Use the provided .env.example as a template:

    cp .env.example .env
  3. Database Setup

    1. Navigate to the crates/db directory, where migrations and database configurations are managed:
      cd crates/db
    2. Install Diesel CLI if you haven’t already:
      cargo install diesel_cli --no-default-features --features postgres
    3. Run the database migrations to set up the tables and initial schema:
      diesel migration run
    4. Once migrations are complete, navigate back to the project root:
      cd ../../
  4. Frontend Setup

    1. Move to the crates/frontend directory, where the Preact frontend code resides:

          cd crates/frontend
    2. Install dependencies using your package manager (e.g., npm or yarn):

      npm install
      # or
      yarn install
    3. Start the frontend development server:

      npm run dev
      # or
      yarn dev

      The frontend will start on http://localhost:5173 by default.

    4. Return to the root directory after setting up the frontend:

      cd ../../
  5. Starting the Backend

    Now that the environment, database, and frontend are configured, you can start the backend server:

    cargo run

    The backend server will run on http://localhost:3000 by default.

(back to top)

Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • Proper readme
  • Proper docs
  • User interface
    • Login / Create user
      • Email verification
      • 2fa
    • Enable / Disable user creation
    • Dashboard
      • Links dashboard (overview, deletion, etc)
      • User settings
        • Update email & username
        • Change password
        • Delete account
    • Initial setup flow
      • Add admin account
      • Setup first domain
      • Check settings (move them into .yml file)
  • Enable / Disable anonymous shortening
  • API
    • Links
      • Handle multiple urls
      • Create links
      • Read links
        • By user
        • All
          • As admin
          • As user
      • Delete links
        • As user
        • As admin

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

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

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Top contributors:

contrib.rocks image

License

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

(back to top)

Contact

Project Link: https://github.com/DiscordDungeons/Shurlix

(back to top)