Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .workback/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
### Prerequisites

Install dependencies:

- [Node](https://nodejs.org/en/download/)
- [pnpm](https://pnpm.io/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [Watchman](https://facebook.github.io/watchman/docs/install.html) (Development
only)

```
brew install watchman
```

### Start

```
nvm use 22.14
cp .env.example .env
pnpm i
# Start docker manually - docker daemon should be running
pnpm db:start
pnpm relay:build
pnpm dev
```

Visit: http://localhost:3000

### Stop

```
pnpm db:stop
# Delete node_modules just in case to force a fresh install
rm -rf node_modules/
# There is a node process that keeps restarting on port 2999. Kill it with
pkill -f "generateGraphQLArtifacts"
```

### Auth

Register for an account to bypass "sign in".

We gave ourselves super user permissions to play around
in `http://localhost:3000/admin/graphql` with this script:

```shell
pnpm node ./scripts/toolbox/assignSURole.js --add you@example.com
```

You can run GraphQL mutations in `localhost:3000/admin/graphql`:

```graphql
mutation upgradetoEnterprise {
draftEnterpriseInvoice(
orgId: "XXXXX",
quantity: <number>,
email: "exampeuser@email.com",
apEmail: "invoice@email.com",
plan: "stripe_api_price_id") {
organization {
tier
}
error {
message
}
}
}
```
8 changes: 8 additions & 0 deletions .workback/workback.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

cp .env.example .env && \
pnpm i && \
# Start docker manually - docker daemon should be running
pnpm db:start && \
pnpm relay:build && \
pnpm dev 2>&1 | tee .workback/dev_environment.log