I've created comprehensive mock data for hoangclw@gmail.com with 2 complete projects featuring detailed slides and audio content. This guide will walk you through the implementation and usage.
User Profile: Hoang Le (hoangclw@gmail.com)
{
id: 'user-hoang-001',
name: 'Hoang Le',
email: 'hoangclw@gmail.com',
idNumber: 'HLC20241201'
}- Status: COMPLETED
- Slides: 12 comprehensive slides
- Audio: 7-minute professional narration
- Content: Complete healthcare digitization presentation
- Topics Covered: AI diagnostics, telemedicine, IoT, EHR, robotics, cybersecurity
- Status: COMPLETED
- Slides: 15 detailed slides
- Audio: 6-minute narration
- Content: Clean energy and smart city solutions
- Topics Covered: Smart grids, solar/wind integration, energy storage, EVs, hydrogen economy
- Status: IN_PROGRESS
- Slides: 8 slides (expandable)
- Audio: 4-minute introduction (processing)
File: src/mocks/hoangMockData.ts
- User profile for hoangclw@gmail.com
- 3 complete projects with detailed metadata
- 12 + 15 + 8 slides with rich HTML content
- 3 audio projects with realistic durations and voice types
File: src/services/project.service.ts
- MockProjectService singleton class
- Complete CRUD operations for projects
- AI simulation for slide generation
- Audio narration generation
- Export functionality (PDF, PPTX, HTML)
- Statistics and analytics
File: src/hooks/useProjects.ts
- useProjects() hook for project management
- useProject() hook for individual project details
- Integrated with authentication system
- Error handling and loading states
File: src/pages/UserProfile/UserProfile.tsx
- Displays comprehensive project statistics
- Interactive project cards with actions
- Audio project management
- Export and delete functionality
# 1. Files are already created, start the dev server
npm run dev
# 2. Navigate to http://localhost:5174
# 3. The AuthDebug should show "Provider: KEYCLOAK"-
Access User Profile:
- Click "My Projects" button (if authenticated)
- Or navigate to
/profile
-
Expected Results:
- User header showing Hoang Le's information
- Statistics cards showing:
- Total Projects: 3
- Completed: 2
- Total Slides: 35+
- Audio Minutes: 17+
-
Project Cards Display:
- Digital Transformation in Healthcare (COMPLETED)
- Sustainable Energy Solutions (COMPLETED)
- Cybersecurity Best Practices (IN_PROGRESS)
Create a new component to view individual project slides:
# Create project detail page
mkdir -p src/pages/ProjectDetailFile: src/pages/ProjectDetail/ProjectDetail.tsx
import React from 'react'
import { useParams } from 'react-router-dom'
import { Card, Typography, Spin } from 'antd'
import { useProject } from '../../hooks/useProjects'
const { Title } = Typography
const ProjectDetail: React.FC = () => {
const { id } = useParams<{ id: string }>()
const { projectDetail, loading, error } = useProject(id)
if (loading) return <Spin size="large" />
if (error) return <div>Error: {error}</div>
if (!projectDetail) return <div>Project not found</div>
return (
<div style={{ padding: '24px', maxWidth: '1200px', margin: '0 auto' }}>
<Title level={1}>{projectDetail.title}</Title>
{projectDetail.slides.map((slide) => (
<Card key={slide.id} style={{ marginBottom: '16px' }}>
<Title level={3}>{slide.title}</Title>
<div dangerouslySetInnerHTML={{ __html: slide.content }} />
</Card>
))}
</div>
)
}
export default ProjectDetailUpdate src/App.tsx:
// Add this route
<Route
path='/project/:id'
element={
<Layout>
<ProtectedRoute>
<ProjectDetail />
</ProtectedRoute>
</Layout>
}
/>- Navigate to User Profile (
/profile) - Click "View" on any project
- Should display detailed slides:
- Healthcare project: 12 slides with comprehensive content
- Energy project: 15 slides with smart city solutions
- Cybersecurity project: 8 slides with best practices
Each slide contains:
- HTML-formatted content with headings, lists, and styling
- Visual elements using CSS classes for layouts
- Statistics and data points with realistic numbers
- Professional presentation structure with intro, body, conclusion
<div class="slide-content">
<h2>AI-Powered Diagnostics</h2>
<div class="ai-features">
<div class="feature">
<h3>π¬ Medical Imaging</h3>
<ul>
<li>X-ray analysis with 95% accuracy</li>
<li>MRI scan interpretation</li>
<li>Early cancer detection</li>
</ul>
</div>
<div class="statistics">
<h3>Impact Statistics:</h3>
<p><strong>40%</strong> reduction in diagnostic errors</p>
<p><strong>60%</strong> faster diagnosis time</p>
<p><strong>$50B</strong> potential annual savings</p>
</div>
</div>
</div>- Professional voice types: "Professional Male - David", "Professional Female - Sarah"
- Realistic durations: 4-7 minutes per project
- Processing states: DRAFT β PROCESSING β COMPLETED
- Content matching: Audio text matches slide content
- Audio projects linked to main projects
- Separate audio management section
- Play/pause controls (UI only - no actual audio files)
- Voice type selection and duration tracking
The mock service provides:
- Project counting by status
- Slide totals across all projects
- Audio duration summation
- Completion rates and progress tracking
Create an editor for individual slides:
// Rich text editor for slide content
// Theme and layout application
// Preview functionality// Text-to-speech simulation
// Voice selection interface
// Audio playback controls// PDF generation from slides
// PowerPoint export simulation
// HTML presentation export// Sharing and permissions
// Comments and feedback
// Version history- Navigate to
/profile - Click "View" on "Digital Transformation in Healthcare"
- Should see 12 slides with medical content
- Verify slide progression and content quality
- Go to profile page
- Scroll to "Audio Projects" section
- See 3 audio projects with different statuses
- Verify duration and voice type display
- Check statistics cards on profile
- Verify numbers match mock data:
- Total Projects: 3
- Completed: 2
- Total Slides: 35 (12+15+8)
- Audio Minutes: 17 (7+6+4)
- Click "Export" on any completed project
- Should show success message
- Mock download URL should be generated
// In hoangMockData.ts, add new projects:
{
id: 'proj-hoang-4',
title: 'Your New Project Title',
status: 'DRAFT',
creationTime: Date.now(),
slideNum: 10
}// Add slides with your content:
{
id: 'slide-new-1',
title: 'Your Slide Title',
content: `<h1>Your HTML Content</h1>`,
order: 1
}// Create additional user profiles:
export const anotherUser: UserData = {
id: 'user-002',
name: 'Another User',
email: 'user@example.com',
idNumber: 'USR002'
}- Test the basic integration - Ensure mock data loads correctly
- Implement ProjectDetail page - For viewing individual project slides
- Add slide styling - CSS for better slide presentation
- Create audio player UI - Interface for audio project management
- Implement search/filter - Find projects by title or content
- Add project creation flow - Form to create new projects
- Export functionality - Real PDF/PPTX generation
This comprehensive mock data system provides a solid foundation for testing and developing the full presentation application!
- Projects not loading: Check if useAuth hook returns valid user
- Hook dependency warnings: Add missing dependencies or use useCallback
- Type errors: Ensure all imports match the defined types
- Routing issues: Verify all routes are properly configured
- Use AuthDebug component to verify authentication state
- Check browser console for service errors
- Verify mock data structure matches TypeScript types
- Test with different user emails to ensure service flexibility