Example apps
The examples live in the dg-run/examples repository. Every folder is a small, complete app with its own README, source files and a prebuilt .zip. Upload the zip under My apps to see the app running, or copy the source into a project of your own.
Nine of them use dgclient from npm: they import createDg from the package and bundle it into the app at build time, with no paths pointing back into this repository. To change one, clone the repository and install its dependencies in that folder first. market-pwa and todo-pwa are purely client-side.
basic-example, pro-notes, fa-subscriptions and grocery-pwa use the React hooks of dgclient/react (dgclient 0.3.0 or newer); the other samples use the client directly.
| Example | SDK | What it shows |
|---|---|---|
list-crud |
dgclient |
A live list with create, read, update and delete on the database; open it in two tabs and they stay in sync |
login-demo |
dgclient |
Sign in with dg.run in a few lines: signIn, user and signOut |
subscribe-demo |
dgclient |
Plans and a subscription on one page: list plans, send the user to pay, read their plan and unlock a feature |
basic-example |
dgclient |
Sign-in, a typed public guestbook and private notes, live updates, tags/roles, and real English and French pages for SEO |
pro-notes |
dgclient |
A free tier, trial, monthly/yearly and lifetime plans, plus sign-in, private notes and an entitlement-gated export |
fa-subscriptions |
dgclient |
The same billing flow in Persian (RTL), with USD and IRR plans |
config-demo |
dgclient |
Remote config declared in the manifest, changed live from the dashboard and kept offline |
logs-demo |
dgclient |
Logs, errors, repeated lines and batches in the owner's dashboard |
market-pwa |
— | A store page and an installed PWA at one address, with an install prompt and a service worker |
todo-pwa |
— | An offline-first React/Vite todo list stored in the browser with LokiJS |
grocery-pwa |
dgclient |
A barcode and QR scanner with a public price catalog, a private shopping list and summary, remote config, and an installable PWA |
Try an example
- Open one of the folders above on GitHub and download its ready-made
.zip. No build is needed. - Log in at
/loginwith any email (code55555on a local marketplace), upload the zip under My apps, test it, and approve the version as admin in/admin/projects. - Open the app at its own address — locally,
http://basic-example.localhost:3000/forbasic-example.
To change an example, clone dg-run/examples, cd into its folder and run npm install to get dgclient from npm. npm run pack rebuilds the zip once esbuild, React and TypeScript are available; see the folder's README. market-pwa and todo-pwa have no SDK.
Where to start
- The simplest start:
list-crud,login-demoandsubscribe-demoeach show one feature in a short, plain TypeScript app. - A first look:
basic-examplecovers the most ground: pages for people and search engines, sign-in, data, live updates and roles. - One feature at a time:
config-demoandlogs-demoare short, plain TypeScript apps. - Selling access: start with
pro-notes, then see the Persian version infa-subscriptions. - PWAs:
market-pwaseparates the store page from the installed app;todo-pwakeeps its data on the device;grocery-pwascans barcodes and QR codes and uses the app backend.
For a new project, use npm create dg (see Start your first app) rather than copying a whole example. The SDK examples are also a working reference for sign-in and database and plans and subscriptions.