onmetal-dev / metal

bare metal PaaS
https://www.onmetal.dev
GNU Affero General Public License v3.0
4 stars 0 forks source link

Waitlist / gate sign ups #45

Closed rgarcia closed 5 months ago

rgarcia commented 5 months ago

Landing page should have a waitlist https://loops.so/build-a-waitlist

Sign up should be gated in some way. One way could be to create an invites table and only render the signup page if a valid invite code is present as a query param

linear[bot] commented 5 months ago

MET-32 Waitlist / gate sign ups

rgarcia commented 5 months ago

@ellipsis-dev implement this

ellipsis-dev[bot] commented 5 months ago

Sorry, I wasn't able to make any changes. Here's what I tried to do:

:warning: Sorry, I timed out before I could complete this PR, so I've submitted my work in progress.

Summary:

Issue: resolves https://github.com/onmetal-dev/metal/issues/45

Implementation:

Step 1: Add waitlist functionality to the landing page

The landing page's exact location in the codebase is not definitively known, but it's likely in the apps/next/pages directory. Add a waitlist sign-up form to the landing page. This form should collect the user's email address and submit it to a backend endpoint that will be created in a later step. Use the Form and Input components from the @chakra-ui/react library for the form and input field. Add validation to the form to ensure the email address is valid before submission. Use the yup library for validation.

Step 2: Create an invites table in the database

Create an invites table in the database using the metalSchema.table method from drizzle-orm, as shown in the apps/next/app/server/db/schema.ts file. The table should have the following fields:

Step 3: Modify the sign up process to check for a valid invite code

Modify the Register function in the apps/next/app/register/[[...register]]/page.tsx file to check for an invite code query parameter. Use the useRouter hook from next/router to retrieve the query parameters. Query the invites table in the database to validate the invite code. If the invite code is valid and not expired or used, the sign up process can proceed. Otherwise, display an error message. Use the Alert component from the @chakra-ui/react library for the error message.

Report: Step Result Details
1
Add waitlist functionality to the landing pageNo result
2
Create an invites table in the databaseNo result
3
Modify the sign up process to check for a valid invite codeNo result

Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #45. Then, try again. For more information, check the documentation.