Skip to content

Commit 57108ab

Browse files
feat: add insights pages — stats dashboard, plot of the day, similar specs
New features that leverage the database more heavily: - Stats page (/stats): library quality/LOC histograms, coverage dot matrix, top rated implementations, tag cloud, timeline, plausible link - Plot of the Day: daily featured high-quality impl on homepage, dismissable - Similar specifications/implementations: tag-based Jaccard similarity on spec pages (spec tags) and impl pages (spec + impl tags), with hover highlighting of shared tags - Lazy code loading: code field deferred in DB model (~25MB saved per get_all), new /specs/{id}/{lib}/code endpoint, frontend prefetch - Collapsible spec tabs with always-visible tags and metadata footer - New insights API router with /dashboard, /plot-of-the-day, /related - Updated sitemap, plausible docs, API docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d45c640 commit 57108ab

File tree

22 files changed

+1429
-135
lines changed

22 files changed

+1429
-135
lines changed

api/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
debug_router,
2828
download_router,
2929
health_router,
30+
insights_router,
3031
libraries_router,
3132
og_images_router,
3233
plots_router,
@@ -128,6 +129,9 @@ async def add_cache_headers(request: Request, call_next):
128129
# Individual spec details (5 min cache, 1h stale-while-revalidate)
129130
elif path.startswith("/specs/"):
130131
response.headers["Cache-Control"] = "public, max-age=300, stale-while-revalidate=3600"
132+
# Insights endpoints (5 min cache, 1h stale-while-revalidate)
133+
elif path.startswith("/insights/"):
134+
response.headers["Cache-Control"] = "public, max-age=300, stale-while-revalidate=3600"
131135

132136
return response
133137

@@ -141,6 +145,7 @@ async def add_cache_headers(request: Request, call_next):
141145
app.include_router(specs_router)
142146
app.include_router(libraries_router)
143147
app.include_router(plots_router)
148+
app.include_router(insights_router)
144149
app.include_router(download_router)
145150
app.include_router(seo_router)
146151
app.include_router(og_images_router)

api/routers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from api.routers.debug import router as debug_router
44
from api.routers.download import router as download_router
55
from api.routers.health import router as health_router
6+
from api.routers.insights import router as insights_router
67
from api.routers.libraries import router as libraries_router
78
from api.routers.og_images import router as og_images_router
89
from api.routers.plots import router as plots_router
@@ -16,6 +17,7 @@
1617
"debug_router",
1718
"download_router",
1819
"health_router",
20+
"insights_router",
1921
"libraries_router",
2022
"og_images_router",
2123
"plots_router",

0 commit comments

Comments
 (0)