Hacker News new | ask | show | jobs
How to Structure a Next.js Application (For Humans and LLMs) (swiftace.org)
3 points by aakashns 161 days ago
1 comments

Author here. I've shipped multiple Next.js projects to production with LLMs writing over 90% of the code, and this post outlines a project structure that aids LLMs and doesn't trip them up.

TL;DR: Keep it flat, obvious and simple. 7 top-level folders (app, components, database, emails, functions, lib, public) instead of deep nesting. Explicit server/client separation. Everything has one obvious place to live.

Happy to answer questions about working with LLMs on larger codebases or specific patterns I've found useful.