This is a full-stack web application for AI-powered multimedia content generation. The application allows users to generate images, create animations, produce audio, and generate captions using various AI services. It's built with a modern React frontend and Express.js backend, using PostgreSQL for data persistence and Drizzle ORM for database management.
Preferred communication style: Simple, everyday language.
- Framework: React 18 with TypeScript
- Styling: Tailwind CSS with shadcn/ui component library
- State Management: TanStack Query (React Query) for server state
- Routing: Wouter for client-side routing
- Build Tool: Vite for development and bundling
- UI Components: Radix UI primitives with custom styling
- Runtime: Node.js with Express.js
- Language: TypeScript with ES modules
- API Style: RESTful API with JSON responses
- File Handling: Multer for multipart/form-data uploads
- Development: tsx for TypeScript execution in development
- Database: PostgreSQL (configured for Neon serverless) - ACTIVE
- ORM: Drizzle ORM with Drizzle Kit for migrations
- Schema: Type-safe schema definitions with Zod validation
- Storage Strategy: DatabaseStorage implementation using PostgreSQL (switched from memory storage)
- Tables:
usersandgenerated_contenttables with proper relations - Migration: Database schema pushed successfully using
npm run db:push
- Users: Basic user management with username/password
- Generated Content: Polymorphic content storage supporting multiple media types (image, animation, audio, caption)
- Metadata: JSON storage for generation parameters and settings
- Image Generator: Uses Stable Diffusion XL via Hugging Face for high-quality image generation
- Animation Creator: Combines multiple images into animated sequences
- Audio Generator: Text-to-speech functionality with multiple voice options
- Caption Generator: Automatic caption/subtitle generation for media files
- Sidebar Navigation: Mode switching between different generators
- Content Gallery: Displays user-generated content with favorites and download options
- Form Components: Reusable form elements with validation
- Toast Notifications: User feedback system
- User selects generation mode via sidebar
- User fills out generation parameters in the respective component
- Form data is validated and submitted to backend API
- Backend processes request using appropriate AI service
- Generated content is stored with metadata
- Frontend refreshes content gallery via React Query
- User can interact with generated content (favorite, download, delete)
- Files are uploaded via multipart/form-data
- Multer middleware handles file processing
- Files are stored in
/uploadsdirectory - File metadata is stored in database
- Content is served via download endpoints
- Stable Diffusion XL: High-quality image generation via Hugging Face (stabilityai/stable-diffusion-xl-base-1.0)
- API Configuration: Requires HUGGING_FACE_API_KEY or HF_TOKEN environment variable
- Model Features: Advanced diffusion model with 1024x1024 resolution and negative prompting
- Neon Database: Serverless PostgreSQL hosting
- Connection: Uses @neondatabase/serverless driver
- Replit Integration: Custom Vite plugins for Replit environment
- Error Handling: Runtime error overlay for development
- Frontend: Vite builds React app to
dist/public - Backend: esbuild bundles server code to
dist/index.js - Database: Drizzle migrations ensure schema consistency
- Development: Uses tsx for hot reloading
- Production: Serves bundled JavaScript with static file serving
- Database: Requires DATABASE_URL environment variable
- Uploads: Local filesystem storage in
/uploadsdirectory - Static Assets: Served via Express static middleware
- Content Delivery: Direct file serving with download endpoints
- Storage: PostgreSQL-backed sessions using connect-pg-simple
- Security: Session-based authentication (implementation in progress)
- API Errors: Centralized error middleware with status codes
- Frontend Errors: Toast notifications for user feedback
- Development: Enhanced error overlays and logging
This architecture provides a scalable foundation for AI content generation with clear separation of concerns, type safety throughout the stack, and a modern development experience.