Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/store-craft/storecraft
Next Generation Commerce As Code
https://github.com/store-craft/storecraft
ecommerce ecommerce-platform javascript serverless
Last synced: 20 days ago
JSON representation
Next Generation Commerce As Code
- Host: GitHub
- URL: https://github.com/store-craft/storecraft
- Owner: store-craft
- Created: 2024-01-16T22:04:57.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-22T12:28:59.000Z (9 months ago)
- Last Synced: 2024-04-28T03:12:41.275Z (8 months ago)
- Topics: ecommerce, ecommerce-platform, javascript, serverless
- Language: JavaScript
- Homepage:
- Size: 34.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - store-craft/storecraft - ⭐ Next Generation Commerce As Code (JavaScript)
- awesome-starred - store-craft/storecraft - ⭐ Next Generation Commerce As Code (JavaScript)
README
Commerce as Code
# The mono-repo
Hi 👋, `Storecraft` is a next generation Commerce As Code javascript backend.
⭐ run on any javascript [platform](https://storecraft.app/docs/backend/platforms/node) (deno, bun, node, workers, aws-lambda, google-functions), serverless / serverful
⭐ connect to any [database](https://storecraft.app/docs/backend/databases/sqlite) (mongo, sqlite, postgres, mysql, neon, turso, d1, planetscale)
⭐ use [storage](https://storecraft.app/docs/backend/storage/s3) (local, r2, s3 compatible, google and more)
⭐ It is [extensible and modular](https://storecraft.app/docs/backend/extensions/overview)
⭐ It is [event based](https://storecraft.app/docs/backend/events)
⭐ Boasts an official [Dashboard](https://storecraft.app/docs/dashboard/overview)
⭐ Well documented [REST-API](https://storecraft.app/docs/rest-api/api) (can also be found in your `/api/reference` endpoint)
## **GET STARTED WITH CLI NOW** 👇
```bash
npx storecraft create
```Storecraft emphesizes modular commerce as code to achieve business logic,
```js
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 = 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](scalar.com))
# 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
```bash
npm install
```The following is the layout of the packages
### Core ([@storecraft/core](https://github.com/store-craft/storecraft/tree/main/packages/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](https://github.com/store-craft/storecraft/tree/main/packages/core/platform)
Support for
- Node
- Deno
- Bun
- Cloudflare workers
- AWS Lambda
- Azure Functions
- Google Functions### 💾 Databases
Support for
- MongoDB ([@storecraft/database-mongo-node](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-mongodb/))
- SQLite ([@storecraft/database-sqlite](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-sqlite/))
- Postgres ([@storecraft/database-postgres](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-postgres/))
- MySQL ([@storecraft/database-mysql](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-mysql/))
- SQL Base ([@storecraft/database-sql-base](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-sql-base/))
- Neon (Cloud Postgres, [@storecraft/database-neon](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-neon/))
- PlanetScale (Cloud Mysql, [@storecraft/database-planetscale](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-planetscale/))
- Turso (Cloud Sqlite, [@storecraft/database-turso](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-turso/))
- D1 (Cloud Sqlite, [@storecraft/database-cloudflare-d1](https://github.com/store-craft/storecraft/tree/main/packages/databases/database-cloudflare-d1/))### 📦 Storage
Support for,
- Local storage (Node, Bun, Deno), [@storecraft/core/storage](https://github.com/store-craft/storecraft/tree/main/packages/storage/core/storage/)
- S3 Compatible ([@storecraft/storage-s3-compatible](https://github.com/store-craft/storecraft/tree/main/packages/storage/storage-s3-compatible/))
- Cloudflare R2
- AWS S3
- DigitalOcean Spaces
- MinIO
- Google Storage ([@storecraft/storage-google](https://github.com/store-craft/storecraft/tree/main/packages/storage/storage-google/))### 📧 Email Providers
- node smtp support [@storecraft/mailer-smtp](https://github.com/store-craft/storecraft/tree/main/packages/mailers/mailer-smtp/)
- Http Mail services [@storecraft/mailer-providers-http](https://github.com/store-craft/storecraft/tree/main/packages/mailers/mailer-providers-http/)
- mailchimp support
- mailgun support
- resend support
- sendgrid support### 💳 Payments
- Stripe [@storecraft/payments-stripe](https://github.com/store-craft/storecraft/tree/main/packages/payments/payments-stripe/)
- Paypal [@storecraft/payments-paypal](https://github.com/store-craft/storecraft/tree/main/packages/payments/payments-paypal/)
- You can roll your own (guide [here](backend/checkout-and-payments/roll-your-own))### Dashboard
The official dashboard
- Learn how to use [here](dashboard/overview)
- The [code](https://github.com/store-craft/storecraft/tree/main/packages/dashboard/),
- mount is as a component
- consume from cdn### sdks
- Universal (front/back) Javascript SDK, [@storecraft/sdk](https://github.com/store-craft/storecraft/tree/main/packages/sdk/)
- React Hooks SDK, [@storecraft/sdk-react-hooks](https://github.com/store-craft/storecraft/tree/main/packages/sdk-react-hooks/)### Test Runner
Test your app and database integrations with
[@storecraft/core/test-runner](https://github.com/store-craft/storecraft/tree/main/packages/core/test-runner/)
### docs
Docs website [code](https://github.com/store-craft/storecraft/tree/main/packages/docs/)
### CLI
```bash
npx storecraft create
```CLI [code](https://github.com/store-craft/storecraft/tree/main/packages/cli/)
### Examples Playground
[Here](https://github.com/store-craft/storecraft/tree/main/packages/playground/)
```text
Author: Tomer Shalev ([email protected])
```