# Saving your work

The Editor keeps your work in two different places, and it is worth knowing which
is which: a **local draft** that happens automatically in your browser, and a
**template** on the server that you save deliberately.

## The local draft

About a second after you stop typing, the Editor mirrors the document into your
browser's local storage. Closing the tab, reloading the page or a browser crash
cannot lose your work.

The next time you open the Editor, it offers the draft back:

![The dialog offering to restore unsaved work](@/images/editor/editor-restore-draft.png)

**Restore** picks up where you left off. **Discard** throws the draft away and
starts clean.

Three things to know about the draft:

- **It lives in one browser, on one machine.** It is not synced to your account,
  so it does not follow you to another computer, another browser, or a private
  window. Only a saved template does that.
- **There is one draft at a time.** Two tabs editing two different documents
  overwrite each other's draft. Nothing that was already saved to the server is
  affected, but only the last-written draft can be restored.
- **While the JSON view holds text that does not parse**, the draft keeps the last
  valid version of the document.

## The save-state dot

The dot next to the document name in the topbar reports where the document
stands:

| Dot | Meaning |
|---|---|
| Amber | Not on the server — the work exists only as a local draft |
| Grey check | Saved to the server as a template |
| Red | The local mirror itself failed — storage is full or disabled |

Clicking the dot saves, exactly like `Template → Save`.

## Saving to the server

Saving to the server is **always** an explicit action, from the **Template** menu:

![The Template menu](@/images/editor/editor-template-menu.png)

| Command | What it does |
|---|---|
| **New** | Starts a blank movie |
| **Open template…** | Opens one of your saved templates |
| **Save** (⌘S / Ctrl+S) | Overwrites the open template, with no dialog |
| **Save as template…** | Always creates a *new* template, so it doubles as "duplicate" |
| **Import JSON…** | Loads a `.json` file from your computer |
| **Export JSON** | Downloads the current document as a `.json` file |

**Save** is only available once the document *is* a template — on a new document
it is greyed out, and **Save as template…** is what you want.

There is deliberately **no automatic save to the server**. An automatic write
would replace your last known-good template with whatever half-finished state you
happened to be in, and two open tabs would overwrite each other without either of
them noticing. Saving stays a decision you make.

Saved templates appear in [Templates](@/guides/dashboard/templates) in the
dashboard, and can be rendered from the API by ID.

## Working without an account

Import and export need no account at all. The Editor opens a `.json` file from
your computer, edits it, previews it and writes it back out — a perfectly good
workflow if you keep your movies in a repository rather than in your JSON2Video
account.

Signing in adds the four things that need the API: opening and saving templates,
browsing your own media, and rendering.

## See also

- [Templates](@/guides/dashboard/templates)
- [Rendering](@/guides/editor/rendering)
