A minimal waitlist landing page built with Vite, React, TypeScript, and Appwrite. Visitors submit a name and email, entries are stored in an Appwrite TablesDB table, and duplicate emails are rejected by a unique index.
Companion repo for the tutorial on the Appwrite blog.
- Collects a name and email from a public landing page.
- Writes each submission to an Appwrite table (
waitlist.entries). - Uses a unique index on
emailto reject duplicates without a second row being created. - Handles three outcomes in the UI:
success,duplicate,unknown. - Keeps all Appwrite calls in a single helper (
src/lib/appwrite.ts); the component calls the helper, not the SDK.
- Vite + React + TypeScript
appwriteclient SDK- Tailwind CSS v4
In the Appwrite Console, create:
-
A project. Copy the Project ID and API endpoint from the overview page.
-
A web platform pointing at the origin you will run the app from (for local dev,
localhost). -
A database with ID
waitlist. -
A table inside it with ID
entriesand these columns:Column Type Required Notes namevarchar Yes Size 255 emailemail Yes Validated by Appwrite on write -
A unique index on
email(key:unique_email, type:unique, attribute:email). -
Table permissions: add role Any with Create only. Leave Read / Update / Delete unchecked. Keep row security off.
pnpm install
cp .env.example .env
# edit .env with your project values
pnpm devSee .env.example. All four variables are required at startup.
| Variable | Example |
|---|---|
VITE_APPWRITE_ENDPOINT |
https://<REGION>.cloud.appwrite.io/v1 |
VITE_APPWRITE_PROJECT_ID |
your project ID |
VITE_APPWRITE_DATABASE_ID |
waitlist |
VITE_APPWRITE_TABLE_ID |
entries |
Because Vite only exposes variables prefixed with VITE_ to the browser, these are safe to ship to the client. None of them are secrets.
src/
App.tsx UI + form wiring (no SDK imports)
lib/
appwrite.ts Client, TablesDB, and the createWaitlistEntry helper
main.tsx
index.css Tailwind entry
| Command | What it does |
|---|---|
pnpm dev |
Start the Vite dev server |
pnpm build |
Type-check and build for production |
pnpm preview |
Serve the production build locally |
pnpm lint |
Run ESLint |
MIT.