Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

fbsamples/rusty-bunny

Repository files navigation

Rusty Bunny

Contributors Forks Stargazers Issues License


rusty-bunny

rusty-bunny is a mini-clone of bunny1
"a tool that lets you write smart bookmarks in [rust] and then share them across all your browsers..."
Explore the docs »

View Demo · Report Bug

Table of Contents

About the Project

The idea for this project came after learning about bunny1 and using it at work. I really enjoyed it and thought, "I wonder if I could build my own from scratch?" so this is it!

Demo

rusty-bunny demo

This is what rusty-bunny looks like in action.

Built With

Getting Started

To get a local copy up and running follow the simple steps under either of the following sections:

  • Manual Setup – follow this if you prefer to install all dependencies locally.
  • VSCode Dev Container Setup – follow this to run the project in an isolated development environment inside a Docker container, pre-installed with all dependencies.

Manual Setup

Prerequisites

Make sure you have Rust installed.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Rocket uses the nightly version of Rust so make sure you use that. If you'd like to only use nightly for this project, you can run this from the root of the project after cloning.

# from the root of the project
rustup override set nightly

Installation

  1. Clone the rusty-bunny
git clone https://github.com/fbsamples/rusty-bunny.git
  1. Make sure you're using nightly
cargo --version
  1. Build the project
cargo build
  1. Follow the instructions in the Running section.

VSCode Dev Container Setup

Prerequisites

This requires VSCode, Docker and the Remote Development extension pack. For more details see the official docs.

Spinning Up The Environment

  • Follow the official guide to open this repository inside a dev container. VSCode will read the config file provided to auto-install relevant dependencies and extensions.
  • To run terminal commands, use the integrated terminal functionality.

Running

  1. Run the project
cargo run
  1. Visit localhost:8000
  2. To test a command, go to localhost:8000/search?cmd=tw and you should be redirected to Twitter

Testing

Run the following command

cargo test

Usage

To test out a command, type in http://localhost:8000/search?cmd= followed by your command.

The following commands are supported by rusty-bunny:

  • "tw" -> redirects to twitter.com
  • "tw @username" -> redirects to twitter.com/username
  • "gh" -> redirects to github.com
  • "gh username" -> redirects to github.com/username
  • "gh username/repo" -> redirects to github.com/username/repo

Everything else redirects to a google search with your query.

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. See CONTRIBUTING for more information.

License

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

Contact

If you have questions or thoughts on this project, feel free to send them my way by @'ing me on Twitter or shooting me a DM.

Joe Previte - @jsjoeio

Acknowledgements

About

a tool that lets you write smart bookmarks

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages