2.0 KiB
2.0 KiB
Fiscal Clone 3.0 (Turbopack Rebuild)
Ground-up rebuild into a single Next.js 16 application that runs with Turbopack and internal API routes.
What changed
- Removed hard runtime dependency on the external backend for core app workflows.
- Added internal
app/api/*services for watchlist, portfolio, filings, tasks, and health. - Added durable local data store at runtime (
frontend/data/store.json). - Added async task engine with retry support for:
sync_filingsrefresh_pricesanalyze_filingportfolio_insights
- Added OpenClaw integration through OpenAI-compatible
/v1/chat/completions. - Enforced Turbopack for both development and production builds.
Architecture
frontend/: full app (UI + API + task engine)frontend/app/api/*: route handlersfrontend/lib/server/*: storage, task processors, SEC/pricing adapters, OpenClaw clientfrontend/data/store.json: generated local runtime state (git-ignored)
The legacy backend/ folder is retained in-repo but no longer required for the rebuilt local workflow.
Run
cd frontend
npm install
npm run dev
Open: http://localhost:3000
Build (Turbopack)
cd frontend
npm run build
npm run start
OpenClaw setup
Set in environment (for example frontend/.env.local):
OPENCLAW_BASE_URL=http://localhost:4000
OPENCLAW_API_KEY=your_key
OPENCLAW_MODEL=zeroclaw
SEC_USER_AGENT=Fiscal Clone <support@fiscal.local>
If OpenClaw is not configured, the app falls back to local analysis responses so task flows remain testable.
API surface
GET /api/healthGET /api/meGET|POST /api/watchlistDELETE /api/watchlist/:idGET|POST /api/portfolio/holdingsPATCH|DELETE /api/portfolio/holdings/:idGET /api/portfolio/summaryPOST /api/portfolio/refresh-pricesPOST /api/portfolio/insights/generateGET /api/portfolio/insights/latestGET /api/filingsPOST /api/filings/syncPOST /api/filings/:accessionNumber/analyzeGET /api/tasksGET /api/tasks/:taskId