Create an organisation
Choose the email address you’ll use to sign in with Google. The generated organisation is invite-only: --email creates an invitation for that address with the Employee and Administrator roles.
Set these variables in your terminal before running init, because the CLI imports the organisation as part of setup. The placeholders are enough to build the project and view the sign-in page. To sign in, use your Google OAuth web client’s values instead and register http://localhost:4020/oauth/google/callback as an authorised redirect URI.
export GOOGLE_CLIENT_ID=local-placeholderexport GOOGLE_CLIENT_SECRET=local-placeholderbunx --package @processfocus/cli@0.1.0-next.4 pfcli init ./my-org \ --email admin@example.com --identity-provider googlecd my-orgReplace admin@example.com with your chosen address. Use a new or empty directory for my-org. Its name becomes the organisation name, My Org.
Open src/org.ts to find the Operations department, its Manager role, the admin invitation and the Todo process. The CLI also installs dependencies and creates the local database at db/pf.db. If installation stopped after the files were written, fix the install error and continue in my-org. Building the local runtime repeats the import.
Use a passkey instead of Google
Section titled “Use a passkey instead of Google”In 0.1.0-next.4, pfcli init scaffolds an OAuth provider. To use only passkeys, run the scaffold above with placeholders. Then in src/org.ts, replace the block from const authenticationConfiguration through the end of configureOrg with:
export const Configuration = { version: 1, groups: [] } as const
export const configureOrg = Effect.sync(() => { new AuthenticationConfig(org, "auth", { inviteOnly: true, passkey: { rpName: "My Org" }, }) return org})Keep the Effect and AuthenticationConfig imports, the policies and the invitation. Remove the unused Config, configurationField, ConfigurationContract and AuthenticationConfigProps imports. The runtime supplies the passkey origin. You don’t need Google credentials or a callback URL.