All projects

Independent project · Computer Science coursework

Canvas Website Builder

I hand-coded a drag-and-drop website builder with live preview and HTML export for my A-level Computer Science coursework.

My role
Research, design, implementation and testing, independently
Development
Hand-coded
Tools
React, TypeScript, Express, PostgreSQL

Researching and designing the builder

I researched, designed and hand-coded this myself for my A-level Computer Science coursework. I wanted to see if I could make it easier to build an HTML page by moving the elements around and seeing how they fit together.

I compared Hostinger’s website builder, Shopify and Carrd before writing my own requirements. I planned how the canvas, HTML generation, accounts and saved projects would fit together. I drew flowcharts for things like moving an element into another element and turning the resulting tree into HTML.

Building on the canvas

The builder has a library of elements like sections, headings and paragraphs. You can drag them onto the canvas, then move one element inside another to create a parent and child. Clicking an element opens its settings so you can change its content, classes, attributes or styles.

Loading video…
Nesting a heading and paragraph in a section, then editing the heading.

From blocks to HTML

I built the editor in React and TypeScript. Each block stores its HTML tag, its properties and a list of its children. The code view walks that tree to produce indented HTML you can use elsewhere. The live preview renders the page so you can check how the same structure looks in a browser.

Loading video…
Opening the live preview and inspecting the generated HTML.

Saving and reopening a project

When someone saves, the app sends the component tree to an Express server, which stores it as JSON in PostgreSQL. Opening a saved project loads the tree back into the editor so they can pick up where they left off.

Loading video…
Saving a new workshop heading and reopening the project to check it persisted.

Testing and documenting the project

I tested the full workflow from creating a project to reopening a saved page. I also tested usability with two users and ran a stress test with 50 elements, repeatedly moving them into and out of each other before saving.

I wrote the entire 226-page write-up and 71-page appendix myself. The write-up follows the project from the initial research and designs through to the code and test results. It shows how I worked through problems along the way, like fixing the HTML view’s line numbering so it counted lines of text inside an element. The appendix contains the original source code and supporting material.

Loading video…
Scrolling through all 226 pages of my write-up and straight into the 71-page appendix.