initial stock report portal

This commit is contained in:
houhuan
2026-08-16 17:23:53 +08:00
commit b6a433ed40
11 changed files with 222 additions and 0 deletions
@@ -0,0 +1,54 @@
# Stock Report Portal Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Build a static stock-report portal with category navigation, calendar browsing, indexed HTML reports, and an upload-friendly rebuild script.
**Architecture:** A single-page vanilla JavaScript application reads `data/reports.json`, renders category/month/date views, and opens source HTML reports from `reports/`. A Node.js script scans report paths and emits the index, keeping storage simple and automation-friendly.
**Tech Stack:** HTML5, CSS3, vanilla JavaScript, Node.js standard library only.
## Global Constraints
- No database, framework, or runtime server is required to serve the site.
- Report storage uses `reports/<category>/<YYYY>/<MM>/`.
- The browser-facing index contract uses `data/reports.json`.
- Empty and malformed data must render a recoverable empty state.
---
### Task 1: Create the static portal shell
**Files:**
- Create: `index.html`
- Create: `styles.css`
- Create: `app.js`
- Create: `data/reports.json`
- [ ] Add semantic layout for sidebar categories, dashboard header, calendar, report list, and recent reports.
- [ ] Add responsive CSS with a dark research-terminal visual style and accessible focus states.
- [ ] Implement loading of `data/reports.json`, category filtering, month navigation, date selection, search, and report links.
- [ ] Seed representative records and make all relative paths deploy-safe.
### Task 2: Add representative report fixtures and index rebuild tooling
**Files:**
- Create: `reports/daily-review/2026/08/2026-08-16-market-review.html`
- Create: `reports/intraday/2026/08/2026-08-16-ai-sector.html`
- Create: `scripts/build-index.mjs`
- Create: `README.md`
- [ ] Write the rebuild script using Node standard library and the filename convention `YYYY-MM-DD-slug.html`.
- [ ] Preserve category labels and derive title, summary, tags, and path for each record.
- [ ] Add deployment and automation instructions, including the upload-then-rebuild workflow.
- [ ] Run the rebuild script and verify the generated JSON contains both fixtures.
### Task 3: Validate the complete static site
**Files:**
- Modify: `data/reports.json`
- [ ] Run `node scripts/build-index.mjs`.
- [ ] Serve the root with a local static server and request `index.html`, `app.js`, and both report files.
- [ ] Parse the generated JSON and verify every indexed path exists.
- [ ] Check the site for broken relative references and report the final upload directory.