So the general concept around “engineering” that stuff is called Software Engineering. (which sounds obvious but let me break it down hehe)
Software Engineering usually consists of more than just “coding”. It encapsulates the entire process of building software. We will use the example you gave, where the client more or less wants a CMS style application for their business. So as a starter you’d probably proceed with the following in vague steps:
1. Determine the problem the client is trying to solve with software.
“Why do you want a site? What goals do you have for this site? What sort of user’s would you want to reach with this software?” etc etc. You can think of a whole bunch of questions to get an idea of the mindset of your client. If you noticed this has nothing to do with the implementation, rather it has to do with what the client wants/needs. Its possible you and the client might find different requirements by going over the problem together, this is normal, as its very easy to get hung up on one thing or another and not realize what anyone is trying to solve.
2. Determine the requirements for the project, which will more or less solve the problems you’ve understood from the first step
This is where you can define what the software will accomplish, focus on, need to do from the list of problems. Its possible some problems wont be covered by your software due to one reason or another. Its also here you usually start formulating an idea in your mind how much “work” will be involved, and how much it will cost. A CMS system can be really simple, or really complicated. A key thing to consider is how complex something could get, and if building a custom solution is better than just providing an off the shelf one yourself.
3. Determine how to implement the defined requirements
This is where you plan out the actual coding/architecture/technologies to match the requirements you have. Going back to the fact a custom CMS system might scale to massive complexity or stay fairly simple means there is a wide range of possible routes you could take, all the way down to building nothing and using an existing off the shelf CMS system with your client.
This is where you take your plannings and implement them. Odds are you will need feedback over time, depending on how you want to execute your project workflow, this could include continuous updates to the client (agile) and updates over short sprints, or 1 larger update near the end (waterfall).
5. Get feedback, tweak, learn
You could end up going back to a previous step during this step, or you could be done. I purposely made the overall process more vague in terms of when and how often you want to execute these steps.
I personally like taking a more “agile” feedback driven approach. This means deploying and getting feedback early, often and quickly so you can keep iterating. This is what a lot of larger tech companies do and you could do to, but again it depends on what your building and your own experience in executing such tasks this way. Do what you can how you know, just keep in mind that you are building for the client first and foremost.
These aren’t rock solid steps, and if you noticed I more or less 100% skipped over actual technical details, as they are inherit to the underlying goal of building a solution to a problem using technology. For specific questions such as:
The answer more or less lies with your understanding of the client needs, and your ability to answer to the client needs with the skills you know and have.
Even a more complex problem like “how do I design my database”? All goes back to the client needs. Technically even the existence of a database, or you building any software at all could be on the table, from there what the client needs or could need should all be taken into account when building your database models and schemas.
I think the biggest misconception is that there is a “right way” to do every single project. There are usually multiple ways to do the same thing, and solve your client’s problems. The “most right” way is understand the underlying problem and execute to the best of your ability a solution that solves that problem, learning and iterating as you go along to keep getting closer.
PS. if you have more specific questions about what you could do or should do, getting more focused feedback is usually better over time. From your client and from the community as a whole.