In my earlier episodes, I learned React piece by piece — components, props, state. But everything was small examples. So I took the next step: I built a complete, real website — a landing page for a digital agency — and I want to show you exactly how. This is the written companion to my YouTube episode (React from Scratch #5, in Moroccan Darija): https://youtu.be/UCKbmOi8l4k
1. Start a new project, then clean it up
Create a fresh React project and run it locally to confirm everything works. Then delete the demo content you don't need and keep only the base you'll build on.
One thing to get right from the start: in React, you don't write the whole website in one file. You split it into small parts, and each part has one clear responsibility. That habit is what saves you later, when the project grows.
2. The Header
The header is the part at the top: the agency logo and the navigation links (Home, Services, Contact).
I made it its own component, in its own file — not inside the main file. Why? Because if I later want to change the header's color, add a link, or reuse the same header on other pages, the work is easy and organized.
Add some styling: logo on one side, links on the other, proper spacing — and the header is done.
3. The Hero section
This is the first thing a visitor sees after the header, so it has to be clear: a big title (something like "We help you build a professional digital presence"), a short description of what the agency does, a button ("Discover our services"), and an illustration.
The button shouldn't be decoration. I linked it to the Services section, so clicking it takes the visitor straight there.
Keep the hero simple: one clear title, one short description, one button that points to the next step. Don't overload it with text.
4. The Services section — where components prove their worth
Now the real lesson. The agency has three services: website design, app development, and digital solutions. Each one has a title, a short description, and the same card layout.
Should I write the same code three times? I could — but that's not organized. Instead, I built ONE ServiceCard component and used it three times, each time passing a different title and description as props.
<ServiceCard title="Website Design" description="Modern, fast websites that fit your business." /> <ServiceCard title="App Development" description="Mobile and web apps built to solve real problems." /> <ServiceCard title="Digital Solutions" description="Tools and strategies that grow your presence online." /> If I want to change the design of all the cards, I edit one component. That's the real power of React: reuse the same parts intelligently, without repeating code for no reason.
5. The Footer, and checking the phone
The last part is the footer: the agency name, a short line, and contact information. Then I put all the components together in the main file — Header, Hero, Services, Footer — and the code stays readable, because each part has its own file.
One more thing matters: the website has to work well on a phone. I shrank the screen and checked: the service cards that sat side by side on a computer stack on top of each other on a phone, and the links and buttons still work.
The result
A complete website, built from an empty page: header, hero, services, footer — organized into components, and working on computer and phone.
Your challenge: change the site's colors, add a new section about the agency, and give it its own component. If you can do that on your own, you're starting to understand how real websites are built with React.
In the next article, I take this same website and turn it into a real multi-page site with React Router: https://dev.to/wahib_el_khadiri_0/i-turned-a-single-page-react-site-into-a-real-multi-page-app-with-react-router-1n6b
I'm Wahib El Khadiri, a junior full-stack developer from Kénitra, Morocco. I build with React, Node.js and Laravel, contribute to open source, and teach React in Darija on YouTube. Portfolio: https://wahib-portfolio.netlify.app — GitHub: https://github.com/WAHIB-EL-KHADIRI

