feat(altyapı): yerel MongoDB, Axum backend ve Vite frontend iskeleti
- docker-compose.dev.yml: MongoDB 7, tek düğümlü replica set (port 27020) - Backend: Axum + tokio, GET /api/health - Frontend: React + TypeScript + Vite, /api proxy, geçici durum ekranı - Kök package.json: npm run dev ile DB + backend + frontend - backend/api.http örnek istekler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
type Health = { status: string; version: string }
|
||||
|
||||
// Faz 0 geçici ekranı: frontend ↔ backend bağlantısını doğrular.
|
||||
// Faz 2'de gerçek tasarım sistemi ve layout ile değiştirilecek.
|
||||
export default function App() {
|
||||
const [health, setHealth] = useState<Health | null>(null)
|
||||
const [error, setError] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
fetch('/api/health')
|
||||
.then((r) => (r.ok ? r.json() : Promise.reject()))
|
||||
.then(setHealth)
|
||||
.catch(() => setError(true))
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<main className="placeholder">
|
||||
<h1>📒 Kakeibo</h1>
|
||||
<p>Kişisel Ev Finans Defteri</p>
|
||||
<p className="status">
|
||||
{error && '🔴 Backend\'e ulaşılamadı'}
|
||||
{!error && !health && '⏳ Backend kontrol ediliyor…'}
|
||||
{health && `🟢 Backend çalışıyor (v${health.version})`}
|
||||
</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/* Faz 0 geçici stil. Faz 2'de TailwindCSS ile değiştirilecek. */
|
||||
:root {
|
||||
font-family: Inter, system-ui, sans-serif;
|
||||
color-scheme: light dark;
|
||||
background: #fafaf9;
|
||||
color: #1c1917;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
background: #1c1917;
|
||||
color: #f5f5f4;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
min-height: 100dvh;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
text-align: center;
|
||||
gap: 0.25rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.placeholder h1 {
|
||||
margin: 0;
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.status {
|
||||
margin-top: 1.5rem;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
Reference in New Issue
Block a user