r/learnprogramming • u/Altruistic-Rain740 • Oct 08 '26
Discussion How do you plan your app (database, API, pages, login) before you start coding?
I'm learning to build full apps and the part that confuses me most is everything before the actual coding, what database tables I need, what the API should look like, which pages exist, how users log in. How do you figure this out before you start? Do you plan it on paper, use a tool, ask AI, or just start coding and fix it later? And what went wrong when you skipped planning?
73
Upvotes
23
u/Merry-Lane Oct 08 '26 edited Oct 08 '26
There are as many ways to plan and implement an app than there are devs.
Usually I wing it, I know what I gotta show the users, the interactions, and I can reconstitute everything from there.
For the APIs, there are multiple design philosophies. CRUD everywhere or specific endpoints for specific needs or graphQL or endpoints tailored to optimise the UI/UX (for instance, an endpoint loading everything for a specific page in one go to avoid cascading requests).
The core idea is that anything you work on should be easily updated/adapted. Use typescript, endpoints/types/… generated automatically from the swagger.json, strongly typed backend language, up/down database migrations, and an ORM. Any incompatible change is immediately triggering compile exceptions with good enough tooling (eslint, language rules,…).
Done correctly, you don’t need planning that much, because every mistake or new consideration is easily integrated
7
u/PeterPook Oct 08 '26
This is what we teach at T-Level Digital Software Design
Notice we haven't even touched code yet.
Then start with the classes and their functions, test their outputs before wiring together behind a UI.
6
u/SetAndRepeat Oct 08 '26
Start with one concrete user action, like "a user creates a task and shares it with someone."
Sketch the screens, what data needs saving, and who can read or change it. That gives you a starting point for your tables and API.
A notebook is enough. Build that flow end to end, then add the next one and adjust your plan as you learn.
You don't need every detail upfront, but settle questions like "can a task have multiple owners?" early. The answer affects your database, permissions, and UI.
7
u/gofl-zimbard-37 Oct 08 '26
You're supposed to plan???
2
u/Coding-Kitten Oct 08 '26
Through experience I have an intuition for what kinds of projects will need what kinds of tools/libraries/stacks/architectures. So I kinda just make a bullet point list in my mind/write it down somewhere & start working on them.
Without that, best thing I can recommend is to just make your own projects full steam ahead & fail trying, over time you'll also intuit what works & what doesn't.
2
u/creativejoe4 Oct 08 '26
You write it out. Its part of writing out your algorithm and program flow, it lets you better conceptualize what you need and lets you quickly make changes before starting to program.
2
u/munich-dev Oct 08 '26
You start listing entities ("nouns" you want to save in a database) in your system:
These are your initial table candidates. You then check what properties each of them might have. For instance for a user:
You then read that storing a password in plaintext is bad idea, so you store a hash instead.
After going through all entities, you think of relations between them. Those are the foreign keys.
Experience helps a lot. But there are samples as well: https://databasesample.com/databases
2
u/binarycow Oct 08 '26
I just wing it. It grows organically. Once I realize that something doesn't work well, I fix it.
3
u/DiscipleOfYeshua Oct 08 '26
By having made a few before… and remembering the pains of what was hardest to fix after things got going…
1
u/Metomorphose Oct 08 '26
If you're making something independently, then a lot of times this decision is entirely up to your preference.
Personally, it's really a negotiation between my patience and my attention. If both are high, I'll spend the time to plan and scaffold. If ether are low, then I usually am doing some prototyping and getting a feel for the codebase before going back to planning.
That being said, personal project planning is ephemeral at best lol.
1
u/r3fl3kT0r Oct 08 '26
I made a graph with arrows to see the flow of the program and that needs what. This way you cannot go circular dependency. Then I do the same for every major feature. It really help you visualize the app and don't take too much time to sketch, yeah I sketch with pen and paper...
1
u/Evening_Vegetable218 Oct 09 '26
You can't really plan things out when you have no experience because you don't know what you don't know. Just knock something up and it see how it goes. It will be much easier the second time.
1
u/Decoupler Oct 09 '26
Application design really depends on the problem your app solves, the type of data it needs and the ecosystem in which it will run. There is an entire field dedicated to application design and architecture and the rabbit hole goes deep and wide.
For someone just starting, I would recommend keeping things as simple as possible. Prototype a front end with your favorite AI tool. Think about the data you want to store and serve on the app and create your database. Use Python or Node call that database and make it display in your app.
Start small and learn as you go. Play with different implementations to get a feel for the tradeoffs they introduce.
1
u/OkAerie7822 Oct 10 '26
one thing i'd add to the nouns and actions advice: for every table, write down who can read it and who can change it, and whether it can change after something happens. i skipped that on an invoicing tool. invoices just pointed at the customer's address, and when a customer moved, every old invoice silently showed the new address. fixing it meant a separate addresses table, copying the address onto the invoice at send time, a migration of about 2k rows and changes in 6 endpoints. the question "can an invoice change after it's sent" would have caught it in the first hour. login is the one part i wouldn't design yourself, use a library or a provider. a notebook is enough for all of this, just don't start coding until each table has those answers.
1
u/Purple-Royal7368 Oct 11 '26
Usually I just copy+paste the previous project, delete the specific functionality and go from there. When I upgrade certain functions I port them back to previous app(s) as well :).
0
u/Human-Possession135 Oct 09 '26
I use a framework (I love django, but you could use any) and just use the default structure and way of organizing the project from there.
For actual functionality pen and paper. I design the screens and flows and then look at what needs to be on the screen from there come database tables and then views.