Open-source, self-hostable headless commerce backend: products, orders, and customers with an admin UI and a Shopify-compatible Admin API. Runs on Node and Cloudflare Workers.
TypeScript
139
0 commits
updated Jul 4, 2026
Open-source, self-hostable headless commerce backend. Picocart gives you a product catalog, orders, and customers behind a clean admin UI, plus a Shopify-Admin-compatible GraphQL API so existing Shopify client code can talk to it with minimal changes.
Built with Astro, React, Prisma, and PostgreSQL. Runs on Node and Cloudflare Workers.
admin and viewer roles, plus custom rolesRequirements: Node.js >= 20 and a PostgreSQL database.
git clone https://github.com/autonnel/picocart.git
cd picocart
npm install
cp .env.example .env # then edit DATABASE_URL
npm run db:push # create tables
npm run dev
Open http://localhost:4322 and go to /register — on a fresh install the
first registered user becomes the administrator.
| Variable | Purpose | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | — (required) |
PORT | HTTP port | 4322 |
Everything else — currencies, API keys, users, roles, and S3 storage — is configured in the admin UI under Settings.
Endpoint:
POST /admin/api/2024-01/graphql.json
Authenticate with an API key created under Settings → API Keys, sent as either header:
X-Shopify-Access-Token: <token>
Authorization: Bearer <token>
The API implements the subset of the Shopify Admin GraphQL API needed for
catalog and order integration: product / variant queries (including
contextualPricing for multi-currency), order creation and lookup, and
refunds. It is not a complete Shopify implementation.
npm run build
npm start
A production Dockerfile is included; the container listens on port 4322.
npm run deploy:cf
This generates wrangler.toml from wrangler.toml.template (see
scripts/generate-wrangler.mjs for the required CF_* environment
variables), builds with the Cloudflare adapter, and deploys with Wrangler.
Alternatively, use Cloudflare's Git integration (Workers Builds) instead of
deploying from your machine: run npm run generate:wrangler once, commit the
resulting wrangler.toml to your own repository (it is listed in
.gitignore here, so remove that entry or git add -f wrangler.toml), then
connect the repository in the Cloudflare dashboard with build command
npm run build:cf and deploy command npx wrangler deploy. Every push to
your deploy branch then goes live automatically.
npm run dev # dev server on :4322
npm test # vitest (database-backed tests skip when no PostgreSQL is reachable)
npm run verify # schema + types + tests + reference checks
npm run db:studio # browse the database
Contributions are welcome — see CONTRIBUTING.md. Please report security issues privately as described in SECURITY.md.
TypeScript
81.1%
Astro
15.3%
JavaScript
2.1%
Open-source, self-hostable headless commerce backend: products, orders, and customers with an admin UI and a Shopify-compatible Admin API. Runs on Node and Cloudflare Workers.
TypeScript
139
0 commits
updated Jul 4, 2026
Open-source, self-hostable headless commerce backend. Picocart gives you a product catalog, orders, and customers behind a clean admin UI, plus a Shopify-Admin-compatible GraphQL API so existing Shopify client code can talk to it with minimal changes.
Built with Astro, React, Prisma, and PostgreSQL. Runs on Node and Cloudflare Workers.
admin and viewer roles, plus custom rolesRequirements: Node.js >= 20 and a PostgreSQL database.
git clone https://github.com/autonnel/picocart.git
cd picocart
npm install
cp .env.example .env # then edit DATABASE_URL
npm run db:push # create tables
npm run dev
Open http://localhost:4322 and go to /register — on a fresh install the
first registered user becomes the administrator.
| Variable | Purpose | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | — (required) |
PORT | HTTP port | 4322 |
Everything else — currencies, API keys, users, roles, and S3 storage — is configured in the admin UI under Settings.
Endpoint:
POST /admin/api/2024-01/graphql.json
Authenticate with an API key created under Settings → API Keys, sent as either header:
X-Shopify-Access-Token: <token>
Authorization: Bearer <token>
The API implements the subset of the Shopify Admin GraphQL API needed for
catalog and order integration: product / variant queries (including
contextualPricing for multi-currency), order creation and lookup, and
refunds. It is not a complete Shopify implementation.
npm run build
npm start
A production Dockerfile is included; the container listens on port 4322.
npm run deploy:cf
This generates wrangler.toml from wrangler.toml.template (see
scripts/generate-wrangler.mjs for the required CF_* environment
variables), builds with the Cloudflare adapter, and deploys with Wrangler.
Alternatively, use Cloudflare's Git integration (Workers Builds) instead of
deploying from your machine: run npm run generate:wrangler once, commit the
resulting wrangler.toml to your own repository (it is listed in
.gitignore here, so remove that entry or git add -f wrangler.toml), then
connect the repository in the Cloudflare dashboard with build command
npm run build:cf and deploy command npx wrangler deploy. Every push to
your deploy branch then goes live automatically.
npm run dev # dev server on :4322
npm test # vitest (database-backed tests skip when no PostgreSQL is reachable)
npm run verify # schema + types + tests + reference checks
npm run db:studio # browse the database
Contributions are welcome — see CONTRIBUTING.md. Please report security issues privately as described in SECURITY.md.
TypeScript
81.1%
Astro
15.3%
JavaScript
2.1%