Álvaro Valenzuela Valdes commited on
Commit ·
ecc5ffa
1
Parent(s): 512ad5f
fix: Add missing backend dependencies and implement connection debugger
Browse files- Dockerfile +2 -1
- frontend/components/SystemInfo.tsx +27 -0
Dockerfile
CHANGED
|
@@ -27,7 +27,8 @@ RUN apt-get update && apt-get install -y \
|
|
| 27 |
COPY backend/requirements.txt ./backend/
|
| 28 |
RUN pip install --no-cache-dir -r backend/requirements.txt
|
| 29 |
# Install missing deps found earlier
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
COPY backend/ ./backend/
|
| 33 |
|
|
|
|
| 27 |
COPY backend/requirements.txt ./backend/
|
| 28 |
RUN pip install --no-cache-dir -r backend/requirements.txt
|
| 29 |
# Install missing deps found earlier
|
| 30 |
+
# Install missing deps found earlier
|
| 31 |
+
RUN pip install --no-cache-dir sqlalchemy==2.0.49 pymysql cryptography pydantic-settings slowapi pypdf python-multipart
|
| 32 |
|
| 33 |
COPY backend/ ./backend/
|
| 34 |
|
frontend/components/SystemInfo.tsx
CHANGED
|
@@ -6,6 +6,17 @@ import { syncDatabase } from "../lib/api";
|
|
| 6 |
export default function SystemInfo() {
|
| 7 |
const [isSyncing, setIsSyncing] = useState(false);
|
| 8 |
const [syncStatus, setSyncStatus] = useState<string | null>(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
const handleSync = async () => {
|
| 11 |
setIsSyncing(true);
|
|
@@ -56,6 +67,22 @@ export default function SystemInfo() {
|
|
| 56 |
{isSyncing ? "Initializing..." : "Seed Demo Data (Manual Sync)"}
|
| 57 |
</button>
|
| 58 |
{syncStatus && <p className="text-xs font-mono text-purple-400">{syncStatus}</p>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
<p className="text-[10px] text-slate-500 max-w-xs uppercase tracking-widest">Use this if the dashboard shows 0 items on first load</p>
|
| 60 |
</div>
|
| 61 |
|
|
|
|
| 6 |
export default function SystemInfo() {
|
| 7 |
const [isSyncing, setIsSyncing] = useState(false);
|
| 8 |
const [syncStatus, setSyncStatus] = useState<string | null>(null);
|
| 9 |
+
const [debugInfo, setDebugInfo] = useState<string>("");
|
| 10 |
+
|
| 11 |
+
const testConnection = async () => {
|
| 12 |
+
try {
|
| 13 |
+
const res = await fetch("/api/health");
|
| 14 |
+
const data = await res.json();
|
| 15 |
+
setDebugInfo(`Connection OK: ${JSON.stringify(data)}`);
|
| 16 |
+
} catch (e: any) {
|
| 17 |
+
setDebugInfo(`Connection Failed: ${e.message}`);
|
| 18 |
+
}
|
| 19 |
+
};
|
| 20 |
|
| 21 |
const handleSync = async () => {
|
| 22 |
setIsSyncing(true);
|
|
|
|
| 67 |
{isSyncing ? "Initializing..." : "Seed Demo Data (Manual Sync)"}
|
| 68 |
</button>
|
| 69 |
{syncStatus && <p className="text-xs font-mono text-purple-400">{syncStatus}</p>}
|
| 70 |
+
|
| 71 |
+
{/* Debug Area */}
|
| 72 |
+
<div className="mt-8 pt-8 border-t border-white/5 w-full">
|
| 73 |
+
<button
|
| 74 |
+
onClick={testConnection}
|
| 75 |
+
className="text-[10px] font-bold text-slate-500 hover:text-white uppercase tracking-widest transition"
|
| 76 |
+
>
|
| 77 |
+
[ Test API Connection ]
|
| 78 |
+
</button>
|
| 79 |
+
{debugInfo && (
|
| 80 |
+
<div className="mt-4 p-4 rounded-xl bg-black/40 border border-white/5 text-left">
|
| 81 |
+
<p className="text-[10px] font-mono text-cyan break-all">{debugInfo}</p>
|
| 82 |
+
</div>
|
| 83 |
+
)}
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
<p className="text-[10px] text-slate-500 max-w-xs uppercase tracking-widest">Use this if the dashboard shows 0 items on first load</p>
|
| 87 |
</div>
|
| 88 |
|