How to build a web page from first principles:

How to build a web page from first principles — illustration 1

When I first started building web pages, I created endpoints all willy-nilly—no plan, no structure, just vibes. Over time, I realized how much time I was wasting refactoring. Here’s the simple, repeatable workflow I now use to build organized, functional, and consistent web pages from the ground up.

Phase 1: Define the Page

Before you even open your IDE, document what the page should do.

  • Function: What purpose does this page serve?
    (e.g., user login, viewing analytics, submitting a form)
  • Endpoints: What information should this page send or receive from the backend?
    (e.g., /api/login, /api/users/:id)
  • References: How do users access this page? / What other pages does this one link to?

This step forces you to clearly define what is needed for your page. The goal is to explicitly define the contract between your front and back ends.

Phase 2: Wireframe the Page

Now, sketch it out—literally or digitally.

  • Here you should break your page into sections (header, main, footer, sidebar, etc.)
  • Consider the spacing of each component; Ask your self if your page feels cluttered or empty.
  • Map each endpoint you defined earlier onto the part of the page where that data appears or is collected.

This helps ensure every visual element on your site serves a real function. Don’t spend your time building components you delete ten minutes later.

Phase 3: Design the Components

With structure in place, it’s time to make it come alive!

  • Identify what type of component fits each endpoint.
    For example, a login page might include:
  • a POST /api/login endpoint and corresponding form components for username and password fields.
  • Start thinking about typography, and layout consistency.

Thanks for listening!

Originally published on Medium.