samepage-network / samepage.network

samepage.network
MIT License
10 stars 2 forks source link

Windows Onboarding #77

Closed mdroidian closed 1 year ago

mdroidian commented 1 year ago

Left out creating a user token and apps table seed

token

We have a webhook on Clerk that assigns a user a token whenever a new one is created. That webhook did not hit your local endpoint bc it's set up to hit mine. I'll have to think through what a proper workaround here is (my first thought is to start setting up clerk in /mocks), but in the meantime, you could look at the code in /api/user/post.ts to see how to manually give yourself a token.

        getMysql().then((cxn) =>
          cxn
            .select({
              count: sql`COUNT(uuid)`,
            })
            .from(tokens)
            .where(eq(tokens.userId, userId))
            .then(async ([a]) =>
              !a?.count
                ? await cxn.insert(tokens).values({
                    uuid: v4(),
                    value: await randomString({
                      length: 12,
                      encoding: "base64",
                    }),
                    createdDate: new Date(),
                    userId,
                  })
                : Promise.resolve()
            )
            .then(() => cxn.end())
        );

seed

So we're also going to need to seed your database with records in the apps table. I should create a script to make this easier. Try running:

INSERT INTO samepage_network.apps (id, code, name, workspace_label, live) VALUES (1, 'roam', 'Roam', 'graph', false)
mdroidian commented 1 year ago

@dvargas92495 take a look.

Although I see the check failed at StripeAuthenticationError: You did not provide an API key.

dvargas92495 commented 1 year ago

Did you not have permission to request review? If not, I'll take a look at the settings.

You'll need to add STRIPE_SECRET_KEY as a github secret in your fork of the repository.

Getting the tests to pass on the PR won't be required yet since they're still a bit unstable, but it's an ideal we should shoot for

mdroidian commented 1 year ago

Did you not have permission to request review? If not, I'll take a look at the settings.

No dice on the permissions.

mdroidian commented 1 year ago

Hmm. Added STRIPE_SECRET_KEY here, but test still failed.

image

Is that correct?

dvargas92495 commented 1 year ago

Hmm that should be correct. I'll have to do some googling around to see if I'm missing something on how this works