Skip to content
@store-craft

Storecraft

Next Generation Commerce as Code
Commerce as Code


The mono-repo

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)


GET STARTED WITH CLI NOW 👇

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: ['[email protected]']
  }
)
.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



Dashboard

Located at /api/dashboard



API Reference

Located at /api/reference (powered by Scalar)



CLI (npx storecraft create)



packages

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

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

Support for

  • Node
  • Deno
  • Bun
  • Cloudflare workers
  • AWS Lambda
  • Azure Functions
  • Google Functions

💾 Databases

Support for

📦 Storage

Support for,

📧 Email Providers

💳 Payments

Dashboard

The official dashboard

  • Learn how to use here
  • The code,
    • mount is as a component
    • consume from cdn

sdks

Test Runner

Test your app and database integrations with

@storecraft/core/test-runner

docs

Docs website code

CLI

npx storecraft create

CLI code

Examples Playground

Here

Author: Tomer Shalev ([email protected])

Popular repositories Loading

  1. storecraft storecraft Public

    ⭐ Next Generation Commerce As Code

    JavaScript 183 10

  2. .github .github Public

    github special repo

Repositories

Showing 2 of 2 repositories
  • storecraft Public

    ⭐ Next Generation Commerce As Code

    store-craft/storecraft’s past year of commit activity
    JavaScript 183 10 5 0 Updated Dec 22, 2024
  • .github Public

    github special repo

    store-craft/.github’s past year of commit activity
    0 0 0 0 Updated Oct 10, 2024

Top languages

Loading…

Most used topics

Loading…