L8 Principal Building a Full Stack App From Scratch
In a Nutshell
L8 principal Kun built a complete iOS allowance-tracking app called "Edie's Wallet" from scratch in one session using GPT-5.6 Luna agents orchestrated through Herder and First Mate. He deployed a $5.50/month VPS backend with PostgreSQL and Fastify, implemented Apple Sign-In, and produced a working SwiftUI app that syncs parent-controlled balances to a child read-only view. The workflow relied on parallel agent streams, Lavish interactive planning artifacts, Autonomic Vault for secret authorization, and server-side context compaction to maintain continuity across a 272k-token window.
These notes were generated by AI and may contain inaccuracies.
Kun, an L8 principal engineer who worked at Meta, Microsoft, and Atlassian, begins building a real project from scratch using his agentic engineering workflow. The project stems from a previous video that received 600,000 views, with viewers requesting a demonstration of building an actual application.
Starting from an empty terminal, Kun launches Herder as his replacement for T-Max to manage agent sessions. He then sets up First Mate, an open source project he created, which allows the captain to communicate with only one agent (the first mate) while the first mate handles all task juggling, reducing cognitive load and context switching.
First Mate is launched using the PI agent harness with the Luna model (GPT 5.6 Luna on X high reasoning level) instead of the default GPT 5.6. The ground rule is established that every task and crew mate will be dispatched to PI agents running this specific model configuration.
Kun activates calm mode in First Mate, which hides all tool calls, scripts, and technical noise, displaying only prompts and responses. This approach works well with modern models where steering is rarely needed, unlike older less intelligent models where observing tool calls was necessary to catch mistakes.
The project is named Edd's Wallet - an app for children to manage allowances. Current methods involve writing in notebooks or relying on memory, which becomes difficult with multiple rules for allowances and spending. The app serves as a balance tracker while teaching basic financial concepts like balance, loans, credit card mechanics, payments, and interest on savings.
The app will be iOS-only initially due to Eddie's iPad usage. It requires parent mode for deposits and withdrawals, and child mode as read-only for viewing balance, loans, and other information.
Two parallel investigations are initiated: market research to check if similar apps exist, and technical research for building a full-stack iOS application. Key constraints include virtual-only money (not real currency) and cloud-based data storage for multi-device access across iPad and Mac.
First Mate spawns two separate tabs: one for market research and one for technical research, both running GPT 5.6 Luna on X high. This parallel execution allows multiple tasks to proceed simultaneously without blocking.
CodeEx fast mode is enabled to reduce latency during the demo, though it increases cost. This setting affects all sessions globally.
Each crew mate runs as a normal agent in a Herder tab, providing full transparency and the ability to steer sub-agents directly if needed, unlike most agent harnesses where sub-agent visibility is limited.
The market research agent generates a 100-line report finding no existing iOS app matching the full requirements of virtual money, parent-controlled rights, and child-only read-only mode. Similar apps include Kiddo Bank (web-only). The recommendation is to prototype Edd's Wallet rather than install an existing replacement.
The technical research recommends native SwiftUI iPad app with Supabase, PostgreSQL, row-level security, immutable server-side ledger, Swift Data local cache, and no real money integrations. CloudKit and identity/pairing requirements are noted.
Kun expresses preference against Supabase due to cost scaling concerns with complex usage, noting the app will have only 2-3 users (Eddie, himself, and his wife) with no scaling needs. Self-hosted VPS is proposed as an alternative, with Apple Sign In required for iOS authentication and Google Sign In planned for later.
Lavish is used for interactive HTML-based planning artifacts instead of reading 351-line markdown reports. This allows better interaction and feedback on specific planning sections.
While backend investigation continues, frontend UX prototyping is initiated with key screen prototypes for user journey review. Market research concepts are analyzed for inspiration including money buckets (spend/save/give), goals, meaningful activity timeline, approval requests, and educational elements.
Key concepts identified include contextual lessons attached to real actions, virtual loan simulator, flexible allowance rules, gentle gamification, recurring allowance, and privacy-focused iPad-first design with family ledger functionality.
Herder provides an agents side panel showing all running agents, directories, and quick switching capabilities for managing large numbers of agents efficiently.
The agent search pane allows quick navigation between different sessions and searching by title. Herder's key benefit is that it understands agents, unlike traditional terminal multiplexers that only understand terminals, panes, and shells.
A lavish artifact was generated showing the lavish editor fixing UI layout issues from agent-generated artifacts. The backend review recommends buying operational simplicity before infrastructure. The short version recommends hosted Supabase Pro. Other recommendations include "Apple now Google later" and "virtual money only."
MVP scale hosted baseline costs $25 per month. For three users, this cost seems excessive. Self-hosted VPS is estimated at $30 to $60 per month. Self-hosted Supabase and CloudKit with iCloud are available options, with Apple developer membership already owned.
Feedback indicates the $25 to $40 monthly cost is too expensive for current user scale. A low-cost VPS can provide approximately $5 per month. The system should prioritize options at that cost level.
The phone functions as client, PostgreSQL as the referee. The diagram shows iPad app with local cache, native app sign-in, provider, retry reconcile with narrow domain RPCs, and membership checks going to PostgreSQL.
Immutable ledger audit events and encrypted export are considered over-engineering. Initial scope should remain minimal without auditing and export requirements.
The plan assumes Supabase usage but this needs changing. Keep an identities table to allow users to link different accounts and authentication identities into the same account. Recovery and manage daily backup privacy need consideration.
Parent manages profile and can set a PIN to gate access for parent-only actions. Point-in-time recovery is selected for recovery promise, with daily backup and export as starting point.
Lavish enables interactive agent interaction with queued choices, element annotation feedback, and diagram viewing. This provides better experience than reading long text walls.
First Mate processes feedback while UX prototypes crewmate has completed work in markdown format. Status updates from crewmates queue in follow-ups for First Mate to process when available.
Request for real HTML prototypes in Lavish instead of markdown scope definitions. Focus on wireframes, screens, concepts, and user flows rather than polished UX mocks, achievable without iOS code.
After feedback, recommendations updated to budget VPS at $5.50 monthly. Operations remain lighter with hosted Supabase, but cost considerations favor VPS.
VPS selected as backend approach. Confidence established for the entire backend portion of the project.
Lavish artifact shows interactive wireframes with journey map: Welcome, Family setup, Pair Eddie, Pairing gate, Parents dashboard, Child wallet, Activity detail, Allowance rule, Loan and repayment, Lesson path.
Prototype includes offline mode, sync pending changes, and reset functionality. Playable prototype demonstrates wallet for practice with virtual money only.
Family creation flow includes setting up Eddie's practice wallet with family name "Chen" and unit name options (tokens vs points). Pairing enables different device usage, such as setting up on iPhone while child uses iPad.
Parent mode unlock provides balance viewing, point addition, and allowance setting. Prototype includes pre-configured PIN access.
Eddie should not request points directly - requests come in person. Loans should live as cards on wallet detail flow at top level. Lessons should use short linear starter path.
Currency should use local currency (US dollars) rather than custom tokens. Recent activity list appears both on wallet view and as separate button, creating redundancy.
Feedback to be incorporated into PRD document as markdown readme file. No prototype updates needed, just documentation of decisions.
Context window reached 70% of 272k capacity. Auto-compaction summarizes content and restarts session. GPT models in Codex have superior server-side compaction compared to other harnesses.
PI OpenAI server compaction plugin enables Codex server-side compaction for GPT models running in PI agent, improving performance for long-running tasks.
Repository to be published as public GitHub repo for future workflow needs. Direct PR workflow selected over "no mistakes" for early-stage development.
No mistakes provides local validation pipeline for code changes. Should be enabled when changes would otherwise require human review. Not needed for prototype work without existing code.
"Eddie's wallet" spelling corrected to "Edie's wallet" across local and GitHub repositories.
Repository contains only readme file with PRD document capturing all discussed decisions. Created for product design work using cloud design.
Design system created instead of individual design to enable future UI component and screen building with consistency. Company name set to product name "Edie's wallet" with repository URL linked.
Design system needs to challenge prescribed user experience. Target experience should be fun, educational, and friendly for kids while providing good control and transparency for parents.
Sonnet selected over Set for design work as Set cannot produce clever solutions, though problem complexity appears manageable.
Backend development can proceed while designer works on UI. First Mate instructed to parallelize work on non-blocked items.
Atomic vault manages production secrets with authorization flow requiring explicit approval for agent access. Better security than environment files.
Hcloud token from atomic vault approved for Herder account management. Agent API calls visible for approval decisions.
The speaker is using Autonomic Vault, an open-source GitHub project built by Max Howell, the creator of Homebrew. Despite being a relatively new project, the speaker trusts it and has been providing feedback to Max on making it more useful. When the agent accesses a secret, the speaker gets a dialogue to review the action. This provides confidence that secrets are not being leaked to unintended uses.
As delegation to agents increases, this becomes increasingly important. Without this control, throwing secrets into files means the user doesn't know when the agent has already given them away, since not every tool call is monitored. The agent might publish secrets to public files or send them as part of public API calls.
First Mate has created three parallel work streams: backend API, DB schema boundary, and VPS foundation with backups and deployment automation. The speaker is approving most actions since the agent is setting things up.
The speaker prefers making deployment declarative using tools like Terraform or OpenTofu to document infrastructure as code. They asked First Mate to use OpenTofu for the VPS foundation work, and First Mate redirected the infrastructure work accordingly.
The speaker is using Cloud Design for the design system. Initially, they wanted to use Fable but decided to stay frugal and see if Cloud Design produces good enough results. The design system includes brand icons, colors (gold/golden), and neutral colors. The speaker notes their son likes golden colors.
The initial designs had issues: text wasn't centered correctly, and the overall feeling didn't feel like a children's app. The speaker provided feedback that the app should feel more fun and friendly to children.
The speaker requested app icon options. Cloud Design generated icons using a piggy bank analogy. The speaker selected the piggy design but requested the piggy be made bigger and icon images that can be directly used in the iOS app, accounting for iOS formatting requirements.
First Mate completed the Apple sign-in investigation. The speaker confirmed having a paid Apple developer membership. First Mate listed exact steps and URLs, but the speaker asked First Mate to perform the steps using Chrome DevTools to control the browser window, since the speaker was already signed into Apple Store Connect.
The speaker had turned on remote debugging (under inspect settings) before the demo to allow the agent to control the existing browser window with credentials, rather than running an isolated browser.
The Hner setup provisioned one dedicated server. The current cost is lower than the $30-$60 range previously mentioned.
After addressing feedback about text centering and making the design more child-friendly with bouncing animations, the design system was ready. The speaker exported the project archive as a zip file and asked First Mate to copy the design system into the repo and build the iOS app following the design system.
The iOS app should work on both iPhone and iPad. The speaker decided the backend should be a private repo, while the iOS frontend app will be in the open-source repo.
The speaker noted the context window (272k tokens for GPT models) running out, requiring compaction. They mentioned that Claude has a million tokens but in practice, compaction quality matters more. The speaker observed that GPT models handle compaction well and maintain continuity across sessions.
First Mate set up the backend repo. The speaker asked if everything was completed on the Apple developer site or if anything was waiting. First Mate reported that the team ID was confirmed but the Apple ID didn't appear, likely due to an earlier app name error.
After retrying, "Ed's Wallet" was successfully registered. The speaker noted the app needs Apple Sign In capability. The agent was able to complete the registration, including selecting the right capabilities.
The speaker wants to test the iOS app in a simulator pointing to the real backend to verify end-to-end experience, including Apple sign-in with a real Apple account connecting to the real backend on the VPS. This simulator-based testing is considered the MVP goal.
First Mate indicated the iOS app is not yet connected to the backend - it's using mocks. The implementation needs to continue until end-to-end testing is possible.
First Mate suggested deploying a development backend, implying different environments. The speaker corrected this, stating they only need one production MVP environment and don't need to distinguish development versus production for this new app and VPS.
First Mate proposed two parallel implementation tracks: iOS integration with real authentication service, and backend deployment. The final MVP gate is simulator sign-in with the real Apple account. The only likely external input needed is an HTTPS hostname.
The speaker has a Cloudflare account with a Cloudflare API token stored in the vault, and controls the domain kunchenjoid.com (noted transcription correction from "kenid. kenjoid.com"). They plan to create a subdomain like ediswallet.kunchenjoid.com for this purpose.
The speaker's philosophy is to give agents many permissions and capabilities, but require authorization when touching production environments, which is why Autonomic Vault is used.
The backend is now live with valid HTTPS. Apple ID and authentication on the backend are configured. The speaker mentioned using Tailscale for automated deployments in the future, adding devices and VPS into the same Tailscale subnet.
First Mate identified that the app was pointing to the wrong address, likely because the frontend was built while the backend was being hooked up. First Mate dispatched a worker to correct this automatically.
A simulator with both iPhone and iPad was brought up. The agent attempted sign-in and encountered an error, which will trigger the agent to investigate and fix the issue.
The speaker noted a bug: the app said "Eddie does not need an account," incorrectly assuming "Eddie" is the user's name. The brand is "Ed's Wallet," but the app should use more neutral terms since it may be used by people whose name isn't Eddie.
First Mate dispatched a parallel agent named something like "wallet neutral" to fix the neutral language issue while continuing testing in parallel. The neutral language update was completed, with each family's configured child nickname.
The speaker wants to do a backend architecture review focusing on API endpoints, since the backend was deployed but the code hasn't been examined yet.
The focus is on API endpoints exposed, authentication handling, and database schema created. The review examines the backend architecture with strong core boundaries and narrow scope, featuring one parent identity and one family where requests and authority flow.
The iOS client uses HTTPS to call production, which gets routed to a fastify API. The health endpoint and issuer handle Apple token passing. The architecture includes a session service, bearer hash, and wallet service endpoint that points to the database for data storage.
The API endpoints include Apple authentication, family, wallet, and child view endpoints. These serve as different endpoints to render different screens, exposing different data structures through different endpoints in a reasonable manner.
The request flow shows the iOS app sending an identity token via POST to the Apple authenticator, which appears typical for authentication processes.
The database schema includes parent identities, sessions, and families. Families connect parents to children and can have multiple children within the same family. Children have wallets, wallets can have loans, and there are ledger entries. The schema appears reasonable without overengineering.
After Captain Fricks is merged, end-to-end testing begins. The app signs in successfully using Apple sign in and reaches the wallet parent view. Adding $10 is recorded, showing the balance updated to $10. In Edd's view, he can see the $10 balance.
Signing out and signing back in using the same account retrieves the same data because the data is stored in the cloud. The user ID and server backend successfully fetch the data, confirming end-to-end functionality works correctly.
The app will be built into test flight and installed on the son's iPad for real usage the following day. This full stack app was built from scratch using GPT 5.6, Luna, and Sonnet for cloud design. The project demonstrates a complete agentic engineering workflow for delivering a real project end to end.
Keep Kun Chen in your library
Save the videos and channels worth coming back to, and find them again in one place.





