This houses Instant's javascript monorepo! Here's the lay of the land:
www/
- This is a nextjs app. It’s the frontend for instantdb.com, including the dashboard and docs.
packages/
- These are where our client libraries live:
sandbox/
- We built a few example apps, to make it easy to develop against the local version of
packages
.
- We built a few example apps, to make it easy to develop against the local version of
To kick everything off:
cd client
corepack enable # enables pnpm
pnpm i
make dev
With that, all frontend code should be up and running!
Visit localhost:3000, and you'll see Instant's homepage. You can make changes to the marketing pages, dashboard, or docs here.
If you press cmd + shift + 9
, you'll also see a devtool window pop up. This can be useful if you want to enable feature flags.
Right now all backend requests will go to api.instantdb.com. If you want to develop against your local backend, load localhost:3000, and set the devBackend
flag:
localStorage.setItem("devBackend", true);
Now all requests will go to your your local backend at localhost:8888. If you haven't set up a local backend, follow the server README
All client SDKs live in packages/
.
To develop against them, we've created a few sandbox
examples. These examples let you locally test changes to the client SDK. We recommend you create an app in your dev environment and use it in each directories .env
file
Based on what you change, you'll play with different examples:
@instantdb/core
➡sandbox/vanilla-js-vite/
@instantdb/react
➡sandbox/react-nextjs/
@instantdb/react-native
➡sandbox/react-native-expo/
@instantdb/admin
➡sandbox/admin-sdk-express
Check out the sandbox READMEs to see how to run them.
If you have any questions, feel free to drop us a line on our Discord!