Setup
Here's how to get AstroTable running locally.
Prerequisites
Node.js 22.12.0 or later is required.
Install
npm install
If you plan to run the E2E tests (Playwright), also run this once:
npx playwright install chromium
Start the dev server
npm run dev
The site is available at http://localhost:4321. Editing a Markdown file triggers an automatic reload.
Once the dev server is running, visit /en/block-library to see every Block currently available, how it renders, and the Markdown source that produces it. It's a handy reference to keep open while writing pages.
Main commands
Build and preview
npm run build— runs a production build and outputs static files todist/npm run preview— serves the build output locally so you can check it
Tests
npm run test— runs the unit tests (Vitest)npm run test:watch— runs the unit tests in watch modenpm run e2e— runs the end-to-end tests (Playwright)
Quality checks
npm run lint— lints the codebase with ESLintnpm run typecheck— type-checks the project withastro check
Scaffolding
npm run new:block— scaffolds a new Blocknpm run new:product— scaffolds a new product entry (when the commerce module is in use)
Where to go next
- To learn how pages are written, see Writing pages in Markdown.
- For an overview of the repository layout, see Directory structure.