A Webflow Cloud application that enables users to share and preserve their precious memories through an intuitive form interface, with seamless integration to Webflow CMS.
- π Interactive Form: Beautiful modal form for capturing memories
- π¨ Webflow Design System: Uses native Webflow components and styles
- πΎ CMS Integration: Automatic storage in Webflow CMS
- π·οΈ Smart Tagging: Organize memories with up to 3 custom tags
- πΈ Media Support: Upload photos and link to videos
- π Location Tracking: Capture where memories took place
- π Date Handling: Automatic date formatting and validation
- π Create & Update: Support for both new entries and updates
- β¨ Auto-Slugification: Automatic URL-safe slug generation
- β Validation: Client and server-side validation
- π Dark Mode: Full dark mode support via Webflow variables
- π± Responsive: Works perfectly on all device sizes
- Node.js 18+
- Webflow account with CMS access
- Webflow API token
-
Clone the repository
git clone <repository-url> cd memory-form
-
Install dependencies
npm install
-
Configure environment
Create a
.envfile:WEBFLOW_CMS_SITE_API_TOKEN=your_token_here
-
Set Collection ID
Edit
src/pages/index.astro:const COLLECTION_ID = 'your_collection_id_here';
-
Start development server
npm run dev
-
Open in browser
http://localhost:4321
- Setup Guide - Complete setup instructions
- API Examples - Request/response examples
- Master Guide - Comprehensive technical documentation
βββββββββββββββββββββββββββββββββββββββ
β User Interface β
β (Webflow Devlink Components) β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββ
β MemoryFormWrapper.tsx β
β β’ Modal state management β
β β’ Form submission logic β
β β’ Success/error handling β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββ
β API Route (/api/memory) β
β β’ Form validation β
β β’ Data transformation β
β β’ Slug generation β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββ
β Webflow CMS API Client β
β β’ Create/update operations β
β β’ Error handling β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββ
β Webflow CMS β
β β’ Data persistence β
β β’ Content management β
βββββββββββββββββββββββββββββββββββββββ
memory-form/
βββ docs/
β βββ setup-guide.md # Setup instructions
β βββ api-examples.md # API documentation
βββ src/
β βββ components/
β β βββ ui/ # shadcn UI components
β β βββ MemoryFormWrapper.tsx # Main wrapper component
β βββ lib/
β β βββ base-url.ts # Base URL configuration
β β βββ memory-form-types.ts # TypeScript types
β β βββ memory-form-utils.ts # Utility functions
β β βββ memory-cms-api.ts # CMS API client
β βββ pages/
β β βββ api/
β β β βββ memory.ts # API endpoint
β β βββ index.astro # Home page
β βββ site-components/ # Webflow Devlink components
β β βββ DevLinkProvider.jsx
β β βββ MemoryFormButton.jsx
β β βββ MemoryForm.jsx
β β βββ global.css
β βββ styles/
β βββ global.css # Global styles
βββ .env # Environment variables (create this)
βββ MASTER_GUIDE.md # Technical documentation
βββ package.json
# Required: Your Webflow site API token
WEBFLOW_CMS_SITE_API_TOKEN=your_token_here
# Optional: Custom API host (for development)
WEBFLOW_API_HOST=https://api.webflow.comSet in src/pages/index.astro:
const COLLECTION_ID = '507f1f77bcf86cd799439011'; // Your collection ID
const LOCALE_ID = undefined; // Optional locale IDYour Webflow CMS collection must have these fields:
System Fields (built-in):
name(Plain Text)slug(Plain Text)
Custom Fields (must be created):
first-name(Plain Text)last-name(Plain Text)email(Email)memory(Long Text)memory-date(Date/Time)location(Plain Text)tag-1,tag-2,tag-3(Plain Text)photo(Image)video(Video)video-link(Plain Text)content-link(Plain Text)
<MemoryFormWrapper
collectionId={COLLECTION_ID}
buttonText="Share Your Story"
buttonVariant="Slate Navy"
/>Warm SandstonWarm Sandston OutlineSlate NavySlate Navy OutlineOcean Teal(default)Ocean Teal OutlineRustwood RedRustwood Outline
<MemoryFormWrapper
collectionId={COLLECTION_ID}
onSuccess={(item) => {
console.log('Memory created:', item.id);
// Your custom logic
}}
onError={(error) => {
console.error('Error:', error.message);
// Your custom error handling
}}
/>Creates or updates a memory item.
Request (FormData):
collection-id: string (required)
name: string (required)
email: string (required)
memory: string (required)
memory-date: string (required)
item-id: string (optional, for updates)
[...other fields]
Success Response (200):
{
"success": true,
"message": "Memory created successfully",
"data": {
"id": "...",
"fieldData": { ... },
"createdOn": "...",
"lastUpdated": "..."
}
}Error Response (400/500):
{
"success": false,
"errors": ["Error message 1", "Error message 2"]
}See API Examples for detailed documentation.
- Start dev server:
npm run dev - Open
http://localhost:4321 - Click "Share a Memory"
- Fill out form and submit
- Check Webflow CMS for new item
- Modal opens/closes correctly
- Form validation works
- Success message displays
- Error handling works
- Item appears in CMS
- Slug auto-generation works
- Date formatting correct
- URL validation works
npm run build- Set environment variables in Webflow Cloud dashboard
- Deploy through Webflow Cloud interface
- Verify production environment
Set in Webflow Cloud:
WEBFLOW_CMS_SITE_API_TOKEN
- Check
.envfile exists - Verify variable name is correct
- Restart dev server
- Verify API token has CMS write permissions
- Check collection ID is correct
- Ensure all required fields exist in CMS
- Verify field slugs match exactly
- Check browser console for errors
- Verify API endpoint is accessible
- Check network tab for failed requests
See Setup Guide for more troubleshooting.
| Field | Type | Required | Description |
|---|---|---|---|
| Name | String | Yes | Display name (auto-generated if not provided) |
| Yes | Validated email format | ||
| Memory | Text | Yes | The memory story/description |
| Memory Date | Date | Yes | When it happened |
| First Name | String | No | Person's first name |
| Last Name | String | No | Person's last name |
| Location | String | No | Where it happened |
| Tag 1-3 | String | No | Categorization tags |
| Photo | Image | No | Photo upload |
| Video | Video | No | Video upload |
| Video Link | URL | No | External video link |
| Content Link | URL | No | External content link |
- β API tokens stored in environment variables only
- β Server-side validation and sanitization
- β CMS API only accessed from server routes
- β No sensitive data exposed to client
- β CORS protection via Astro middleware
- β Input validation (XSS prevention)
- Update Webflow CMS collection
- Update
src/lib/memory-form-types.ts - Update field mappings in
src/lib/memory-cms-api.ts - Update validation in
src/lib/memory-form-utils.ts - Test thoroughly
- Re-sync from Webflow Designer
- Components auto-regenerate
- Check for breaking changes
- Update wrapper component if needed
This project is part of the Webflow Cloud ecosystem.
This is a Webflow Cloud application. Follow the Webflow Cloud development guidelines.
- Documentation: See MASTER_GUIDE.md
- API Reference: See API Examples
- Setup Help: See Setup Guide
- Webflow: https://developers.webflow.com
Automatically generates URL-safe slugs from memory names:
- Converts to lowercase
- Replaces spaces with hyphens
- Removes special characters
- Client-side validation for instant feedback
- Server-side validation for security
- Email format checking
- Date format validation
- URL format validation
- Leave
item-idempty to create new memories - Provide
item-idto update existing memories - Automatic detection of create vs update mode
- User-friendly error messages
- Detailed console logging for debugging
- Graceful failure handling
- Network error recovery
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
- Server-side rendering with Astro
- Minimal client JavaScript
- Optimized for Cloudflare Workers
- Fast CMS API integration
Built with β€οΈ for Webflow Cloud
Last Updated: 2024