Closed rgarcia closed 5 months ago
@ellipsis-dev implement this
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.
Issue: resolves https://github.com/onmetal-dev/metal/issues/45
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.
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:
inviteCode
: a varchar
field that stores the invite code. Use a secure random number generator to generate the invite codes. This field should have a unique constraint to prevent duplicates.used
: a boolean
field that indicates whether the invite code has been used.createdAt
: a timestamp
field that stores when the invite code was created. This field should have a default value of the current timestamp.expiresAt
: a timestamp
field that stores when the invite code expires.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.
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