The
mono-repo
Hi π, Storecraft empowers developers to rapidly build AI-powered, Headless e-commerce backends with TypeScript and Javascript.
β AI first, agentic, chat endpoint and similarity search that can serve your customers, and your team. We Supports most of the popular LLMs, and vector stores for similarity search.
β Manage products, collections, orders, customers, auth, emails and more with a powerful programmable api code, REST API, VQL (Virtual Query Language) for powerful queries and similarity search.
β Built in chat endpoint with an agent that serves customers with carts, checkouts and more with PayPal, Stripe and RazorPay.
β Runs on any javascript platform (deno, bun, node, cloudflare workers, aws-lambda, google-functions), serverless / serverful
β Connects to any database (mongo, libsql, sqlite, postgres, mysql, neon, turso, d1, planetscale)
β Uses 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)
GET STARTED WITH CLI NOW π
npx storecraft create
This is all the code you need to get started with your own storecraft app.
const app = new App({
auth_admins_emails: ['[email protected]'],
general_store_name: 'Wush Wush Games',
// ... MORE Mandatory CONFIG
})
.withPlatform(new NodePlatform())
.withDatabase(new LibSQL())
.withStorage(new NodeLocalStorage('storage'))
.withMailer(new Resend())
.withPaymentGateways({
paypal: new Paypal({ env: 'test' }),
stripe: new Stripe(),
dummy_payments: new DummyPayments(),
})
.withExtensions({
postman: new PostmanExtension(),
})
.withAI(
new OpenAI({ model: 'gpt-4o-mini'})
)
.withVectorStore(
new LibSQLVectorStore({
embedder: new OpenAIEmbedder(),
})
)
.withAuthProviders({
google: new GoogleAuth(),
})
.on(
'order/checkout/complete',
async (event) => {
// send a team slack message
}
).init();
await migrateToLatest(app._.db, false);
await app._.vector_store?.createVectorIndex();
http
.createServer(app.handler)
.listen(
8000,
() => {
app.print_banner('http://localhost:8000');
}
);
Will produce a server
Chat with the storeraft AI agent
Located at /chat
Dashboard
Located at /dashboard
API Reference
Located at /api (powered by Scalar)
CLI (npx storecraft create)
As seen on MongoDB TV stream
Dvelopment
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
πΎ Databases
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 / Libsql (Local and Cloud Sqlite, @storecraft/database-turso)
- D1 (Cloud Sqlite, @storecraft/database-cloudflare-d1)
π¦ Storage
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)
π§ Email Providers
- Http Mail services @storecraft/mailer-providers-http
- mailchimp support
- mailgun support
- resend support
- sendgrid support
- node smtp support @storecraft/mailer-smtp
π³ Payments
- Stripe @storecraft/payments-stripe
- Paypal @storecraft/payments-paypal
- RazorPay @storecraft/payments-razor-pay
- You can roll your own (guide here)
Dashboard
The official dashboard
Chat
The official Chat
sdks
- Universal (front/back) Javascript SDK, @storecraft/sdk
- React Hooks SDK, @storecraft/sdk-react-hooks
Test Runner
Test your app, database, storage and more integrations with
docs
Docs website code
CLI
npx storecraft create
CLI code
Examples Playground
Releasing
The source of truth for the versioning and publishing is the mono-repo version. All the published packages are synced to the mono-repo version. Packages in the mono-repo source code might have different versions but it doesn't matter for the published packages.
Versioning
All versions are synced to the mono-repo version, and are published to npm. Each of the commands:
npm run release:version:patch
npm run release:version:minor
npm run release:version:major
Will,
- Only update the version of the mono-repo.
- Add a git tag of the version.
Publishing
When running the command:
npm run release:publish
It will,
- Update the version of all the packages in the mono-repo to the same version as the mono-repo.
- Publish all the packages to
npmwith the same version as the mono-repo.
This can be done in a CI/CD pipeline, or manually.
Author: Tomer Shalev ([email protected])
