r/ClaudeCode • u/DumbasFuck1390 • 22h ago
Help/Question Non-dev vibe coding with Claude Code: how do I make sure my app's architecture won't fall apart as it grows?
I'm not a software engineer. I've never built or shipped a production app the traditional way. Everything I know comes from vibe coding with AI, mostly Claude Code.
Right now I'm building an app I actually want to grow, and I've hit a wall. The code works, but I don't know if it's well built. I have no background in app architecture, so I can't tell whether the AI is setting me up for something that scales or for something I'll have to rewrite in 3 months.
My worries:
• Scaling: how do I know the foundation can handle more users and features?
• Building on top: every new feature feels like it might break something else. How do I keep things modular?
• Explainability: I want to actually understand my own codebase, not just have a pile of files that only the AI can navigate.
So, for people who've been here (or experienced devs who've watched non-devs try this):
- What should I learn first? Which architecture concepts actually matter for a solo builder?
- How do you make Claude Code (or any AI) follow good architecture? CLAUDE.md files, specific prompts, planning docs before coding?
- Should I have the AI write an architecture doc first and code against it?
- What red flags in AI-generated code should I watch for?
- Any resources, templates or workflows that worked for you?
I'm not trying to become a senior engineer overnight. I just want to build something solid that I can keep adding to without it collapsing. Any advice is appreciated
•
u/AutoModerator 22h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
24
u/17Beta18Carbons 22h ago •
I mean this is like asking "how do I build a roof myself so it won't leak". There's no secret, you just gotta learn how to build a roof my dude.
67
u/tech5c 22h ago
3
u/RomuloPB 20h ago
simply put, you make sure by measuring, trying to act only on problems that you have evidence of. Don't chase imaginary problems, although, when it comes to security and data loss, it’s good to be paranoid, failing at those two is veeery expensive.
I agree it does not feel that simple when doing. You will face questions like "What should I measure, how, when, why?", just don’t be afraid of that feeling of having a sea of questions, focus on real problems you have now. I personally learned by trying, failing and redoing better, and also by simply taking time to fill my curiosity reading about architecture. Sometimes you remember you have a tool in your toolbox that you were not much sure what it was good for and you notice your problem is a wonderful candidate for it
12
u/ParamedicAble225 22h ago
All you have to do is spend 4 years learning to read code and understand system architecture. Then you can read it and know
6
u/Sorry-Programmer9826 22h ago
You do it by becoming a dev. You can get claude to explain stuff to you. Understand it, discuss its decisions with you. At first it will be much better than you but in time you'll understand better than it
2
u/UhLittleLessDum 22h ago
https://youtu.be/K1IuquLxfxY
2
u/calunicornia 18h ago
ask claude where it can improve and refactor for efificiency, ask it to consider alternatives
2
u/regulator227 17h ago
Ask it what ideal architecture is for your type of project. Ask it to compare your project to those ideals. Ask it to refactor where the best practices hadn't been applied yet.
Half joking...
2
u/AIOSAI 🔆 Max 20 21h ago
Post ur architecture and we can review it. Ur ai can add the place holders. The shape ur working with
5
u/Manticorp 22h ago
https://github.com/mattpocock/skills
Learn to use these skills.
Software engineering is mostly about writing smart requirements.
Also...I wouldn't worry about scale until it becomes a problem.
If you're building apps for yourself, focus on making the apps good before making them scalable. You're unlikely to run into any issues
1
u/halflucids 22h ago
Ask it these questions about your project. One at a time in independent conversations, if it says this might be true or that might be true ask it to check, ask it to reorder and reorganize your code, ask it to look for duplication of logic where shared functions or services might work better, ask it to review the architecture and maintainability or your software. It can do a decent job at these things as long as you are asking the right questions and telling it to do the right things.
1
u/StretchyPear 21h ago
I think some of the first things you can are ask the LLM to make a spec that fits your app based on researching, a lot of smart people publish a lot about patterns, you don't need to know them all, you just want the LLM to stick to one and document it so the codebase is coherent and it doesn't spend a lot of context tracing through spaghetti. I'm sure there are *probably things out there now designed to work well with LLMs (some codebases even have a RAG and a spec repo that's constantly updated).
Then you can ask the LLM about the platform you're on and what happens if you get 10x user growth overnight, or 100, etc. what do the costs look like, would the server hit some kind of rate limit, etc, would features still work quickly, does search still work, etc?
You can even probably run the stack on your computer and ask the LLM to synthesize datasets to really stress test it and see where things should be updated.
Make a plan from the output of those chats, that would update according to whatever design pattern / architecture you're working on.
Add review loops to your work:
- plan a feature
- implement the feature
- ask claude (and another LLM if you're up for it) to review it in a separate chat
- update based on the reviews and test again
Its hard to just see red flags if you don't get the context of a system, so you'll have to specify around performance and that sort of thing. For instance I was reviewing code the other day where an engineer used claude to update a feature on an app I worked on, it looked innocent enough but a type that was persisted also stored encoded data, which is fine, but the context it was used in meant the user would have to wait while the data was decoded, I spotted it quickly because I work on the platform all the time but 'it looked right' everywhere. Some of that you can find out through profiling and instrumenting your app in the wild, I'm sure you find some in review too.
1
u/RoadsterTracker 21h ago
Honestly, use another tool to help you make the architecture. Spend a lot of time and ask it as many questions as you can. I usually start all of my projects doing a chat with Gemini because I can use it for basically free. I describe what I'm interested in, have it help me brainstorm some ideas, and then start to flesh out the architecture. I have more of an understanding then you do I suspect about such, but the key is to ask questions and get an architecture nailed down. Have multiple AI systems review the architecture.
1
u/Wise_Advertising_888 21h ago
Why don't you ask Claude Code to write a spec focusing on the non-functionals, and put some projected growth in there. If I have 1000 users at launch and then in 6 months I have 50K users how will the current architecture scale, what remediation action would be needed if any. Do some stress testing, if you are exposing APIs get Claude to write some test scripts that simulate escalating volumes of users.
1
u/Minimum-South-9568 21h ago
You learn by breaking. If you don’t know, ask Claude. If you don’t understand wtf Claude is talking about, ask Claude again. If you still can’t understand, build it and let it break, and then you will figure it out. Maybe you’re a genius non-dev brain surgeon or physicist and will learn it fairly quickly and maybe you’re a dolt that hasn’t read a book in 20 years and it will take much longer, either way there is no way to get there but through it. Unfortunately there is no simpler answer. If there was, Claude would have given it to you already and you wouldn’t be posting on Reddit.
1
u/norviking 21h ago
This will allow you to understand basics. There will be a gazillion edge cases you wont understand. Many experienced devs wont either. But you will learn as you go, as your seniors learned from stack overflow.
1
u/DirtyFenceSitter 21h ago
Just build, review problems that arise and figure them out.
The problems are mainly planning and architecture now.
1
u/Blueberry73 21h ago
that's the billion dollar question because even experienced devs are struggling with this
there are ways to mitigate things, and a lot depends on the type of software you're building. I recommend checking out matt pocock's skills and youtube videos, of all the "AI Engineers" out there he is the one that makes the most sense imo
but at the end of the day you will never truly know for sure
1
u/locbuilds 20h ago
have it write a short ARCHITECTURE.md first, just folders, what each module owns and where data lives, point to it from CLAUDE.md, then after each feature ask it to check the diff against that doc and flag anything that breaks it. catches most of the spaghetti before it piles up.
1
u/BoardMeeting101 20h ago
The bot is imperative, not declarative.
1
u/Haunting_Skin_2564 20h ago
You pay a dev to make sure you don't break it.
Lol, what if that's the new coding boom - babysitting vibe coders
1
u/Mad-riffer 19h ago
There are parts of the architecture that will be sensitive and parts that are not. Try to keep the sensitive stuff in specific files. If you follow the normal PR review process, it will be very obvious when those files are modified. Then you pay attention.
So how do you create those files correctly in the first place? I personally think it is luck as much as skill. You will need to recognize when the AI produces trash and be ready to start over a few times.
1
u/Comprehensive-Bar888 18h ago
It depends on what you're building. the more complex, the more you won't know starting out, even if you use AI.
1
u/s0ftware-dev 18h ago
The thing with software architecture is that it’s largely an emergent property of a software system, and as engineers, we are constantly evolving the architecture to ensure it remains aligned with the needs of the business.
My point is that architecture isn’t a one-and-done exercise. You can start with a target architecture designed to accommodate the requirements of your MVP but as you ship your product and identify new features you want to implement you need to continually evolve your architecture so that those features can be accommodated cleanly.
1
u/nate-078 16h ago
Is this serious?
In case you are wondering, you are the problem.
1
u/GyuminOh 12h ago
On your question 4: the red flag I watch for most in my own repos isn't ugly code, it's a second copy of something that already exists. A new helper that does what an old one does, a second config file, a new command name for an existing action, the old way kept "for compatibility". Every later feature then has two places to break, which is pretty much the "every new feature might break something" feeling you describe.
Two rules in my CLAUDE.md go straight at that:
You can check both without reading code. After each feature, ask Claude to list what the change duplicated or left behind, with file names, and what it deleted. A run of features that only ever add files and never remove any is the pile growing. locbuilds' architecture doc makes this easier, since "does this duplicate something in the doc" becomes a yes/no question.
On scaling, I'd go with what EnergeticallyMundane said: fix the load problems you can actually measure, not imagined ones.
1
u/GuidingPrinciples 10h ago
Of your three worries, I'd put understanding your own app first, because the other two lean on it. You may not be able to judge the code yet, but you can notice when a description of it stops making sense to you.
So my first subject would be this app more than architecture in general: what each main part is responsible for, and which parts a new feature has to touch. An architecture doc from the AI helps if you can retell it without looking. Where you get stuck, you have found the next thing to learn.
1
u/BarathKanna 7h ago
You won't get guarantees, but you can get early warnings. Three habits help a lot. Ask Claude to write a one page ARCHITECTURE.md listing each module, what it owns and what it must never touch, then make it read that file before every feature. Second, after every change ask which files changed and why. If a small feature touches eight files, the boundaries are leaking. Third, have it write end to end tests for your five most important user flows and run them after every change, so breakage shows up as a red test instead of a support email.
Scaling is mostly a later problem. Most apps die from unreadable code long before they die from too many users.
And yes, have it explain one file a day to you. That compounds.
1
u/barcodemerge 21h ago
Hire an engineer.
0
u/Sporaflow 22h ago
since your problem is architecture, learn it. not how to code it, just which architecture fits which need. and you can learn it with the agent itself. start with your framework: ask it what architectures exist for that framework, since a framework often imposes one, sometimes several. open long conversations and tell it right at the start, "i need to learn something", then get into a learning loop with it. always ask it to back things up with sources, give it yours if you have some, and keep a source open next to it to check. and be careful with anything new: new frameworks and architectures often get sold as revolutionary when they haven't proven themselves yet.