Realtime collab - PostgreSQL database
A package containing a PostgreSQL database and a default set of resolvers that plug into @pdftron/collab-server
.
Spec (internal)
This module should contain a few things.
- A script that connects to a PostgreSQL server and creates a new database with the necessary architecture. This script should accept params for the name of the database and anything else the user might want to configure, as well as the URL & port we should connect to to create the database.
This might look something like this:
node @pdftron/collab-db-postgresql/dist/create.js --host=1.1.1.1 --port=9000 --username=root --password=password --dbName=myDB
- A package that exports the resolvers to plug into
@pdftron/collab-server
The required resolvers can be found in packages/collab-server/src/index.ts
This might look something like this:
import CollabServer from '@pdftron/collab-server'
import CollabDatabase from '@pdftron/collab-db-postgresql';
const db = new CollabDatabase({
host: '1.1.1.1',
port: '9000',
dbName: 'nameOfDb',
username: 'db_user',
password: 'db_user'
})
const resolvers = db.getResolvers();
const server = new CollabServer(resolvers)
server.start();
Requirements
Strict error handling / error checking
- If a table doesn't exist that we expect to exist, let the user know
- If we cannot connect to the DB, let them know why if possible
Ease of use
- This should be useable by anyone with very little database knowledge
- As little configuration as possible. We are allowed to make assumptions here
Reabable
- This will be an open source module. Keep code clean and easy to follow
- The module should be written in Typescript
Secure
- This is an open source module, so do not commit and private keys or anything the public should not see. If you need help with this, ask Logan for more info.