Compare commits

...

2 Commits

Author SHA1 Message Date
Jonathan db9624822b Merge development: fix CORS for local dev on port 3001
Resolved conflict by keeping env var approach from main and updating
the default to include both localhost:3000 and localhost:3001.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:58:50 +01:00
Jonathan cb6594f463 Fix CORS for local dev and update stats grid layout
Add localhost:3001 to allowed CORS origins to fix local Docker setup
where frontend is mapped to port 3001. Also update stats grid to fixed
3-column layout and reorder stat cards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:51:01 +01:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ Base.metadata.create_all(bind=engine)
app = FastAPI(title="BTC Portfolio API")
origins = os.getenv("ALLOWED_ORIGINS", "http://localhost:3000").split(",")
origins = os.getenv("ALLOWED_ORIGINS", "http://localhost:3000,http://localhost:3001").split(",")
app.add_middleware(
CORSMiddleware,
@@ -12,7 +12,7 @@ const styles = {
header: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '1.5rem' },
logo: { fontSize: '1.4rem', fontWeight: 700, color: '#f7931a' },
logoutBtn: { background: 'none', border: '1px solid #555', color: '#aaa', borderRadius: '8px', padding: '0.4rem 1rem', cursor: 'pointer' },
statsGrid: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))', gap: '1rem', marginBottom: '1.5rem' },
statsGrid: { display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '1rem', marginBottom: '1.5rem' },
statCard: { background: '#1a1a1a', padding: '1rem', borderRadius: '12px', border: '1px solid #333' },
statLabel: { color: '#888', fontSize: '0.8rem', marginBottom: '0.3rem' },
statValue: { fontSize: '1.2rem', fontWeight: 700 },
@@ -87,8 +87,8 @@ export default function Dashboard() {
{stats && (
<div style={styles.statsGrid}>
<StatCard label="Total Invested" value={`${stats.total_invested.toLocaleString()}`} />
<StatCard label="Total BTC" value={`${stats.total_btc}`} highlight="neutral" />
<StatCard label="Avg Buy Price" value={`${stats.average_price.toLocaleString()}`} />
<StatCard label="Total BTC" value={`${stats.total_btc}`} highlight="neutral" />
<StatCard label="Current BTC Price" value={`${stats.current_price.toLocaleString()}`} />
<StatCard label="Portfolio Value" value={`${stats.portfolio_value.toLocaleString()}`} />
<StatCard