Newton Institute of Technology Logo
Newton Institute of Technology Building Your Dream Career

How to Build Your First Web App Step by Step | Beginner Guide

Web Development Guide First App

How to Build Your First
Web Application Step by Step

Plan · Build · Test · Publish

Start with an empty folder and finish with a working Student Assignment Tracker you can store, test, debug and publish using HTML, CSS and JavaScript.

The build route

Build it. Test it. Publish it.

FocusFirst web application

ProjectAssignment tracker

Core stackHTML · CSS · JavaScript

Updated1 November 2026

Quick answer

How do you build your first web application?

Choose one small problem, define what Version 1 must do, then build one complete workflow before adding complexity. For this guide, you will create a Student Assignment Tracker with HTML, CSS and JavaScript, save its state in the browser, test valid and invalid actions, debug failures, check mobile and keyboard use, then publish and re-test the live version.

  • Plan
  • Build
  • Store
  • Test
  • Publish
ProblemOne useful workflow
FilesHTML · CSS · JS
StateAssignments array
StoragelocalStorage
TestingHappy + failure paths
DeploymentGitHub Pages

Build one small application from beginning to end

You do not need React, a backend server or a database for this first project. You will build a Student Assignment Tracker in the browser using HTML, CSS and JavaScript. The first version will Add → View → Complete → Delete → Remember assignments.

Problem

A student needs one place to record assignments and due dates.

Version 1

Add records, display them, change completion status, delete them and keep them after refresh.

Later

Only add servers, accounts and databases when several users or shared data make them necessary.

Scope rule

A first application succeeds when one useful workflow works reliably and you can explain it. More technologies do not automatically make the project better.

Step 1 · Requirements: Write the pass conditions before you write code

User story: “As a student, I want to record my assignments so that I can see what work is still pending.” Turn that into acceptance criteria you can test.

RequirementPass condition
AddA complete form creates one visible assignment.
ValidateMissing or whitespace-only text is rejected.
CompleteOne record can move between Pending and Completed.
DeleteOnly the selected record disappears.
RememberValid records return after a normal page refresh.
ResponsiveThe layout stays usable at 430, 390 and 360 px.
KeyboardFields and buttons remain reachable and operable without a mouse.
DeploymentThe published URL loads and the complete workflow still works.

On a phone, swipe horizontally to view the complete requirement and pass-condition columns.

Step 2 · Data: Decide what one assignment contains

Subject

Example: Mathematics.

Assignment

Example: Complete Exercise 5.

Due date

Example: 6 November 2026.

Status

Pending or completed.

assignment-object.js
{    id: “…”,    subject: “Mathematics”,    title: “Complete Exercise 5”,    dueDate: “2026-11-06”,    completed: false}

Steps 3–7 · Build the interface: Create the project, run localhost, then build HTML and CSS

Create the folder

Make assignment-tracker with index.html, styles.css and script.js.

Run localhost

Use your editor’s local server, or run py -m http.server 8000 on Windows / python3 -m http.server 8000 elsewhere, then open http://localhost:8000.

Build the interface

HTML defines the form and list; CSS gives spacing, focus states and a responsive layout; JavaScript will supply the behaviour.

Why localhost?

MDN notes that localStorage behaviour for file: URLs is not formally guaranteed. A normal local origin gives more consistent development behaviour. [2] [3] Localhost is also treated as a potentially trustworthy local development context. [5]

HTML

index.html
<!DOCTYPE html><html lang=”en”><head>    <meta charset=”UTF-8″>    <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>    <title>Student Assignment Tracker</title>    <link rel=”stylesheet” href=”styles.css”>    <script src=”script.js” defer></script></head><body>    <main class=”app”>        <header class=”app-header”>         <p class=”eyebrow”>My first web application</p>         <h1>Student Assignment Tracker</h1>         <p>Record assignments, due dates and completed work.</p>        </header>        <section class=”panel” aria-labelledby=”add-title”>         <h2 id=”add-title”>Add an assignment</h2>         <form id=”assignment-form”>         <div class=”form-group”>         <label for=”subject”>Subject (required)</label>         <input id=”subject” name=”subject” maxlength=”50″ required>         </div>         <div class=”form-group”>         <label for=”assignment”>Assignment (required)</label>         <input id=”assignment” name=”assignment” maxlength=”100″ required>         </div>         <div class=”form-group”>         <label for=”due-date”>Due date (required)</label>         <input type=”date” id=”due-date” name=”dueDate” required>         </div>         <button type=”submit”>Add assignment</button>         </form>         <p id=”form-message” class=”form-message” role=”status” aria-live=”polite”></p>        </section>        <section class=”panel” aria-labelledby=”list-title”>         <div class=”section-heading”>         <h2 id=”list-title”>Your assignments</h2>         <span id=”assignment-count” aria-live=”polite”>0 assignments</span>         </div>         <p id=”empty-state”>No assignments yet. Add your first one above.</p>         <ul id=”assignment-list” class=”assignment-list”></ul>        </section>    </main></body></html>

Each visible label is associated with its input through matching for and id values. W3C recommends proper labels so users and assistive technologies can identify form controls. [7] Required inputs and understandable validation feedback are also part of accessible form design. [8]

Checkpoint 1

Before styling, confirm the title, three labelled fields, Add assignment button and empty-state message all appear. Fix structure now rather than carrying a broken layer forward.

CSS

styles.css
* { box-sizing: border-box; }body { margin: 0; min-height: 100vh; font-family: Arial, sans-serif;    line-height: 1.6; background: #f4f6f8; color: #1f2937; }button, input { font: inherit; }.app { width: min(900px, 92%); margin: 0 auto; padding: 48px 0; }.app-header { margin-bottom: 32px; }.eyebrow { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }.panel { background: #fff; border-radius: 16px; padding: 24px;    margin-bottom: 24px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }#assignment-form, .form-group { display: grid; gap: 18px; }.form-group { gap: 6px; }label { font-weight: 700; }input { width: 100%; padding: 12px; border: 1px solid #cbd5e1;    border-radius: 8px; }input:focus-visible, button:focus-visible { outline: 3px solid rgba(37,99,235,.35);    outline-offset: 2px; }button { border: 0; border-radius: 8px; padding: 11px 16px; cursor: pointer; }#assignment-form > button { background: #1f2937; color: #fff; font-weight: 700; }.section-heading { display: flex; justify-content: space-between;    align-items: center; gap: 16px; }.assignment-list { list-style: none; padding: 0; margin: 20px 0 0;    display: grid; gap: 12px; }.assignment-item { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; }.assignment-item.completed { opacity: .72; }.assignment-item.completed h3 { text-decoration: line-through; }.assignment-details h3, .assignment-details p { overflow-wrap: anywhere; }.assignment-actions { display: flex; flex-wrap: wrap; gap: 10px; }.complete-button { background: #e2e8f0; }.delete-button { background: #fee2e2; }.form-message { min-height: 24px; margin-top: 12px; font-weight: 600; }@media (max-width: 600px) {    .app { width: min(94%, 900px); padding: 24px 0; }    .panel { padding: 18px; }    .section-heading { align-items: flex-start; flex-direction: column; }}

Checkpoint 2

Refresh. The interface should have white panels, visible spacing, keyboard focus, readable buttons and a layout that contracts cleanly on small screens. If the styling disappears, verify the exact styles.css filename and path.

Steps 8–16 · Add behaviour, state and persistence: Connect JavaScript, validate saved data and render application state

JavaScript interacts with the page through the Document Object Model (DOM), the browser representation that scripts can inspect and change. [1]

Connect the DOM

Get the form, fields, list, count, empty state and status-message elements by ID.

Load defensively

Read saved JSON inside try/catch and keep only records with the expected field types.

Save state

Convert the assignments array to JSON and save it under one storage key. If saving fails, tell the user.

Render

Build visible DOM elements from the current assignments array instead of treating the screen as the source of truth.

What localStorage does—and does not do

QuestionAnswer
Survive a normal refresh?Normally yes.
Follow the user to another device?No.
A cloud database?No.
Can clearing site data remove it?Yes.
Ideal for large datasets?No. Web Storage is synchronous; larger browser data may be better handled by alternatives such as IndexedDB.
Appropriate for passwords or secrets?No.

On a phone, swipe horizontally to compare each localStorage question and answer.

MDN documents localStorage as origin-based browser storage and notes that Web Storage operations are synchronous. [2] Structured arrays and objects can be stored by serialising them to JSON and parsing them when read. [3]

State mental model

Data changes → save state → render state. The list on screen is an output of the assignments array, not the other way around.

Assemble the final JavaScript in one file

The incremental steps are useful for learning, but beginners also need one place to confirm that braces, functions and event listeners are in the correct order. The script below is the consolidated version.

script.js
const STORAGE_KEY = “studentAssignmentTracker.assignments.v1”;const form = document.getElementById(“assignment-form”);const subjectInput = document.getElementById(“subject”);const assignmentInput = document.getElementById(“assignment”);const dueDateInput = document.getElementById(“due-date”);const assignmentList = document.getElementById(“assignment-list”);const assignmentCount = document.getElementById(“assignment-count”);const emptyState = document.getElementById(“empty-state”);const formMessage = document.getElementById(“form-message”);function isValidAssignment(item) {    return item &&        typeof item.id === “string” &&        typeof item.subject === “string” &&        typeof item.title === “string” &&        typeof item.dueDate === “string” &&        typeof item.completed === “boolean”;}function loadAssignments() {    try {        const saved = localStorage.getItem(STORAGE_KEY);        if (!saved) return [];        const parsed = JSON.parse(saved);        return Array.isArray(parsed) ? parsed.filter(isValidAssignment) : [];    } catch (error) {        console.error(“Could not load saved assignments:”, error);        return [];    }}let assignments = loadAssignments();function saveAssignments() {    try {        localStorage.setItem(STORAGE_KEY, JSON.stringify(assignments));        return true;    } catch (error) {        console.error(“Could not save assignments:”, error);        formMessage.textContent = “This browser could not save the list.”;        return false;    }}function formatDate(dateString) {    const [year, month, day] = dateString.split(“-“).map(Number);    const date = new Date(year, month – 1, day);    return date.toLocaleDateString(undefined, {        year: “numeric”, month: “short”, day: “numeric”    });}function renderAssignments() {    assignmentList.replaceChildren();    emptyState.hidden = assignments.length > 0;    assignmentCount.textContent = `${assignments.length} ${        assignments.length === 1 ? “assignment” : “assignments”    }`;    assignments.forEach((assignment) => {        const listItem = document.createElement(“li”);        listItem.className = “assignment-item”;        if (assignment.completed) listItem.classList.add(“completed”);        const details = document.createElement(“div”);        details.className = “assignment-details”;        const title = document.createElement(“h3”);        title.textContent = assignment.title;        const information = document.createElement(“p”);        information.textContent = `${assignment.subject} • Due ${formatDate(assignment.dueDate)} • ${assignment.completed ? “Completed” : “Pending”}`;        details.append(title, information);        const actions = document.createElement(“div”);        actions.className = “assignment-actions”;        const completeButton = document.createElement(“button”);        completeButton.type = “button”;        completeButton.className = “complete-button”;        completeButton.textContent = assignment.completed ? “Mark incomplete” : “Mark complete”;        completeButton.setAttribute(“aria-pressed”, String(assignment.completed));        completeButton.setAttribute(“aria-label”, `${completeButton.textContent}: ${assignment.title}`);        completeButton.addEventListener(“click”, () => toggleAssignment(assignment.id));        const deleteButton = document.createElement(“button”);        deleteButton.type = “button”;        deleteButton.className = “delete-button”;        deleteButton.textContent = “Delete”;        deleteButton.setAttribute(“aria-label”, `Delete: ${assignment.title}`);        deleteButton.addEventListener(“click”, () => deleteAssignment(assignment.id));        actions.append(completeButton, deleteButton);        listItem.append(details, actions);        assignmentList.append(listItem);    });}form.addEventListener(“submit”, (event) => {    event.preventDefault();    const subject = subjectInput.value.trim();    const title = assignmentInput.value.trim();    const dueDate = dueDateInput.value;    if (!subject || !title || !dueDate) {        formMessage.textContent = “Please complete all fields.”;        return;    }    assignments.push({        id: crypto.randomUUID(), subject, title, dueDate, completed: false    });    const saved = saveAssignments();    renderAssignments();    form.reset();    subjectInput.focus();    if (saved) formMessage.textContent = “Assignment added successfully.”;});function toggleAssignment(id) {    assignments = assignments.map((assignment) =>        assignment.id === id        ? { …assignment, completed: !assignment.completed }        : assignment    );    const saved = saveAssignments();    renderAssignments();    if (saved) formMessage.textContent = “Assignment status updated.”;}function deleteAssignment(id) {    assignments = assignments.filter((assignment) => assignment.id !== id);    const saved = saveAssignments();    renderAssignments();    if (saved) formMessage.textContent = “Assignment deleted.”;}renderAssignments();

crypto.randomUUID() creates a version 4 UUID in secure contexts; MDN documents this API and its secure-context requirement. [4] The form handler uses preventDefault() so JavaScript can process the submission in the current page.

Checkpoint 3

Add Biology / Plant Cell Diagram / a future due date. Add a second assignment, mark one complete, delete the other, then refresh. The remaining record should still be present.

Follow one assignment through the application

  1. HTML shows the form. Amina enters Biology, Plant Cell Diagram and a date.
  2. The submit event fires. JavaScript reads and trims the fields.
  3. Validation runs. Empty or whitespace-only text is rejected.
  4. An object is created. It receives a unique ID and completed: false.
  5. State changes. The object enters the assignments array.
  6. State is saved. The array is serialised into localStorage.
  7. The interface renders. Safe text nodes display the subject, title, date and Pending status.
  8. After refresh. Stored JSON is parsed, validated and rendered again.

Create

Add an assignment.

Read

Display saved assignments.

Update

Toggle completion status.

Delete

Remove the selected assignment.

Those four operation categories are often summarised as CRUD: Create, Read, Update, Delete. You will meet the same pattern later in database-driven applications.

Steps 17–20 · Verify, break and fix: Test the application against its requirements

TestActionExpected result
Valid addComplete all fieldsOne assignment appears.
Missing fieldLeave a required field emptySubmission is blocked.
Spaces onlyEnter spaces in a text fieldJavaScript rejects the value after trim().
HTML-like textEnter <b>Test</b>It appears as text, not injected HTML.
ToggleComplete then undo one recordStatus changes correctly both ways.
DeleteDelete one of several recordsOnly the chosen record disappears.
RefreshReload the pageSaved valid records return.
KeyboardUse Tab / Enter / SpaceControls remain reachable and usable.
MobileTest 430 / 390 / 360 pxNo unwanted horizontal page overflow.
ConsoleRun normal workflowNo unexpected JavaScript errors.

On a phone, swipe horizontally to view the complete test matrix.

Break it deliberately

Break CSS

Change styles.css to style.css. The page keeps its content but loses presentation. Restore the path.

Break JavaScript

Change script.js to scripts.js. The interface appears but interactive behaviour stops. Inspect Console/Network.

Break an ID

Ask for wrong-form instead of assignment-form. Use the Console to trace the missing element, correct it and re-test.

Debug by symptom

SymptomFirst place to investigate
Entire page missingHTML / local server
No stylingCSS path / filename
Button does nothingJavaScript / Console
Wrong record changesID / state logic
Change vanishes after refreshStorage / save logic
Only mobile breaksResponsive CSS
Works locally, fails onlinePublished paths, filename case, deployment source

On a phone, swipe horizontally to view the debugging symptom map.

Step 21 · Deployment: Publish the finished browser app with GitHub Pages

Because this project is static HTML, CSS and JavaScript, GitHub Pages is one suitable publishing option. GitHub’s current documentation supports publishing from a selected branch/folder. [9]

  1. Create a GitHub repository.
  2. Add index.html, styles.css and script.js.
  3. Commit the files.
  4. Open repository Settings → Pages.
  5. Choose Deploy from a branch.
  6. Select the publishing branch and correct folder.
  7. Open the generated Pages URL.
  8. Repeat the add, toggle, refresh, delete and mobile tests on the live site.

If the published site does not work

ProblemCheck first
404Publishing source, branch/folder and whether index.html is in the expected location. GitHub identifies missing or incorrectly located entry files as a common Pages 404 cause. [10]
No CSSExact CSS path and filename case.
Buttons failConsole and script.js path.
Old version appearsLatest commit/deployment and browser cache.
Saved data seems differentRemember that localStorage is tied to the site origin/browser, not a shared account.

On a phone, swipe horizontally to view the full deployment troubleshooting table.

Know when the project needs a backend and database

Browser-only

User → HTML interface → JavaScript → browser storage. Good for a small personal learning project.

Full-stack

Browser → frontend → API → backend → database. Useful when users, permissions and centrally managed records are required.

A backend becomes justified when teachers and students need separate accounts, the same records must appear on several devices, or the organisation needs central control and backups. JavaScript’s Fetch API is commonly used by browser code to make HTTP requests and process responses. [6]

NIT’s current Full-Stack Software Development programme page lists 8 months of institutional training followed by a compulsory industrial attachment of 3 months, with current published tuition of KSh 90,000 and beginner entry that does not require previous coding experience. [12]

Keep the topic boundary clear

This article teaches the first complete build cycle. NIT’s dedicated API, database and full-stack guides cover those later layers in depth rather than duplicating them here.

Use the same thinking in three real-life applications

Small shop stock tracker

Data: product, quantity, reorder level.

Rule: if quantity is below reorder level, show LOW STOCK.

Actions: add product, change quantity, remove product.

Appointment tracker

Data: customer, service, appointment time, status.

Rule: clearly distinguish Waiting, Completed and Cancelled.

Actions: add, complete or cancel.

Machine service tracker

Data: machine, service item, service interval, current reading.

Rule: compare current reading with the next service interval.

Output: show a maintenance warning when appropriate.

Rebuild without copying line by line

Choose one example and define its requirement, data, actions, state, persistence and tests from a blank folder. That is the strongest proof that you understood the method.

Do not put sensitive information in this learning project

Do not store passwords, payment information, secret API keys, identity documents, confidential student records or private customer information in this browser-storage demo. Production systems require deliberate server-side validation, authentication, authorisation, access control and secure credential handling.

The OWASP Top 10:2025 highlights major web-application risks including broken access control, security misconfiguration, software supply-chain failures, cryptographic failures, injection and authentication failures. [11]

Learning demo ≠ production system

The purpose of this project is to learn application flow safely. Adding real confidential data does not make it more realistic; it makes the risk unnecessary.

Improve the app only after Version 1 works

Better browser experience

Edit, search, subject filters, sort by due date and overdue indication.

Shared data

Add a backend, API and database when multiple devices/users need the same records.

Accounts and permissions

Add registration, login, teacher/student roles and authorised actions.

School workflow

Add classes, teacher-created work, submissions, notifications and reports.

Can you explain the application without the tutorial open?

Close the guide and explain: the user problem, why there are three files, how JavaScript reaches HTML through the DOM, what triggers submission code, where application state lives, why data survives refresh, why every assignment has an ID, why user text is inserted with textContent, where you would look when a button stops working, and why a multi-user version needs more than localStorage.

The proof that you understood it

If you can rebuild one of the transfer examples and explain those answers in your own words, you are moving beyond tutorial imitation into application-development thinking.

First web application: frequently asked questions

Can a complete beginner build a web application?

Yes. Keep the first project small and use the browser fundamentals directly. A client-side app with HTML, CSS and JavaScript is a manageable starting point.

Can HTML, CSS and JavaScript build a web application?

Yes. HTML defines structure, CSS controls presentation and JavaScript supplies behaviour. Server-side technology becomes necessary when the requirements call for shared records, accounts or central business rules.

Do I need React for my first web application?

No. Understanding DOM events, state and browser behaviour first makes later framework learning easier.

Do I need a database?

Not for this personal learning app. Add a database when information must be centrally managed, shared or related across users and devices.

Is localStorage permanent?

Do not treat it as backup storage. Users can clear site data, browser settings can restrict storage, and private-browsing data may be removed when the private session ends. [2] [3]

Why use a local server?

It gives the project a normal local web origin and avoids relying on browser-specific file: storage behaviour. [3]

What should I build next?

Rebuild the same development cycle for a stock tracker, appointment tracker or service tracker, then move into APIs, backend development and databases.

Move from your first app to complete systems

Register for Full-Stack Software Development at Newton Institute of Technology

Progress from browser fundamentals into complete applications that connect frontend interfaces with backend logic, APIs, databases, testing and deployment through practical project work.

Call / WhatsApp+254 713 584 858

Emailinfo@niteducation.com

LocationMigori Town, Migori County

References and further reading

Information checked: 1 November 2026.

Editorial responsibility: Newton Institute of Technology Editorial Team.