Series Stock Research Deck Log

~3 min read

Stock Reports Move to Free Membership

With the reports mature enough, the project moved to free membership. A single 691-line f-string used to be the whole UI; now Next.js draws it and Python stays a data pipeline. The member boundary is drawn at the file rather than in CSS, and server-only is the real defense. Deployment failed seven times, five of them from outside the repo.

UnderwayAuthNext.jsDeploy

Log

The analysis reports matured enough. The project now moves to free membership. There are no tiers, only member or not.

  • Regulation came first. Free and single-tier means this is not subject to investment-advisory registration. The trigger is "receiving direct compensation," and there is none. I checked this before building any screen. If paid plans or donations arrive, the regulatory review comes first again
  • Python stays a pipeline and Next.js draws the UI. export_json.py splits at the boundary into web/data/public/ (anyone, teaser) and web/data/member/ (members, evidence)
  • Google sign-in uses Auth.js v5 with a JWT session and no DB. One session is all we read, so no database is needed
  • Removed 773 lines of dead code. build_frontpage.py (one 691-line f-string was the entire UI), render_reports.py, and 17 static HTML files had become an isolated cluster referencing only each other

Judgment

★ Draw the boundary at the file — CSS can't hold it

Key point

Putting member content in one file and hiding it with CSS or conditional rendering is defeated by View Source. The data is already on the client. So the layers were split.

DeviceWhat it stops
import "server-only"If a client component imports member data, the build breaks. The real defense
Server-component renderAfter the session check, only rendered HTML goes down — never the source or JSON
Member JSON kept outside public/Anything under public/ is served verbatim by URL
/api/member/* returns 404 when signed outA 401 announces "something is here"

The first row matters most. The rest are rules a human must keep, while server-only simply won't build if broken. This project has confirmed one thing repeatedly. Rules humans must keep eventually break, so a machine must enforce them at the boundary.

I verified it on the deployment: /analysis 307 · /api/member/dashboard 404 · /data/member/*.json 404. Next I pulled the client bundle directly and searched for the titles of all 20 significant events and the names of all 9 stocks. Zero hits. Status codes alone aren't enough. A page can be blocked while the data sits baked into the bundle.

The 9 dashboard charts were not rewritten in React. build_dashboard.py already has the confidence bands and the template, and 10 tests guard them. I wrapped them in a session-checking API and reused them. Rewriting what already works only adds risk.

★ Deployment failed seven times — five from outside the repo

The code was right from the start. No amount of looking inside the repo would show the cause.

  • Settings beat code. Root Directory pointed at the repo root. Framework Preset said python. An Output Directory override was on. All three live only in the dashboard. When wrong, the build succeeds, only the status turns Error, and the log says nothing. Changing a setting does not trigger a redeploy, so you must push a commit
  • My own optimization broke the deploy. Annoyed by one local build warning, I added outputFileTracingRoot to next.config.ts. Build passed, status Error, logs empty. One warning was never worth breaking a deploy for
  • There are three domains. Vercel auto-generates .vercel.app aliases and you cannot delete them. Auth.js builds its callback from whichever domain you arrived on. An unregistered alias leaves the app perfectly deployed while only sign-in quietly dies

And my verification passed three times, all on the wrong domain

This is the most embarrassing part of this work. I judged by a string from the login screen, and that string also appears on error pages. I used a control group but hung the control on a different alias too, so both gave the same answer. I reported a pass three times and was wrong all three times.

The thing under test wasn't the path actually used. It is the pattern this project keeps hitting. Missing that the data had stopped and computing strategies on stale sector data were the same symptom. This time it came from my own verification.

An aside: move the tests before deleting

When a dead screen generator is deleted, the rules that screen enforced quietly vanish with it. That is this repo's accident pattern. I migrated 5 concepts out of test_build_frontpage.py's 11 first. Notably the README number guard lived inside the file I was deleting. Had I just deleted it, nothing would police this document's figures.

Migrating surfaced a real inconsistency too. The same category read "국내 증시정책" in the app and "증시 정책" in the monthly report. Five files each carried their own label. Names and colors are a category's identity, and when they differ per screen the category is unrecognizable as the same thing. They were consolidated to a single source and pinned by tests.

Charted Ahead

  • Attach a custom domain and set it Primary. That collapses the three aliases into one and the callback URIs with them
  • Kakao and Naver sign-in, once Google is solidly running
  • Paid plans are not on the table yet. If they arrive, the regulatory review comes before the screen

Related

Portfolio'Stock Research' — Korean Market Event Analysis & ForecastingOperations증시 리서치 — Korean-market event analysis & forecasting · market-model AR/CAR + t-test · a pipeline that ran daily, unattended, via GitHub ActionsJournalEnding Stock Research, and the 49 Days of Failures No One SawJournalHow a Monthly Report Went Out With a Future DateJournalHow Much Stocks Move on Earnings Day, Confirmed on the Third TryJournalMoving Stock Research to the Cloud to Run Daily on Its Own

1 more — see all under 증시 리서치 in Operations ›