PROJECT OVERVIEW:
The application, titled 'Anılar Kütüphanesi' (Memory Library), aims to solve the problem of fragmented and decaying personal memories, particularly those associated with physical photographs. Users often have boxes of old photos or scattered digital images with no context or narrative. This app provides a platform for users to upload, organize, and enrich these visual memories with stories, notes, and contextual information, creating a personal, interactive digital encyclopedia of their lives and family history. The core value proposition is to preserve, connect, and share precious memories in a structured and engaging digital format, bridging generational gaps and preventing the loss of invaluable personal narratives.
TECH STACK:
- Frontend Framework: React.js (using Create React App or Vite for scaffolding)
- Styling: Tailwind CSS for rapid UI development and consistent design.
- State Management: Zustand or Redux Toolkit for efficient global state management.
- Routing: React Router DOM for navigation within the Single Page Application.
- UI Components: Potentially a library like Headless UI for accessible and customizable components.
- Icons: Heroicons or Font Awesome for iconography.
- Date Handling: date-fns or Moment.js for robust date manipulation.
- File Upload: Libraries like react-dropzone for an intuitive upload experience.
- Local Storage: For caching user preferences or offline data if needed.
CORE FEATURES:
1. **Photo Upload & Organization**:
* **User Flow**: User clicks an 'Upload Photos' button. A drag-and-drop area or file input appears. User selects one or multiple image files (JPEG, PNG, HEIC). The app displays upload progress. Once uploaded, users can create new albums or add photos to existing albums. Photos can be tagged with keywords.
* **Details**: Supports bulk uploads. Image preview is shown during upload. Basic image editing (crop, rotate) might be included in later iterations.
2. **Memory Enrichment**:
* **User Flow**: User selects a photo or an album. An 'Add Memory' or 'Edit Details' option is presented. A modal or dedicated section opens where the user can:
* Write a story/description.
* Record an audio note (if browser supports Web Audio API).
* Tag people (creating basic person profiles).
* Add a date (manual input or selecting from calendar, with an option to specify 'approximate').
* Add location (optional).
* **Details**: Rich text editing for descriptions. Audio recording requires user permission. People tagging links to a simple people management system.
3. **Personal Timeline View**:
* **User Flow**: User navigates to the 'Timeline' section. Photos and associated memories are displayed chronologically based on the date entered (or upload date if no date is available). Users can scroll through the timeline, with thumbnails of photos appearing at chronological points. Clicking a thumbnail shows the associated memory details.
* **Details**: Infinite scroll for performance. Filtering options by year, decade, or tags might be added.
4. **Sharing & Collaboration (MVP Focus on Secure Sharing)**:
* **User Flow**: User selects a specific photo, memory, or album. Clicks a 'Share' button. A modal allows the user to generate a private, shareable link or invite specific registered users (via email/username). Shared content is view-only for recipients.
* **Details**: Focus on secure, permission-based sharing. No real-time collaboration in MVP.
UI/UX DESIGN:
- **Layout**: A clean, single-page application layout. A persistent sidebar or top navigation for main sections (Dashboard, Albums, Timeline, People, Settings). Main content area displays the selected view.
- **Color Palette**: Soft, warm, and inviting colors. Primary: A muted blue or teal (#63708A). Secondary: A warm off-white or light beige (#F5F5DC). Accent: A gentle gold or amber (#DAA520) for interactive elements and highlights. Error: A soft red. Success: A muted green.
- **Typography**: Use a clean, readable sans-serif font for body text (e.g., Inter, Roboto) and perhaps a slightly more distinctive serif or sans-serif for headings (e.g., Playfair Display, Montserrat).
- **Responsive Design**: Mobile-first approach. Layouts adapt gracefully from small mobile screens to large desktop monitors. Sidebar might collapse into a hamburger menu on smaller screens. Ensure touch targets are appropriately sized.
- **Interactivity**: Subtle hover effects on buttons and interactive elements. Smooth transitions between pages/views.
COMPONENT BREAKDOWN:
- `App.js`: Main application component, sets up routing and global layout.
- `Header.js`: Top navigation bar or logo display.
- `Sidebar.js`: Navigation menu component.
- `PhotoUploader.js`: Handles file selection and drag-and-drop functionality. Props: `onUploadSuccess` callback.
- `AlbumList.js`: Displays a list of user's albums. Props: `albums` (array), `onAlbumClick`.
- `PhotoGrid.js`: Displays photos in a grid layout. Props: `photos` (array), `onPhotoClick`.
- `PhotoCard.js`: Individual photo display component within a grid. Props: `photo` (object), `onClick`.
- `MemoryEditor.js`: Modal or form for adding/editing memories (text, audio, tags, date). Props: `photo` (object), `onSubmit`, `initialData`.
- `Timeline.js`: Renders the chronological view of memories. Props: `memories` (array).
- `TimelineEvent.js`: Represents a single event/memory on the timeline. Props: `event` (object).
- `ShareModal.js`: Handles sharing options (link generation, invites). Props: `itemId`, `itemType`.
- `PeopleList.js`: Displays list of tagged people. Props: `people` (array).
- `TagInput.js`: Component for adding tags to photos or memories.
DATA MODEL:
- **User**: `{ id, name, email, ... }`
- **Photo**: `{ id, userId, albumId, url, thumbnailUrl, originalFilename, tags: [string], uploadDate, ... }`
- **Album**: `{ id, userId, name, description, coverPhotoId, createdAt, ... }`
- **Memory**: `{ id, userId, photoId, title, description, audioUrl, peopleIds: [userId], date, location, createdAt, ... }`
- **Person**: `{ id, userId, name, relationship, bio, profilePicUrl, ... }`
State Management Structure (Example using Zustand):
`useStore = create((set) => ({
user: null,
photos: [],
albums: [],
memories: [],
currentView: 'dashboard',
// Actions for fetching, adding, updating, deleting data
fetchPhotos: async () => { /* ... */ },
addAlbum: (albumData) => set((state) => ({ albums: [...state.albums, albumData] })),
// ... other actions
}))`
ANIMATIONS:
- **Hover Effects**: Subtle scale-up or shadow effect on `PhotoCard` and interactive elements in `Sidebar` and `Header`.
- **Transitions**: Smooth fade-in/out for modals (`MemoryEditor`, `ShareModal`). Page transitions using `Framer Motion` or similar library for slide/fade effects between views.
- **Loading States**: Skeleton loaders or spinners for `PhotoGrid`, `Timeline`, and `AlbumList` while data is being fetched. Subtle pulsing animation for upload progress indicators.
- **Micro-interactions**: Visual feedback when adding a tag, saving a memory, or generating a share link.
EDGE CASES:
- **Empty States**: Display friendly messages and clear calls-to-action when there are no photos, albums, or memories (e.g., "You haven't uploaded any photos yet. Click here to start!").
- **Error Handling**: Graceful handling of upload failures (network errors, invalid file types), API errors. Display user-friendly error messages. Implement retry mechanisms for uploads.
- **Validation**: Client-side validation for forms (e.g., memory title, date format). Server-side validation for security.
- **Accessibility (a11y)**: Use semantic HTML5 elements. Ensure sufficient color contrast. Implement keyboard navigation for all interactive elements. Add ARIA attributes where necessary (e.g., for modal states, custom form controls). Ensure image `alt` text is handled appropriately, potentially derived from memory descriptions.
- **Large Number of Photos**: Implement efficient loading strategies (pagination, infinite scroll) and consider optimized image loading (lazy loading).
SAMPLE DATA:
1. **Photo 1**: `{ id: 'p1', url: '/images/grandma_wedding.jpg', uploadDate: '2023-10-27T10:00:00Z', tags: ['wedding', 'family', 'grandma'] }`
2. **Memory for Photo 1**: `{ id: 'm1', photoId: 'p1', title: 'Grandma and Grandpa on their Wedding Day', description: 'This photo was taken on June 15, 1965. My grandma is wearing her beautiful lace dress, and my grandpa looks so dashing! They met a year earlier at a local dance.', audioUrl: '/audio/grandma_wedding_story.mp3', peopleIds: ['person2', 'person3'], date: '1965-06-15', location: 'Old Town Hall', createdAt: '2023-10-27T10:30:00Z' }`
3. **Photo 2**: `{ id: 'p2', url: '/images/childhood_park.jpg', uploadDate: '2023-10-27T11:00:00Z', tags: ['childhood', 'park', 'me'] }`
4. **Memory for Photo 2**: `{ id: 'm2', photoId: 'p2', title: 'My favorite park swing', description: 'Me enjoying the swings at Sunny Meadow Park. I remember spending hours here after school. My dad took this photo.', peopleIds: ['person1'], date: '1998-07-20', location: 'Sunny Meadow Park', createdAt: '2023-10-27T11:15:00Z' }`
5. **Album 1**: `{ id: 'a1', name: 'Family Weddings', description: 'Collection of wedding photos across generations.', coverPhotoId: 'p1', createdAt: '2023-10-26T09:00:00Z' }`
6. **Person 1**: `{ id: 'person1', name: 'Dad', relationship: 'Father', profilePicUrl: '/images/dad.jpg' }`
7. **Person 2**: `{ id: 'person2', name: 'Grandma', relationship: 'Maternal Grandmother', profilePicUrl: '/images/grandma_young.jpg' }`
8. **Person 3**: `{ id: 'person3', name: 'Grandpa', relationship: 'Maternal Grandfather', profilePicUrl: '/images/grandpa_young.jpg' }`
9. **Photo 3 (No Date)**: `{ id: 'p3', url: '/images/unidentified_group.jpg', uploadDate: '2023-10-27T12:00:00Z', tags: ['mystery', 'group'] }`
10. **Memory for Photo 3**: `{ id: 'm3', photoId: 'p3', title: 'A gathering I don't recognize', description: 'Found this in the old box. Looks like a party or reunion, but I don't know who these people are or when it was taken. Maybe Grandma will remember.', peopleIds: [], date: null, location: null, createdAt: '2023-10-27T12:05:00Z' }`
DEPLOYMENT NOTES:
- **Build Tool**: Vite recommended for faster build times and development server compared to CRA.
- **Environment Variables**: Use `.env` files for API keys, base URLs, etc. (`VITE_API_URL`, `VITE_AUTH_DOMAIN`). Ensure sensitive variables are not exposed client-side.
- **Performance Optimizations**: Code splitting (handled by Vite/React Router). Image optimization (using appropriate formats like WebP, responsive image sizes, lazy loading). Memoization (`React.memo`, `useMemo`, `useCallback`) for performance-critical components.
- **Hosting**: Deploy to platforms like Vercel, Netlify, or AWS S3/CloudFront for static site hosting.
- **Backend**: For audio storage and potential user authentication/database, integrate with services like Firebase, Supabase, or a custom Node.js/Express backend.