A comprehensive SaaS web application built with Next.js 14 (App Router) that generates professional presentations and daily planners using AI. Features complete authentication, real-time collaboration, and advanced export capabilities.
- AI-Powered Generation: Create presentations and daily planners using OpenAI GPT-4o
- Real-time Preview: Live slide rendering with smooth animations and transitions
- Interactive AI Chat: Conversational refinement and customization of content
- Multi-format Export: PowerPoint (.pptx) and PDF export capabilities
- Responsive Design: Optimized for desktop and mobile devices
- Firebase Authentication: Email/password and Google OAuth integration
- Secure API Key Management: Client-side storage with validation
- User Data Protection: Firestore security rules and data isolation
- Session Management: Persistent authentication with automatic refresh
- Day Planner Mode: AI-generated daily schedules with time management
- Project Management: Complete CRUD operations for presentations
- Search & Filter: Advanced project discovery and organization
- Analytics Dashboard: User statistics and project insights
- Theme Customization: Dynamic color schemes and styling
- Next.js 14 with App Router
- React 18 with TypeScript
- TailwindCSS for styling
- Framer Motion for animations
- Lucide React for icons
- Firebase Authentication for user management
- Cloud Firestore for data storage
- OpenAI API (GPT-4o) for content generation
- PptxGenJS for PowerPoint export
- Jest for unit testing
- React Testing Library for component testing
- ESLint for code quality
- TypeScript for type safety
Before you begin, ensure you have:
- Node.js 18+ and npm installed
- OpenAI API key from OpenAI Platform
- Firebase project (configuration provided)
- Git for version control
# Clone the repository
git clone https://github.com/Ahmadjamil888/SlideGen_AI.git
cd slide-generator-saas
# Install dependencies
npm installThe Firebase configuration is pre-configured in the application. No additional environment variables are required for basic functionality.
# Start the development server
npm run dev
# Open your browser
# Navigate to http://localhost:3000-
OpenAI API Key Setup
- Visit OpenAI Platform
- Create a new API key
- The app will prompt you to enter the key on first use
- Keys are stored securely in browser localStorage only
-
Account Creation
- Sign up using email/password or Google OAuth
- Complete profile setup
- Start creating presentations immediately
-
Prompt Input
Example: "Create a presentation about digital marketing strategies for small businesses, including social media, SEO, and content marketing" -
AI Generation Process
- GPT-4o analyzes your prompt
- Generates 5-15 professional slides
- Includes titles, bullet points, speaker notes
- Applies appropriate themes and animations
-
Customization Options
- Use AI chat for real-time modifications
- Change themes, colors, and layouts
- Add, remove, or reorder slides
- Update content and speaker notes
-
Task Input
- Add tasks with time, duration, and priority
- Set dates and deadlines
- Include breaks and personal time
-
AI Optimization
- Generates optimized daily schedule
- Includes productivity tips
- Suggests time management strategies
- Creates motivational content
- PowerPoint (.pptx): Full-featured presentations with animations
- PDF: Static format for sharing and printing
- Browser Presentation: Full-screen mode with keyboard navigation
slide-generator-saas/
βββ src/
β βββ app/ # Next.js App Router
β β βββ auth/ # Authentication pages
β β βββ dashboard/ # User dashboard
β β βββ generate/ # Content generation
β β βββ presentation/[id]/ # Slide viewer/editor
β β βββ planner/ # Day planner interface
β βββ components/ # React components
β β βββ ui/ # Reusable UI components
β β βββ SlideViewer.tsx # Main presentation viewer
β β βββ AIChat.tsx # AI chat interface
β β βββ ApiKeyManager.tsx # API key management
β βββ contexts/ # React contexts
β β βββ AuthContext.tsx # Authentication state
β βββ hooks/ # Custom React hooks
β β βββ useLocalStorage.ts # Local storage utilities
β βββ lib/ # Core utilities
β β βββ firebase.ts # Firebase configuration
β β βββ firestore.ts # Database operations
β β βββ openai.ts # AI integration
β β βββ pptx-export.ts # Export functionality
β βββ __tests__/ # Test files
βββ public/ # Static assets
βββ .env.local # Environment variables
βββ jest.config.js # Testing configuration
βββ README.md # This file
interface UserProfile {
id: string;
displayName: string;
email: string;
photoURL?: string;
createdAt: Timestamp;
lastLoginAt: Timestamp;
projectCount: number;
preferences?: {
defaultTheme?: string;
autoSave?: boolean;
};
}interface Project {
id: string;
userId: string;
title: string;
description?: string;
prompt: string;
slideData: SlideData;
slideCount: number;
type: 'presentation' | 'planner';
createdAt: Timestamp;
updatedAt: Timestamp;
thumbnail?: string;
}interface SlideData {
title: string;
description?: string;
theme: {
primaryColor: string;
secondaryColor: string;
backgroundColor: string;
textColor: string;
accentColor: string;
fontFamily: string;
};
slides: Slide[];
}# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Testing
npm run test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
# Code Quality
npm run lint # Run ESLint
npm run type-check # Run TypeScript checks- Authentication context and hooks
- Component rendering and interactions
- Utility functions and helpers
- API integration functions
- User authentication flows
- Slide generation and editing
- Project management operations
- Export functionality
describe('SlideViewer', () => {
it('renders slide content correctly', () => {
render(
<SlideViewer
slideData={mockSlideData}
onToggleChat={mockOnToggleChat}
isChatOpen={false}
/>
);
expect(screen.getByText('Welcome')).toBeInTheDocument();
});
});- Client-side Storage: Keys stored in localStorage only
- Validation: Real-time API key validation
- No Server Storage: Keys never transmitted to backend
- User Control: Easy key management and removal
// Firestore Security Rules
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /projects/{projectId} {
allow read, write: if request.auth != null &&
request.auth.uid == resource.data.userId;
}
}
}- User Isolation: Strict user-based access control
- Input Sanitization: All user inputs validated and sanitized
- Error Handling: Secure error messages without data leakage
- Session Security: Automatic token refresh and validation
-
Prepare for Deployment
npm run build npm run test -
Deploy to Vercel
# Install Vercel CLI npm i -g vercel # Deploy vercel --prod
-
Environment Variables
- No server-side environment variables required
- All configuration is client-side
npm run build
# Deploy dist folder to Netlify# Connect GitHub repository
# Configure build settings:
# Build command: npm run build
# Publish directory: .next# Connect GitHub repository
# Railway will auto-detect Next.js configuration- Code Splitting: Automatic route-based splitting
- Image Optimization: Next.js Image component
- Lazy Loading: Dynamic imports for heavy components
- Bundle Analysis: Webpack bundle analyzer integration
- Firestore Indexing: Optimized queries with proper indexes
- Caching Strategy: Browser and CDN caching
- API Rate Limiting: OpenAI API usage optimization
- Error Boundaries: Graceful error handling
// Performance monitoring
const performanceObserver = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
console.log(`${entry.name}: ${entry.duration}ms`);
});
});# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage- Components: >90% coverage
- Utilities: >95% coverage
- Integration: >80% coverage
- E2E: Critical user flows
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
npm test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- TypeScript: Strict type checking enabled
- ESLint: Airbnb configuration with custom rules
- Prettier: Automatic code formatting
- Conventional Commits: Standardized commit messages
- β Core presentation generation
- β Authentication and user management
- β Basic export functionality
- β Day planner mode
- π Real-time collaboration
- π Advanced template library
- π Voice narration
- π Mobile app (React Native)
- π Team workspaces
- π Analytics dashboard
- π API for third-party integrations
- π White-label solutions
- Documentation: Check this README and inline code comments
- Issues: Create GitHub issues for bugs and feature requests
- Discussions: Use GitHub Discussions for questions
- Email: Contact the development team
# Check API key format
# Should start with 'sk-proj-' or 'sk-'
# Verify key has sufficient credits# Clear Next.js cache
rm -rf .next
npm run build# Check network connectivity
# Verify Firebase configuration
# Check browser console for errorsThis project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the GPT-4o API
- Firebase for authentication and database services
- Vercel for hosting and deployment platform
- Next.js team for the excellent framework
- TailwindCSS for the utility-first CSS framework
Built with β€οΈ by the SlideGen AI team
Last updated: December 2024