[feat] solution/backend,frontend,postgres-init: 서비스 사이트 공개 화면 방문 수집 — 전체 방문 통계에 합산하고 사이트 표에 한 줄로, 기능 문서 추가

This commit is contained in:
skkim committed 2026-10-13 16:31:45 +09:00
1 parent 2fc50de161
commit 99a344f65c
21 files changed
+378 -21

No files matched your search

+28
View File
@@ -234,3 +234,31 @@ def test_IP_한도_표도_상한을_지킨다(monkeypatch):
for i in range(50):
VisitService._ip_allowed(f"198.51.100.{i}")
assert len(VisitService._ip_hits) <= 10
# ── 서비스 사이트 공개 화면(2026-10-13) ───────────────────────────────────
async def test_서비스_공개_화면은_사이트_없이_저장한다(client, db_engine):
await _beacon(client, {"path": "/", "referrer": "https://www.google.com/", "utm_source": "insta"})
await _beacon(client, {"path": "/pricing/"})
await _beacon(client, {"path": "/showcase"})
await _beacon(client, {"path": "/login"})
await _beacon(client, {"path": "/signup"})
views = await _views(db_engine)
assert [(v["site_id"], v["path"]) for v in views] == [
(None, "/"), (None, "/pricing"), (None, "/showcase"), (None, "/login"), (None, "/signup"),
]
assert (views[0]["referrer_domain"], views[0]["utm_source"]) == ("google.com", "insta")
async def test_서비스_작업_화면은_세지_않는다(client, db_engine):
# 공개 화면만 센다 — 빌더·내 사이트·운영 화면은 사장님 작업이라 유입 통계를 흐린다.
for p in ("/builder", "/sites", "/account", "/ops/sites", "/auth/kakao/callback", "/approve/abc", "/nope"):
await _beacon(client, {"path": p})
assert await _views(db_engine) == []
async def test_서비스_화면은_해시를_경로로_치지_않는다(client, db_engine):
await _beacon(client, {"path": "/#/stay"})
assert [v["path"] for v in await _views(db_engine)] == ["/"]