Skip to content

Instrument/conversationai-moderator

 
 

Repository files navigation

OSMod

Scripts

Install

Install all dependencies

./bin/install

Setup local MySQL:

mysql -uroot os_moderator < packages/backend-core/seed/initial-database.sql 
./bin/osmod migrate

OSMOD commands

./bin/osmod ...
  • migrate Migrate the database up
  • migrate:undo Reverse a database migration
  • users:create Create new OS Moderator users
  • users:get-token Get a JWT token for a user specified by id or email
  • denormalize Re-run denormalize counts
  • exec Run a subcommand with app.yaml environment
  • comments:recalculate-text-sizes Using node-canvas, recalculate comment heights at a given width.
  • comments:calculate-text-size Using node-canvas, calculate a single comment height at a given width.
  • comments:recalculate-top-scores Recalculate comment top scores.
  • comments:rescore Rescore comment.

Users

Create

Create OS Moderator users via the command line.

Create a human user:

./bin/osmod users:create --group general --name "Name" --email "email@example.com"

Create a service user:

./bin/osmod users:create --group service --name "Robot"
Get Token

Get JWT tokens for existing users via the command line:

By user id:

./bin/osmod users:get-token --id 4

By email:

./bin/osmod users:get-token --email "email@example.com"

Local Dev

Runs local server on :8080 and front-end on :8000

./bin/watch

Publish

Uses Lerna to publish to the different npm packages

./bin/publish

Lint

./bin/lint

optionally you can run lint-fix to attempt auto-fixing most lint errors

./bin/lint-fix

Storybook

Diffs storyshots of the current code against the last saved.

./bin/storybook

To update stories that need new snapshots, go to packages/frontend-web and run

npm run storybook:test -- -u

About

A machine-assisted human-moderation toolkit.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.7%
  • JavaScript 1.3%
  • Other 1.0%