hako/README.md
Felipe M. 369da5f151
feat(e2e): add HTML report generation with embedded screenshots
Implements HTML report generation for E2E tests following the Shiori
pattern. Reports are self-contained with base64-embedded screenshots
for easy review in CI/CD pipelines.

Changes:
- Add e2e/e2eutil/reporter.go: HTML report generator with singleton
  pattern, collects test results and assertions
- Enhance e2e/e2eutil/helper.go: Integrate reporter to automatically
  record assertions with screenshots on failures
- Update e2e/playwright/login_test.go: Add TestMain to initialize
  reporter and generate HTML report after tests complete
- Update .gitignore: Exclude test artifacts (screenshots, test-results,
  test binaries)
- Update .woodpecker/ci.yml: Add e2e step with artifact generation
- Fix webapp/src/services/auth.ts: Remove trailing newline

Features:
- Single self-contained HTML file with inline CSS
- Base64-encoded screenshots embedded as data URIs
- Visual styling (green for pass, red for fail)
- Timestamps and detailed assertion information
- Thread-safe reporter for concurrent test execution
- Automatic screenshot capture on assertion failures

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 18:45:09 +01:00

110 lines
2.4 KiB
Markdown

# Hako
Hako is a self-hosted link archival service that automatically saves and preserves web content. Save URLs and let Hako archive them using multiple archival methods, extract content for full-text search, and organize your saved links with categories.
## Features
- **Link Archival**: Save URLs and automatically archive web content.
- **Multiple Archivers**: Support for different archival methods depending on the site or content type.
- **Content Extraction**: Extract text content from PDFs and web pages for full-text search
- **Rule Engine**: Configurable rules that automatically select appropriate archivers based on URL patterns, hostnames, and content types
- **Categories**: Organize links in categories.
- **Archive History**: Track multiple archive versions for each link if archived multiple times.
- **Full-Text Search**: Search through archived content.
- **Self-Hosted**: Full control over your archived data
## Tech stack
- Go
- Vue 3
- Bun
## Screenshots
See [docs/screenshots](docs/screenshots.md).
## Running the Application
This project uses a Makefile for common tasks. Run `make help` to see all available commands.
### Backend
To build and run the backend:
```bash
# Build the webapp (required for embedded frontend)
make build-webapp
# Run the server only (without building webapp)
make run-server
```
### Frontend
The frontend is built with Vue.js and Vite, using Bun as the package manager:
```bash
# Run the webapp in development mode with hot-reload
make run-webapp
# Build the webapp for production
make build-webapp
```
## Docker
### Running with Docker Compose
To run Hako locally using Docker Compose:
```bash
# Build the docker binaries
make build-docker
# Start the container
docker compose up
# Or run in detached mode
docker compose up -d
```
The service will be available at `http://localhost:8080`.
### Building Docker Images
To build Docker images using goreleaser (for production builds):
```bash
# Build Docker image locally (creates multi-arch images)
make build-docker
```
This will build Docker images for multiple architectures (amd64, arm64, armv7) using goreleaser.
## Development
### Development Commands
Common development tasks:
```bash
# Run linting (server and webapp)
make lint
# Run test suite
make test
# Run integration tests
make e2e
# Format code
make format
# Clean build artifacts
make clean
# Clear dev data (keeps config.yaml)
make clean-devdata
```
Run `make help` to see all available commands.