3.7 KiB
LinkDing
LinkDing is a minimal bookmarking application where you can paste links and get a list of links with title, description, and image. After a link is pasted, the page is scraped for metadata including the main image that is then displayed in the link list.
Features
- Paste links and get a list of links with title, description, and image
- Automatic metadata extraction
- Search functionality by title, description, and URL
- Modern, responsive web interface
- Support for JavaScript-heavy sites using Puppeteer
- Automatic fallback from HTTP scraping to browser rendering
Tech Stack
- Backend: Express.js (Node.js)
- Frontend: Vanilla JavaScript, HTML5, CSS3
- Web Scraping: Cheerio + Puppeteer (for JavaScript-heavy sites)
- Data Storage: JSON file
Installation
Prerequisites
- Node.js 18+ (or Docker)
- Chromium/Chrome (for Puppeteer support, optional)
Local Installation
-
Clone the repository or navigate to the project directory:
cd linkding -
Install dependencies:
npm install -
Start the server:
npm start -
Open your browser to
http://localhost:3000
Docker Installation
-
Build the Docker image:
docker build -t linkding . -
Run the container:
docker run -d \ --name linkding \ -p 3000:3000 \ -v $(pwd)/data:/app/data \ linkdingOr use Docker Compose:
docker-compose up -d -
Access the application at
http://localhost:3000
Usage
- Add a Link: Paste a URL into the input field and click "Add Link"
- Search: Use the search bar to filter links by title, description, or URL
- View Links: Browse your saved links with images, titles, and descriptions
- Delete Links: Click the "Delete" button on any link card to remove it
API Endpoints
GET /api/links- Get all saved linksGET /api/links/search?q=query- Search linksPOST /api/links- Add a new link (body:{ "url": "https://example.com" })DELETE /api/links/:id- Delete a link by ID
Metadata Extraction
The application automatically extracts:
- Title: From Open Graph tags, JSON-LD structured data, or HTML
<h1>/<title>tags - Description: From meta tags, structured data, or page content
- Images: Prioritizes product container images, then meta tags, with smart fallbacks
Image Extraction Priority
- Product container images (
.product-container img, etc.) - Product-specific image containers
- Open Graph / Twitter Card meta tags
- JSON-LD structured data
- Generic product selectors
- Fallback to meaningful images
Environment Variables
PORT- Server port (default: 3000)CHROME_EXECUTABLE_PATH- Path to Chrome/Chromium executable (for Puppeteer)NODE_ENV- Environment mode (production/development)
Data Storage
Links are stored in data/links.json. Make sure this directory exists and is writable. When using Docker, mount the data directory as a volume for persistence.
Troubleshooting
Puppeteer Issues
If you encounter issues with Puppeteer:
- NixOS: The app uses
puppeteer-coreand automatically detects system Chromium - Docker: Chromium is included in the Docker image
- Manual Setup: Set
CHROME_EXECUTABLE_PATHenvironment variable to your Chromium path
403 Errors
Some sites block automated requests. The app automatically:
- First tries HTTP requests with realistic headers
- Falls back to Puppeteer for JavaScript rendering if blocked
- Uses system Chromium for browser automation
Development
# Install dependencies
npm install
# Run in development mode with auto-reload
npm run dev
# Start production server
npm start
License
ISC