This is a Next.js starter for a waitlist web app built with Neon DB, Resend and styling with TailwindCSS and Shadcn.
Demo
See it in action at capsulethis.com (and make sure to subscribe for the waitlist 😉)
Tech Stack
Setup
-
Clone the repository
-
Create a new Neon database and update the
.envfile with the database URL -
On Neon DB sidebar choose
SQL Editorcreate a new table calledwaitlistas follows:CREATE TABLE waitlist ( id SERIAL PRIMARY KEY, email TEXT NOT NULL, confirmed BOOLEAN DEFAULT FALSE, created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP ); ALTER TABLE waitlist ADD CONSTRAINT unique_email UNIQUE (email); CREATE INDEX idx_waitlist_email ON waitlist (email);
-
Create a new Resend account and update the
.envfile with the API key -
Run
npm installto install the dependencies -
Run
npm run devto start the development server -
customize the landing page by editing
components/landing-page.tsx- change the title, description, and background image
- add your own favicon
-
Install Vercel CLI
npm i -g verceland runvercel loginto login to your Vercel account -
Run
npm run deployto deploy the app to Vercel -
Buy a domain on Vercel and add it to your project
-
Customize Resend settings with your Vercel Domain
OG Metadata
The OG metadata is defined in app/layout.tsx for SEO purposes and social media sharing. Replace the default values with your own.
API Routes
The app includes two main API routes:
-
/api/join-waitlist(POST)- Adds an email to the waitlist and sends a confirmation email.
- Request body:
{ "email": "user@example.com" } - Responses:
- 200: Email sent successfully
- 400: Email already exists
- 500: Error sending email
-
/api/confirm-email(GET)- Confirms a user's email address in the waitlist.
- Query parameter:
email - Responses:
- 200: Email has been confirmed successfully
- 400: Email is required
- 404: Email not found in waitlist
- 500: An error occurred while confirming the email
About Author
Rodrigo Figueroa
Follow Rodrigo Figueroa for updates on the project and universal app development on x/twitter
License
MIT
