Public Wishlist
Public wishlist functionality allows BookWish users to share their book wishlists with others via shareable URLs. This enables social book sharing, gift giving, and community engagement.
Purpose
The public wishlist feature serves multiple use cases:
- Gift Registry: Share wishlists with friends/family for birthdays, holidays
- Social Sharing: Showcase book preferences on social media
- Book Recommendations: Share curated book lists with reading communities
- Store Integration: Allow users to discover books from store websites and add to wishlist
- Cross-Platform: Access wishlists from both Flutter app and web
Implementation Approach
Option 1: Subdomain (Current Approach)
Public wishlists could be hosted at wishlist.bookwish.io or integrated into the main app domain with public routes.
Option 2: Store Website Integration
The add-to-wishlist functionality is currently implemented in the stores website (bookwish.shop):
- Users can add books from store websites to their BookWish wishlist
- Authenticated users see wishlist picker
- Unauthenticated users get redirected to login
Current Implementation
Add to Wishlist Flow
From store websites, users can add books to their wishlist:
// components/add-to-wishlist-button.tsx
export function AddToWishlistButton({ bookId, bookTitle }: Props) {
const { isAuthenticated } = useAuth();
if (!isAuthenticated) {
return (
<a href={`${BOOKWISH_APP_URL}/login?redirect=${currentURL}`}>
Sign in to add to BookWish
</a>
);
}
return (
<button onClick={() => setShowWishlistPicker(true)}>
Add to BookWish
</button>
);
}
Wishlist Picker
Client-side component that lets users:
- Select which wishlist to add book to
- View all their wishlists
- Create new wishlist
- See confirmation on success
Auth Integration
The stores website checks for BookWish authentication:
- Token stored in localStorage or cookies
- Fetches user wishlists from backend API
- Validates token with
/users/meendpoint
Data Model
Wishlist
interface Wishlist {
id: string;
name: string;
isPrivate: boolean;
itemCount: number;
userId: string;
createdAt: Date;
updatedAt: Date;
}
Wishlist Item
interface WishlistItem {
id: string;
wishlistId: string;
bookId: string;
book: Book;
addedAt: Date;
notes?: string;
priority?: 'low' | 'medium' | 'high';
}
Privacy Controls
Private vs Public Wishlists
- Private: Only visible to the owner
- Public: Shareable via URL, discoverable by others
Users can toggle privacy per wishlist from the app.
Sharing Mechanism
URL Structure
Public wishlists would be accessible via:
bookwish.io/wishlist/{wishlistId}(integrated in main app)wishlist.bookwish.io/{username}/{wishlistSlug}(dedicated subdomain)bookwish.io/{username}/wishlist/{wishlistSlug}(user profile route)
Metadata & SEO
Public wishlists should include:
- Open Graph tags for social media previews
- Dynamic metadata with wishlist name and book count
- Structured data for search engines
Display Features
Public Wishlist Page
A public wishlist page should display:
- Wishlist name and description
- Owner's name/username (if not anonymous)
- Book grid with covers
- Book titles, authors, prices
- "Add to My Wishlist" button for logged-in users
- "Buy" links to stores that have the book in stock
- Share buttons for social media
Book Cards
Each book in public wishlist shows:
- Cover image
- Title and authors
- Owner's notes (if shared)
- Priority indicator (if enabled)
- Availability at nearby stores
- Price range from available stores
Integration Points
Flutter App
The main BookWish Flutter app manages:
- Creating/editing wishlists
- Setting privacy preferences
- Adding/removing books
- Generating shareable links
- Managing wishlist settings
Store Websites
Store websites (bookwish.shop) enable:
- Adding books from store inventory to user wishlists
- Cross-domain authentication
- Wishlist picker integration
Backend API
Backend provides:
/wishlists- List user wishlists/wishlists/{id}- Get wishlist details/wishlists/{id}/items- Manage wishlist items/wishlists/{id}/share- Generate share links/wishlists/public/{id}- Public wishlist view
Future Enhancements
Social Features
- Follow other users' wishlists
- Like/comment on wishlist items
- Collaborative wishlists
- Gift marking (purchased by someone else)
Smart Features
- Price tracking alerts
- Availability notifications
- Related book suggestions
- Reading list generation from wishlist
Analytics
- Track wishlist views
- Popular books on wishlists
- Store demand insights from wishlist data
Gift Registry
- Mark items as purchased
- Hide purchased items
- Thank you notes
- Ship-to address integration
Technical Considerations
Performance
- Cache public wishlists with revalidation
- Lazy load book covers
- Paginate for large wishlists (100+ books)
- Edge caching for popular wishlists
Security
- Validate privacy settings before showing
- Rate limit public wishlist access
- Prevent scraping/abuse
- CORS configuration for embeds
Accessibility
- Keyboard navigation
- Screen reader support
- Alt text for book covers
- ARIA labels for interactive elements
Current Status
As of the current implementation:
- Wishlist management exists in Flutter app
- Add-to-wishlist available on store websites
- Backend API supports wishlist CRUD operations
- Public sharing routes are not yet implemented
- Dedicated public wishlist pages are planned for future development
The infrastructure is in place for wishlists, but the public sharing/viewing experience needs to be built as a Next.js route or standalone website.