A simple waitlist application built with Next.js and RushDB that allows users to join a waitlist by submitting their email address.
- Clean, responsive waitlist form
- Email validation
- RushDB integration for data storage
- Success/error feedback
- Dark mode support
-
Install dependencies:
npm install
-
Configure RushDB:
- Copy
.env.local.exampleto.env.local - Add your RushDB API key:
RUSHDB_API_KEY=your_rushdb_api_key_here
- Copy
-
Run the development server:
npm run dev
-
Open your browser: Visit http://localhost:3000 to see the waitlist form.
The application includes a REST API endpoint at /api/waitlist that:
- Accepts POST requests with email in the request body
- Validates email format
- Stores emails in RushDB with the label "Waitlist"
- Returns success/error responses
fetch("/api/waitlist", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email: "user@example.com" }),
})
.then((response) => response.json())
.then((data) => console.log(data));src/
├── app/
│ ├── api/
│ │ └── waitlist/
│ │ └── route.ts # API endpoint for waitlist
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main waitlist page
└── ...
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.