# 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 - Organize links into custom lists - Archive/unarchive links - Public and private lists - Modern, responsive web interface - Support for JavaScript-heavy sites using Puppeteer - Automatic fallback from HTTP scraping to browser rendering - LDAP authentication support - PostgreSQL database with automatic migrations ## Tech Stack - **Backend**: Express.js (Node.js) - **Frontend**: Vanilla JavaScript, HTML5, CSS3 - **Web Scraping**: Cheerio + Puppeteer (for JavaScript-heavy sites) - **Database**: PostgreSQL with Sequelize ORM - **Authentication**: LDAP (optional) ## Installation ### Prerequisites - Node.js 18+ (or Docker) - PostgreSQL 12+ (or Docker) - Chromium/Chrome (for Puppeteer support, optional) ### Local Installation 1. Clone the repository or navigate to the project directory: ```bash cd linkding ``` 2. Install dependencies: ```bash npm install ``` 3. Set up environment variables: ```bash cp .env.example .env # Edit .env with your database configuration ``` 4. Start PostgreSQL database and the application: ```bash make dev ``` Or manually: ```bash # Start PostgreSQL (using docker-compose) docker compose -f docker-compose.dev.yaml up -d # Start the application npm start ``` 5. Open your browser to `http://localhost:3000` **Note**: On first startup, the application will: - Create database tables automatically - Migrate any existing JSON files (`data/links.json` and `data/lists.json`) to the database - Rename migrated JSON files to `*.json.bak` ### Docker Installation 1. Set up environment variables: ```bash cp .env.example .env # Edit .env with your database configuration (or use defaults) ``` 2. Use Docker Compose (recommended): ```bash docker-compose up -d ``` This will start both PostgreSQL and the LinkDing application. 3. Access the application at `http://localhost:3000` **Note**: The Docker Compose setup includes: - PostgreSQL database with persistent volume - LinkDing application container - Automatic database initialization and migrations ## Usage 1. **Add a Link**: Paste a URL into the input field and click "Add Link" 2. **Search**: Use the search bar to filter links by title, description, or URL 3. **View Links**: Browse your saved links with images, titles, and descriptions 4. **Organize Links**: Create lists and assign links to them 5. **Archive Links**: Archive links to hide them from the main view 6. **Public Lists**: Make lists public to share them with unauthenticated users 7. **Delete Links**: Click the "Delete" button on any link card to remove it ## API Endpoints ### Links - `GET /api/links` - Get all saved links (authenticated users see all, unauthenticated see only public lists) - `GET /api/links/search?q=query` - Search links - `POST /api/links` - Add a new link (body: `{ "url": "https://example.com" }`) - Requires authentication - `PATCH /api/links/:id/archive` - Archive/unarchive a link (body: `{ "archived": true }`) - Requires authentication - `PATCH /api/links/:id/lists` - Update link's lists (body: `{ "listIds": ["uuid1", "uuid2"] }`) - Requires authentication - `DELETE /api/links/:id` - Delete a link by ID - Requires authentication ### Lists - `GET /api/lists` - Get all lists (authenticated users see all, unauthenticated see only public) - `POST /api/lists` - Create a new list (body: `{ "name": "List Name" }`) - Requires authentication - `PUT /api/lists/:id` - Update a list (body: `{ "name": "New Name" }`) - Requires authentication - `PATCH /api/lists/:id/public` - Toggle list public status (body: `{ "public": true }`) - Requires authentication - `DELETE /api/lists/:id` - Delete a list by ID - Requires authentication ### Authentication - `GET /api/auth/status` - Check authentication status - `POST /api/auth/login` - Login with LDAP credentials (body: `{ "username": "user", "password": "pass" }`) - `POST /api/auth/logout` - Logout ## Metadata Extraction The application automatically extracts: - **Title**: From Open Graph tags, JSON-LD structured data, or HTML `