Skip to content

raffomania/linkblocks

Repository files navigation

linkblocks

📚 A federated network to bookmark, share and discuss good web pages with your friends.

It's getting harder and harder to find good web pages. When you do find good ones, it's worth hanging onto them. Linkblocks is your own small corner of the web, where you can keep your favorite pages, and share them with your friends to help them find good web pages too.

🔭 Linkblocks is in an exploratory phase where we're trying out different ways to make it work well. You can try it out, but big and small things might change with every update.

Vision

  • On linkblocks, you can organize, connect, browse and search your favorite web pages.
  • Share carefully curated or wildly chaotic collections of the stuff you really really like with other linkblocks users and the whole world wide web.
  • Follow users with a similar taste and get a feed of fresh good web pages every day. Browse others' collections to discover new web pages from topics you like.
  • Annotate, highlight and discuss web pages together with your friends.
  • Mark users as trusted whose standards for web pages match yours - and then search through all trusted bookmarks to find good pages on a specific topic. Add trusted users of your trusted users to your search range to cast a wider net.

See this blog post for more on the vision behind linkblocks.

Related Reading

Development Setup

Install the dependencies:

  • Latest stable version of Rust (An older version might work as well, but is not tested)
  • mkcert
    • Don't forget to run mkcert -install
  • Optional: podman, for conveniently running postgres for development and tests
  • Optional: npm or a compatible package manager, to format template files

Install dependencies available via cargo:

cargo install cargo-run-bin

Copy .env.example to .env and edit it to your liking.

Optional: run just install-git-hooks to automatically run checks before committing.

In the root of the repository, launch the server:

cargo bin just watch

Then, open [http://localhost:4040] in your browser.

Testing SSO with Rauthy

  1. Run just start-rauthy to run rauthy in development mode in a container.
  2. Open rauthy in your browser by going to localhost with the port specified by RAUTHY_PORT in your .env file.
  3. Go to the admin area and log in as admin@localhost.de with the password test.
  4. Create a new client. Use {BASE_URL}/login_oidc_redirect as your redirect URI, with the base URL defined in your .env file. Set access and id algorithm to one starting with "RS".
  5. Enter your client ID and secret in your .env file.
  6. Restart the linkblocks server. On the login page, there should be a "Sign in with Rauthy" button. If it's not there, check the server logs to see if something related to OIDC went wrong.

Hosting Your Own Instance

⚠️ linkblocks is in a pre-alpha stage. There are no versions and no changelog. All data in the system will be publicly available. There are no authorization checks. Expect data loss.

You can run the container at ghcr.io/raffomania/linkblocks:latest. It's automatically updated to contain the latest version of the main branch.

Linkblocks is configured through environment variables or command line options. Run linkblocks --help to for documentation on the available options. The [.env.example] file contains an example configuration for a development environment.

Technical Details

This web app is implemented using technologies hand-picked for a smooth development and deployment workflow. Here are some of the features of the stack:

  • Type-safe and fast, implemented in Rust using the axum framework
  • Snappy interactivity using htmx with almost zero client-side code
  • Tailwind styles without NodeJS, integrated into the cargo build process using build scripts
  • Compile-time verified HTML templates using Askama
  • Compile-time verified database queries using SQLx
  • Concurrent, isolated integration tests with per-test in-memory postgres databases
  • Single-binary deployment; all assets baked in
  • Integrated TLS; can run without a reverse proxy
  • PostgreSQL as the only service dependency
  • Built-in CLI for production maintenance
  • Auto-reload in development without dropped connections