Dev Container
Spindle Starter includes a Dev Container configuration, so you can get a fully working development environment with zero local setup. This works with GitHub Codespaces, VS Code Dev Containers, or any editor that supports the devcontainer spec.
What You Get
The Dev Container provides:
- Node.js 22 pre-installed
- Dependencies installed automatically on creation (
npm install) - Port 4321 forwarded — the dev server opens in your browser automatically
- VS Code extensions — ESLint and Prettier pre-configured
Using GitHub Codespaces
The fastest way to get started — no local installation needed at all.
- Go to the spindle-starter repository
- Click Use this template → Create a new repository
- Name your repository (e.g.
my-story) and create it - On your new repository, click the green Code button
- Switch to the Codespaces tab
- Click Create codespace on main
GitHub will build the container, install dependencies, and open VS Code in your browser. Once it's ready:
npm startThe dev server starts and Codespaces automatically opens it in a new browser tab.
WARNING
Don't create a codespace directly on the spindle-starter template repository — your changes would only exist in that ephemeral codespace with no repository to push to. Always create your own repository first.
Using VS Code Locally
If you prefer working locally but want the containerized environment:
Prerequisites
- Docker installed and running
- VS Code with the Dev Containers extension
Steps
Clone the repository:
shnpx degit rohal12/spindle-starter my-story cd my-storyOpen the folder in VS Code:
shcode .VS Code will detect the
.devcontainer/folder and show a notification: "Reopen in Container" — click it. Or use the command palette (Ctrl+Shift+P/Cmd+Shift+P) and select Dev Containers: Reopen in Container.Wait for the container to build and dependencies to install, then:
shnpm start
The dev server starts on port 4321, which is automatically forwarded to your local machine.
Configuration
The Dev Container is configured in .devcontainer/devcontainer.json:
| Setting | Value | Purpose |
|---|---|---|
image | mcr.microsoft.com/devcontainers/javascript-node:22 | Node.js 22 base image |
postCreateCommand | npm install | Installs dependencies when the container is created |
forwardPorts | [4321] | Forwards the dev server port |
extensions | ESLint, Prettier | Pre-installs useful VS Code extensions |
You can customize this file to add more extensions, environment variables, or other tools you need.