Hi 👋, Storecraft
is a next generation Commerce As Code javascript backend.
⭐ run on any javascript platform (deno, bun, node, workers, aws-lambda, google-functions), serverless / serverful
⭐ connect to any database (mongo, sqlite, postgres, mysql, neon, turso, d1, planetscale)
⭐ use storage (local, r2, s3 compatible, google and more)
⭐ It is extensible and modular
⭐ It is event based
⭐ Boasts an official Dashboard
⭐ Well documented REST-API (can also be found in your /api/reference
endpoint)
npx storecraft create
Storecraft emphesizes modular commerce as code to achieve business logic,
import { App } from '@storecraft/core'
import { NodePlatform } from '@storecraft/core/platform/node'
import { MongoDB, migrateToLatest } from '@storecraft/database-mongodb'
import { R2 } from '@storecraft/storage-s3-compatible'
const app = new App(
{
auth_admins_emails: ['john@doe.com']
}
)
.withPlatform(new NodePlatform())
.withDatabase(new MongoDB({ db_name: 'test' }))
.withStorage(new R2())
.withPaymentGateways(
{
'stripe': new Stripe(
{
publishable_key: process.env.STRIPE_PUBLISHABLE_KEY,
secret_key: process.env.STRIPE_SECRET_KEY,
webhook_endpoint_secret: process.env.STRIPE_WEBHOOK_SECRET
}
)
}
).on(
'auth/signup',
async (event) => {
const user: Partial<AuthUserType> = event.payload;
// Here you can send an onboarding email for example
}
).on(
'orders/checkout/complete',
async (event) => {
const order_data: OrderData = event.payload;
// Here send an email with order details to customer
}
);
await app.init();
await migrateToLatest(app.db, false);
const server = http.createServer(app.handler).listen(
8000,
() => {
console.log(`Server is running on http://localhost:8000`);
}
);
Will produce
Located at /api/dashboard
Located at /api/reference
(powered by Scalar)
This is a mono repo, where each folder in the packages
folder is a package, that is published @npm
.
It leverages the workspace feature of npm
To start developing a feature first
npm install
The following is the layout of the packages
Core (@storecraft/core)
The core engine of storecraft
- core types
- core API
- core database types
- core crypto types
- core storage types
- core mailer types
- core payments types
- core platform types
- core VQL types and logic
- core REST API controller
🌐 Platforms @storecraft/core/platform
Support for
- Node
- Deno
- Bun
- Cloudflare workers
- AWS Lambda
- Azure Functions
- Google Functions
Support for
- MongoDB (@storecraft/database-mongo-node)
- SQLite (@storecraft/database-sqlite)
- Postgres (@storecraft/database-postgres)
- MySQL (@storecraft/database-mysql)
- SQL Base (@storecraft/database-sql-base)
- Neon (Cloud Postgres, @storecraft/database-neon)
- PlanetScale (Cloud Mysql, @storecraft/database-planetscale)
- Turso (Cloud Sqlite, @storecraft/database-turso)
- D1 (Cloud Sqlite, @storecraft/database-cloudflare-d1)
Support for,
- Local storage (Node, Bun, Deno), @storecraft/core/storage
- S3 Compatible (@storecraft/storage-s3-compatible)
- Cloudflare R2
- AWS S3
- DigitalOcean Spaces
- MinIO
- Google Storage (@storecraft/storage-google)
- node smtp support @storecraft/mailer-smtp
- Http Mail services @storecraft/mailer-providers-http
- mailchimp support
- mailgun support
- resend support
- sendgrid support
- Stripe @storecraft/payments-stripe
- Paypal @storecraft/payments-paypal
- You can roll your own (guide here)
The official dashboard
- Universal (front/back) Javascript SDK, @storecraft/sdk
- React Hooks SDK, @storecraft/sdk-react-hooks
Test your app and database integrations with
Docs website code
npx storecraft create
CLI code
Author: Tomer Shalev (tomer.shalev@gmail.com)