Skip to content

Commit a7a4a1f

Browse files
committed
Improve readmes
1 parent 69e9ec1 commit a7a4a1f

File tree

4 files changed

+44
-110
lines changed

4 files changed

+44
-110
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/19345049/602bafa0-41ce-4cee-a432-56848c278722"/></a>
33
</p>
44

5-
PowerSync is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
5+
_Bad connectivity is everywhere, and we're tired of it. PowerSync is on a mission to help developers write offline-first real-time reactive apps._
6+
7+
[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
68

79
# PowerSync JavaScript SDKs
810

@@ -27,7 +29,7 @@ PowerSync is a service and set of SDKs that keeps Postgres databases in sync wit
2729

2830
## Demo Apps / Example Projects
2931

30-
Demo applications are located in the [`demos/`](./demos/) directory.
32+
Demo applications are located in the [`demos/`](./demos/) directory. Also see our [Demo Apps / Example Projects gallery](https://docs.powersync.com/resources/demo-apps-example-projects), which lists all projects by the backend and client-side framework they use.
3133

3234
- [demos/nextjs-supabase-todolist](./demos/nextjs-supabase-todolist/): A Next.js to-do list example app using the PowerSync Web SDK and a Supabase backend.
3335
- [demos/yjs-nextjs-supabase-text-collab](./demos/yjs-nextjs-supabase-text-collab/README.md): A Next.js real-time text editing collaboration example app powered by [Yjs](https://github.com/yjs/yjs) CRDTs and [Tiptap](https://tiptap.dev/), using the PowerSync Web SDK and a Supabase backend.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# PowerSync SDK common JS
22

3-
This package contains pure TypeScript common functionality for the PowerSync SDK.
3+
This package contains a TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation, which is used in the following SDKs:
4+
- [packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md)
5+
- [packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md)

packages/powersync-sdk-react-native/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
<p align="center">
2+
<a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/19345049/602bafa0-41ce-4cee-a432-56848c278722"/></a>
3+
</p>
4+
15
# PowerSync SDK for React Native
26

3-
[PowerSync](https://powersync.co) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases. See a summary of features [here](https://docs.powersync.co/client-sdk-references/react-native-and-expo).
7+
[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
8+
9+
This package ([packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md)) is the PowerSync SDk for React Native clients. It is an extension of `packages/powersync-sdk-common`.
10+
11+
See a summary of features [here](https://docs.powersync.co/client-sdk-references/react-native-and-expo).
412

513
# Installation
614

@@ -90,6 +98,16 @@ npx expo run:android
9098
npx expo run:ios
9199
```
92100

93-
# Learn More
101+
# Getting Started
102+
103+
Our [SDK reference](https://docs.powersync.com/client-sdk-references/react-native-and-expo) contains everything you need to know to get started implementing PowerSync in your project.
104+
105+
# Examples
106+
107+
For example projects built with PowerSync and React Native, see our [Demo Apps / Example Projects](https://docs.powersync.com/resources/demo-apps-example-projects#react-native-and-expo) gallery.
108+
109+
# Found a bug or need help?
94110

95-
Refer to our [full documentation](https://docs.powersync.com/client-sdk-references/react-native-and-expo) to learn more.
111+
* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :)
112+
* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug.
113+
* Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team.
Lines changed: 16 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
<p align="center">
2+
<a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/19345049/602bafa0-41ce-4cee-a432-56848c278722"/></a>
3+
</p>
4+
15
# PowerSync SDK for Web
26

3-
[PowerSync](https://powersync.co) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
7+
[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
8+
9+
This package ([packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md)) is the PowerSync SDK for JavaScript Web clients. It is an extension of `packages/powersync-sdk-common`.
10+
11+
See a summary of features [here](https://docs.powersync.com/client-sdk-references/js-web).
412

513
## Beta Release
614

@@ -24,114 +32,18 @@ Install it in your app with:
2432
npm install @journeyapps/wa-sqlite
2533
```
2634

27-
## Logging
28-
29-
This package uses [js-logger](https://www.npmjs.com/package/js-logger) for logging.
30-
31-
Enable JS Logger with your logging interface of choice or use the default `console`
32-
33-
```JavaScript
34-
import Logger from 'js-logger';
35-
36-
// Log messages will be written to the window's console.
37-
Logger.useDefaults();
38-
```
39-
40-
Enable verbose output in the developer tools for detailed logs.
41-
42-
The WASQLite DB Adapter opens SQLite connections inside a shared webworker. This worker can be inspected in Chrome by accessing
43-
44-
```
45-
chrome://inspect/#workers
46-
```
47-
4835
# Getting Started
4936

50-
See our [Docs](https://docs.powersync.co/usage/installation/client-side-setup) for detailed instructions.
51-
52-
```JavaScript
53-
import {
54-
Column,
55-
ColumnType,
56-
WASQLitePowerSyncDatabaseOpenFactory,
57-
Schema,
58-
Table
59-
} from '@journeyapps/powersync-sdk-web';
60-
61-
export const AppSchema = new Schema([
62-
new Table({ name: 'customers', columns: [new Column({ name: 'name', type: ColumnType.TEXT })] })
63-
]);
64-
65-
let PowerSync;
66-
67-
export const openDatabase = async () => {
68-
PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({
69-
schema: AppSchema,
70-
dbFilename: 'test.sqlite',
71-
flags: {
72-
// This is disabled once CSR+SSR functionality is verified to be working correctly
73-
disableSSRWarning: true,
74-
}}).getInstance();
75-
76-
await PowerSync.init();
77-
78-
// Run local statements.
79-
await PowerSync.execute('INSERT INTO customers(id, name) VALUES(uuid(), ?)', ['Fred']);
80-
};
81-
82-
class Connector {
83-
async fetchCredentials() {
84-
// TODO logic to fetch a session
85-
return {
86-
endpoint: '[The PowerSync instance URL]',
87-
token: 'An authentication token',
88-
expiresAt: 'When the token expires',
89-
};
90-
}
91-
92-
async uploadData(database) {
93-
// Upload local changes to backend, see docs for example
94-
}
95-
}
96-
97-
export const connectPowerSync = async () => {
98-
const connector = new Connector(); // Which was declared above
99-
await PowerSync.connect(connector);
100-
};
101-
102-
```
103-
104-
React hooks are available in the [@journeyapps/powersync-react](https://www.npmjs.com/package/@journeyapps/powersync-react) package
37+
Our [full SDK reference](https://docs.powersync.com/client-sdk-references/js-web) contains everything you need to know to get started implementing PowerSync in your project.
10538

106-
## Multiple Tab Support
39+
# Examples
10740

108-
Using PowerSync between multiple tabs is supported on some web browsers. Multiple tab support relies on shared web workers for DB and sync streaming operations. When enabled shared web workers named `shared-sync-[dbFileName]` and `shared-DB-worker-[dbFileName]` will be created.
41+
For example projects built with PowerSync on Web, see our [Demo Apps / Example Projects](https://docs.powersync.com/resources/demo-apps-example-projects#js-web) gallery.
10942

110-
The shared database worker will ensure writes to the DB will instantly be available between tabs.
43+
# Found a bug or need help?
11144

112-
The shared sync worker will co-ordinate for one active tab to connect to the PowerSync instance and share the latest sync state between tabs.
113-
114-
Currently using the SDK in multiple tabs without enabling the `enableMultiTabs` flag will spawn a standard web worker per tab for DB operations. These workers are safe to operate on the DB concurrently, however changes from one tab may not update watches on other tabs. Only one tab can sync from the PowerSync instance at a time. The sync status will not be shared between tabs, only the oldest tab will connect and display the latest sync status.
115-
116-
Multiple tab support is not currently available on Android or Safari.
117-
118-
Support is enabled by default if available. This can be disabled as below:
119-
120-
```Javascript
121-
PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({
122-
schema: AppSchema,
123-
dbFilename: 'test.sqlite',
124-
flags: {
125-
// This is disabled once CSR+SSR functionality is verified to be working correctly
126-
disableSSRWarning: true,
127-
/**
128-
* Multiple tab support is enabled by default if available. This can be disabled by
129-
* setting this flag to false.
130-
*/
131-
enableMultiTabs: false
132-
}}).getInstance();
133-
```
45+
* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :)
46+
* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug.
47+
* Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team.
13448

135-
## Demo Apps
13649

137-
See the [list of demo apps](https://github.com/powersync-ja/powersync-web-sdk/?tab=readme-ov-file#demos) in the repo README.

0 commit comments

Comments
 (0)