slowlp
← Projects
LAB · Personal experiment (private home-server deployment)

Stock Portfolio App (MyFolio)

A portfolio-first investing app — no need to analyze individual stocks, just connect your KIS brokerage account and let the app handle order planning. Running privately on my home server.

Visit ↗
Stock Portfolio App (MyFolio)
OVERVIEW

Instead of picking and analyzing individual stocks, you build a portfolio and the app calculates the order plan for you. It connects to Korea Investment & Securities (KIS) and executes real trades. The backend is FastAPI, the mobile client is Expo (React Native), and a Celery worker handles trade confirmation, P&L updates, and notifications in the background. The whole thing runs on `folio.slowloop.app` via a home Ubuntu server with Docker Compose.

The domain layer is split into six modules (member, account, portfolio, trading, market, notification). The UX is designed around one account at a time rather than a multi-account dashboard. One thing I confirmed hands-on: 1,521 passing unit tests don't replace real-KIS, real-trade, and real-device verification — those still need a human.

QUICK FACTS
StatusPersonal use (home server, my accounts only)
URLfolio.slowloop.app (private access)
BackendFastAPI · SQLModel · PostgreSQL · Redis · Celery
MobileExpo (React Native) · expo-router · Clerk auth
IntegrationKorea Investment & Securities (KIS) Open API
DeploymentDocker Compose · Caddy · Cloudflare · GitHub Actions (self-hosted runner)
SecurityFernet at-rest encryption · Google-only login · email allowlist
ConstraintKIS API regulations prohibit public distribution
folio.slowloop.app (private access)
Key features
01 Portfolio
Group tickers, set weights, attach an order strategy
02 Order plan → live order
Strategy-based order plan preview, then real KIS execution on confirm
03 P&L & trade confirmation
Celery worker confirms KIS fills and updates cost-basis P&L
04 Notifications
Condition-evaluation batch for trade and fill alerts
05 Reconnect flow
Detects invalid KIS credentials and guides re-entry of App Key / Secret
Related — how it was made
Series →
Lesson 3 Painful Lessons Deploying a Stock App at Home iptime CAA block, DB port conflict, stale checkout: things you only learn the hard way. Story I Read a Stock Book and Decided to Build an App Instead Zero stock knowledge, built it anyway. Back after a year, and done in two weeks. Method The Justice League Once Lived in My Stock App BaseSqlModel, BaseRepository, a 15-chapter guide, and making the AI stick to one pattern. Lesson The AI Was Fine. I Just Didn't Know the Tools. Five automation mistakes in my stock app and what finally changed how I work. Lesson I Read the Terms of Service After Building the Whole Thing A stock portfolio app dev story: KIS API regulation traps and a last-minute pivot Method Put Logic on the Model and Duplication Disappears Avoid copy-pasting update rules to three places: gather them into a single model method. Method Common Modules and Base Classes to End Code Duplication Around the third domain, lift the repeating code up into common Method Routers Do HTTP, Logic Lives in Services: Separating Layers Why I split router, service, and repository responsibilities one line each Method Your Folder Structure Is Your Design Why I organize by domain instead of function, and what changes when you do Method Data Access Through Repositories Only Lock your queries inside repositories and there's only one place left to change Story Everyone Was New to ORMs, So I Wrote the Guide A 17-section development guide written to stop copy-paste duplication Method Validate at Every Boundary: Schemas and Layered Defense Don't ship your models as-is; validate at each layer with a different responsibility Method Only Catch the Exceptions You Can Handle Catch only what you can recover from, and let unrecoverable exceptions rise to the caller.
COMMENTS