initial commit — cassandra v0.1
Containerised macro-strategy dashboard: 4-panel web UI (indicators, portfolio, flash news, AI strategic log), MariaDB store, hourly ingestion jobs, OpenRouter-backed AI analysis. Ports the four prototype scripts in the parent dir (market_pulse, flash_news, trading212, strategic_log) into async services backed by a persistent DB and served via FastAPI + Jinja2 + HTMX. APScheduler runs as a separate compose service for crash-safety and easier restarts. Portfolio composition + position names come live from Trading 212; news per-ticker headlines reuse those names. Tone (NOVICE/INTERMEDIATE/ PRO) and analysis style (DRY/SPECULATIVE) are env-configurable and stored on each log row so historical entries show what produced them. Default model is deepseek/deepseek-v4-flash (overridable via env). Light/dark theme toggle, sans-serif for prose surfaces, monospace for data. Bearer-token auth, OpenRouter monthly cost cap, RSS feeds auto- disabled on consecutive failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
a10409c02b
61 changed files with 4890 additions and 0 deletions
55
app/templates/log.html
Normal file
55
app/templates/log.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Cassandra · Strategic Log{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<section class="panel log-page" style="grid-column: 1 / -1;">
|
||||
<div class="panel-header">
|
||||
<span class="title">Strategic Log Archive</span>
|
||||
<span class="meta">
|
||||
selected {{ selected_iso }}
|
||||
·
|
||||
<span class="meta__hint">new logs use:</span>
|
||||
<span class="badge badge--tone-{{ current_tone | lower }}">tone {{ current_tone | lower }}</span>
|
||||
<span class="badge badge--analysis-{{ current_analysis | lower }}">analysis {{ current_analysis | lower }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="log-page__body">
|
||||
<aside class="log-page__cal"
|
||||
hx-get="/api/log/days?month={{ selected_month }}&selected={{ selected_iso }}"
|
||||
hx-trigger="load"
|
||||
hx-swap="innerHTML">
|
||||
<div class="empty">loading calendar…</div>
|
||||
</aside>
|
||||
|
||||
<article id="log-content"
|
||||
class="log-page__content"
|
||||
hx-get="/api/log/by-date/{{ selected_iso }}?as=html"
|
||||
hx-trigger="load"
|
||||
hx-swap="innerHTML">
|
||||
<div class="empty">loading log…</div>
|
||||
</article>
|
||||
|
||||
<aside id="chat-sidebar" class="log-page__chat">
|
||||
<div class="chat-header">
|
||||
<span class="chat-title">Ask Cassandra</span>
|
||||
<span class="chat-hint">grounded on the latest log + live data</span>
|
||||
</div>
|
||||
<div id="chat-thread" class="chat-thread">
|
||||
<div class="chat-msg chat-msg--system">
|
||||
Ask about today's analysis. The model sees the latest strategic log,
|
||||
live market readings across all groups, and the last 24h of
|
||||
thesis-filtered headlines. Refresh wipes this conversation.
|
||||
</div>
|
||||
</div>
|
||||
<form id="chat-form" class="chat-form" autocomplete="off">
|
||||
<textarea id="chat-input" rows="2"
|
||||
placeholder="e.g. why is the defence sleeve flat through Hormuz?"
|
||||
required></textarea>
|
||||
<button id="chat-send" type="submit">Send</button>
|
||||
</form>
|
||||
</aside>
|
||||
</div>
|
||||
</section>
|
||||
<script src="{{ url_for('static', path='/js/chat.js') }}" defer></script>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue