Skip to content
Projects

About

online open source whiteboard — sketch ideas, share boards . No signup/login required.

Web & App Development

How these counts are measured

Measured star growth

in 24h
Collecting history
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Craftbase

npm version

Craftbase is a minimal online whiteboard. You open it and start drawing instantly. There is no signup and no setup required.

Try it: craftbase.org

Craftbase demo

History and motivation

I released the first alpha of Craftbase in 2022. You can see the LinkedIn post from back then.

My early motivation came from Excalidraw, tldraw and Whimsical. Using them is what got me started on building my own whiteboard. Also taking bit of inspiration from jsbin, like how you can debug and brainstorm with web apps, share it with peers and once you are done, you can just literally exit and throw it away. Just like that , in craftbase, you can brainstorm your ideas on canvas to understand either software architecture, working model of a specific technology or start impromptu discussions , share with others and instead of throwing away, given that its infinite canvas, you can erase it or draw somewhere else on other space in the board.

Recently, with advent of coding agents, I am reviving it back again and maintaining it. Flying under the radar, but to let you know, I use it for my daily work, whether its for annotating on software's UI/UX (like you can take screenshot of a web page, drag it on craftbase board, draw/annotate on it and report back to the team), understanding the working model of some component or brainstorming with customer prospects.

How it's built

Architecture

P.S. this architecture diagram is infact drawn on craftbase board :)

The canvas is rendered with two.js, a 2D drawing library by Jono Brandel. Two.js draws the scene. React handles the UI and state around it.

The main component is the Board. It owns the canvas, the sidebar and the floating toolbar. Rendering goes through this chain:

Board (global state) → Canvas → ElementsRenderer → Component Element (event handler for each element) → Component Factory

Canvas has the rendering logic and the input handling (mouse, drag, zoom, pan). Each element type (shape, arrow, pencil stroke) has two parts:

  • Factory. Produces the element's template definition. Lives in src/factory/.
  • Element. A React component that mounts the element into the scene and attaches its event listeners. Lives in src/components/elements/.

State is shared through React Context (BoardContext). There is no global store.

Stack: React, TypeScript, Vite, Two.js, Apollo Client and Hasura (GraphQL).

Use it in your React app

Craftbase is also shipped as an npm package. You can embed the whiteboard in your own React app with the <Craftbase /> component.

npm install craftbase
import { useRef, useState } from 'react'
import { Craftbase } from 'craftbase'
import type { CraftbaseData, CraftbaseHandle } from 'craftbase'
import 'craftbase/style.css'

export function Whiteboard() {
    const [data, setData] = useState<CraftbaseData>()
    const board = useRef<CraftbaseHandle>(null)

    return <Craftbase initialData={data} onChange={setData} ref={board} />
}

The board is 600px tall and full width by default. Change it with the width and height props. It needs react and react-dom 18 or 19. For props, saving and loading data and the full API, see the package docs on npm.

Running it locally

This repo is the frontend. The backend is in craftbase-hasura. You need both running to use the full app locally.

Backend

Follow the setup steps in the craftbase-hasura README.

Frontend

Install dependencies:

yarn

Create a .env file in the project root. Copy the contents of .envexample into it.

Start the dev server:

yarn start

The app runs at http://localhost:5180 and hot-reloads as you edit.

Other scripts:

yarn build       # production build into ./dist
yarn preview     # serve the production build locally
yarn typecheck   # tsc --noEmit
yarn test        # unit tests (vitest)
yarn test:e2e    # end-to-end tests (playwright)

Contributing

I work on this mostly on weekends. So expect the occasional bug. If you hit one, or want a feature, open an issue.

Explore related projects

Loading…