This project is a simple web application that allows users to organize and visualize their favorite links. It features:
- Displaying links categorized by topic.
- An API to add new links to specific categories.
- An API to create new categories.
- An API to reorder links within a category.
- Command Mode: A command-line interface accessible through the search bar (by starting with
:) allows you to perform actions::link-delete <name>: Deletes a link with the specified name.:category-delete <name>: Deletes an entire category with the specified name and all its links.:open <name>: Opens the link with the specified name in the current tab.:open-new-tab <name>: Opens the link with the specified name in a new tab.:toggle-forms: Toggle open the forms.:open-category <name>: Opens all links in a given category.:category-rename <name>: Renames a given category.:link-move-category <name> <category>: Move a link to another category.
- Command Autocomplete: When typing a command (starting with
:), the search bar will display a dropdown list of available commands as suggestions.
It's built using Deno, a simple, modern, and secure runtime for JavaScript and TypeScript.
To run this project, you need to have Deno installed on your system. Follow the instructions below based on your operating system.
Using a Package Manager:
You can also install Deno using a package manager:
- macOS (Homebrew):
brew install deno
- Linux (Debian/Ubuntu):
sudo apt update sudo apt install deno
- Linux (Arch Linux) using Pacman:
If you are using Arch Linux or a distribution based on it (like Manjaro), you can install Deno using the
pacmanpackage manager:sudo pacman -S deno
- Windows (Scoop):
scoop install deno
- Windows (Chocolatey):
choco install deno
After installation, you can verify that Deno is installed correctly by running the following command in your terminal:
deno --versiondeno run --allow-net --allow-read --allow-write server.ts- Organize Links: Drag individual link items within their categories to rearrange them.
- Reorder Categories: Drag entire category sections to change their order on the page.
- Command Mode:
- Focus on the search bar (you can use the
Escapekey as a shortcut). - Type a command starting with a colon (
:). - As you type, autocomplete suggestions for available commands will appear below the search bar.
- Use the up and down arrow keys to highlight a suggestion. The search bar will update with the highlighted command.
- Press Enter to execute the highlighted command.
- Alternatively, you can continue typing the command and press
Enterto execute it.
- Focus on the search bar (you can use the
- Search: (Placeholder - implement your search functionality in the
elseblock of thehandleCommandfunction inmain.js). - Clear Search Bar: Use
Alt + Backspaceto quickly clear the content of the search bar. - Focus Search Bar: Press the
Escapekey to quickly focus on the search bar.
- HTML: Structure of the page with categories and links.
- CSS (
style.css): Styling of the layout, categories, links, search bar, and autocomplete suggestions. - JavaScript (
main.js): Handles the interactive features:- Drag and drop functionality using the HTML5 Drag and Drop API.
- Event listeners for the search bar to enable command mode and autocomplete.
fetchAPI to communicate with the server for actions like deleting and reordering links/categories.
- Server (Deno): A simple Deno server (
server.ts) manages thelinks.jsonfile, providing and updating the link data.
/api/links(GET): Retrieves the initial link data./api/links(POST): Adds a new link to a category./api/categories(POST): Adds a new category./api/reorder-links(POST): Updates the order of links within a category (also used for deleting links by sending the updated list without the deleted link)./api/reorder-categories(POST): Updates the order of categories (also used for deleting categories by sending the updated list without the deleted category)./api/move-link(POST): Moves a link from one category to another. Expects a JSON body withlinkName,sourceCategory, andtargetCategory.
