diff --git a/startupintel/api/main.py b/startupintel/api/main.py index 69a6185..336557d 100644 --- a/startupintel/api/main.py +++ b/startupintel/api/main.py @@ -1,4 +1,8 @@ +from pathlib import Path + from fastapi import FastAPI +from fastapi.responses import FileResponse +from fastapi.staticfiles import StaticFiles from startupintel.api.routes import ( accelerator, @@ -36,6 +40,19 @@ def create_app() -> FastAPI: app.include_router(chat.router) app.include_router(bot.router) app.include_router(files.router) + + static_dir = Path(__file__).parent.parent / "static" + if static_dir.exists(): + app.mount("/static", StaticFiles(directory=str(static_dir)), name="static") + + @app.get("/", include_in_schema=False) + async def serve_ui() -> object: + """Serve the dashboard UI when present, else a small API pointer.""" + ui_file = static_dir / "index.html" + if ui_file.exists(): + return FileResponse(str(ui_file)) + return {"message": "StartupIntel API", "docs": "/docs", "ui": "/static/index.html"} + return app diff --git a/startupintel/static/index.html b/startupintel/static/index.html new file mode 100644 index 0000000..6a01540 --- /dev/null +++ b/startupintel/static/index.html @@ -0,0 +1,1514 @@ + + + + + + StartupIntel - AI-Powered Startup Intelligence + + + + +
+ +
+
+ + StartupIntel +
+
+
+ +
+
+
πŸš€
+
+
Founder
+
Business insights & strategy
+
+
+
+
⚑
+
+
Engineer
+
Technical architecture & systems
+
+
+
+
🎯
+
+
Product
+
User insights & decisions
+
+
+
+
πŸ“Š
+
+
Investor
+
Investment analysis & deals
+
+
+
+
+
+
+ + + + + +
+
+
+ +
+ +

StartupIntel

+

+ Your AI-powered startup intelligence companion. + Analyze runway, detect risks, evaluate PMF, and make data-driven decisions. +

+
+
+ πŸ’° "Analyze my runway" +
+
+ 🎯 "Check my PMF" +
+
+ ⚠️ "Any risks?" +
+
+ πŸ’‘ "Acqui probability?" +
+
+ πŸ“Š "Compare startups" +
+
+ πŸ•ΈοΈ "Investor network" +
+
+
+ +
+ + +
+
+ +
+ + + +
+
+
+
+
+ + + + + + +
+ + + + diff --git a/tests/test_api/test_static_ui.py b/tests/test_api/test_static_ui.py new file mode 100644 index 0000000..75537f0 --- /dev/null +++ b/tests/test_api/test_static_ui.py @@ -0,0 +1,23 @@ +"""Tests for serving the static dashboard UI.""" + +from __future__ import annotations + +from fastapi.testclient import TestClient + +from startupintel.api.main import create_app + + +def test_root_serves_dashboard_html(): + client = TestClient(create_app()) + resp = client.get("/") + assert resp.status_code == 200 + assert "text/html" in resp.headers["content-type"] + assert "" in resp.text + assert "StartupIntel" in resp.text + + +def test_static_index_is_mounted(): + client = TestClient(create_app()) + resp = client.get("/static/index.html") + assert resp.status_code == 200 + assert "text/html" in resp.headers["content-type"]