Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
agene0001Public

About

Pulse — trend-to-content opportunity engine (Tauri 2 + Rust)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Pulse — Trend-to-Content Opportunity Engine

Fuses trend velocity, news freshness, and SEO opportunity into one ranked feed of content ideas, each carrying an evidence trail ("here's why this is worth writing about"). See pulse_product_spec.md for the full vision.

This repo is the Phase 0 / Phase 1 foundation: a compiling, end-to-end Rust workspace behind a Tauri 2.x shell with a SvelteKit feed view.

Workspace layout

pulse/
├── crates/
│   ├── pulse-core/      # domain types: Topic, TrendSignal, KeywordEvidence, ContentIdea
│   ├── pulse-ingest/    # TrendSource trait + adapters (Google Trends/News later)
│   ├── pulse-seo/       # KeywordDataSource trait (Phase 2 evidence layer)
│   ├── pulse-scoring/   # deterministic opportunity-scoring engine
│   ├── pulse-storage/   # Storage trait + in-memory impl (Postgres/DuckDB later)
│   └── pulse-service/   # transport-agnostic orchestration
├── src-tauri/           # Tauri 2.x shell
└── frontend/            # SvelteKit: ranked feed + evidence drill-down

Status vs. spec roadmap

Pillar State
2.1 Trend ingestion live Google Trends RSS — google (reqwest) or scraprs (scraprs HttpFetcher) feature; synthetic source for offline/dev
2.2 News correlation live — articles bundled in the Trends RSS, persisted per topic
2.3 SEO evidence live free-signal source (autocomplete + PAA + SERP competition) via the scraprs feed
2.4 Opportunity scoring implemented + tested; seo_opportunity now refined with live SERP competition (untuned weights)
Storage in-memory (default) + Postgres via dbkit-rs (postgres feature); DuckDB reads deferred

Live ingestion

By default the app uses a synthetic, offline trend source (deterministic, great for dev). Enable a real-ingestion feature to pull live trending topics from Google's public trending-searches RSS — which bundles correlated news per trend, so one fetch yields both the trend and its news hook:

  • --features google — plain reqwest.
  • --features scraprs — routed through scraprs's standalone HttpFetcher (the sibling scraping framework; takes precedence over google).
bun  run tauri dev -- --features scraprs (or swap bun with npm)
# combine with persistence:  --features scraprs,postgres

Each launch/refresh polls the feed once; velocity & staleness build up across refreshes.

The scraprs feature also turns on the Phase 2 SEO layer: each new topic is enriched (once) with free keyword signals — Google autocomplete, PAA-style questions (via question-modifier autocomplete), and a competition score from how many top DuckDuckGo results sit on high-authority domains. That competition score feeds the seo_opportunity term, so low-saturation topics rank up. (Enrichment hits a handful of endpoints per topic — keep refreshes occasional; spec §11.5.) Deeper signals (interest-over-time from the explore API, real Google SERP) are the next upgrade, via scraprs's AutoFetcher + antibot behind the same traits.

Storage backends

  • In-memory (default) — zero infrastructure; the whole pipeline runs out of the box.

  • Postgres via dbkit-rs — the §6 schema (hash-tracked migration), behind the same Storage trait. Enable with the postgres feature and point DATABASE_URL at a database:

    DATABASE_URL=postgres://$(whoami)@localhost:5432/pulse \
      bun run tauri dev -- --features postgres (or swap bun with npm)
    # or: cargo run -p pulse-app --features postgres

    When DATABASE_URL is unset (or connection fails), the app falls back to in-memory. DuckDB analytical reads (spec §6) are a future enhancement on the same backend — dbkit-rs exposes with_duckdb() + Arrow for it.

    To run the Postgres integration test against a throwaway database:

    # Include an explicit user — dbkit-rs 0.5 (sqlx) defaults a bare URL's role to
    # "anonymous" (unlike psql, which uses your OS user).
    PULSE_TEST_DATABASE_URL=postgres://$(whoami)@localhost:5432/pulse_test \
      cargo test -p pulse-storage --features postgres

Deliberate Phase 0 choices

  • Storage defaults to in-memory so the skeleton runs with zero infrastructure, matching the spec's "validate the scoring mechanism cheaply first" philosophy (§2.7, §11.2). The Postgres backend (above) drops in behind the same trait.
  • Ingestion sources are stubs that emit synthetic signals, so the full ingest → score → feed pipeline runs today. The real scraprs-backed Google Trends / News adapters (spec §2.1, §9) slot in behind TrendSource.
  • Async traits use async-trait so sources/storage stay dyn-compatible (Box<dyn TrendSource>), matching the pluggable-source pattern in spec §8.

Quick start

# Rust core: build + test (no infrastructure needed)
cargo test

# Run the headless end-to-end demo (ingest → score → ranked feed)
cargo run -p pulse-service --example demo

Desktop app

bun install (or npm)                # root: installs the Tauri CLI
bun install --prefix frontend (or npm)  # frontend deps (SvelteKit + @tauri-apps/api)
bun run tauri dev  (or npm)         # builds the frontend, compiles the shell, opens the window

bun run tauri dev runs from the repo root. The first launch seeds a short synthetic trend history so the feed isn't empty; hit ↻ Refresh in the app to run another ingest + rescore cycle.

Note — building on an exFAT volume. This repo lives on an exFAT drive, which can't store macOS extended attributes or hard-link — which breaks Tauri's build script (it chokes on the ._* AppleDouble files macOS scatters). So build artifacts go to a shared APFS disk image instead: ./target is a git-ignored symlink to /Volumes/Build/pulse. Run mount-build once per login session (it's on your PATH; idempotent), then build any project as usual. Unmount everything with hdiutil detach /Volumes/Build. If a Tauri build ever fails with "stream did not contain valid UTF-8", the target isn't on the image — check that mount-build ran.

About

Pulse — trend-to-content opportunity engine (Tauri 2 + Rust)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages