A Next.js application for uploading and processing various types of content files to enable AI-powered learning experiences.
- Simple interface with two main actions: Upload Content and Learn
- Modern, responsive design
- Drag & drop or click to browse file upload
- Automatic file processing based on file type
- Organized storage with each file getting its own folder
- Support for multiple file types:
- Text files (.txt, .md) - stored as-is
- Documents (.pdf, .docx, .doc) - text extracted
- Videos (.mp4, .mov, .avi, .webm) - audio transcribed + screenshots every 5 minutes
- Images (.jpg, .png) - stored as-is (OCR planned)
- Data files (.json, .csv) - stored as-is
When you upload a file, the system:
- Creates a unique folder with timestamp and filename
- Stores the original file
- Processes based on file type:
- PDFs/DOCX: Extracts text content to
extracted_text.txt
- Videos:
- Extracts audio to
extracted_audio.wav
- Takes screenshots every 5 minutes
- Creates placeholder for transcript (ready for Whisper API integration)
- Extracts audio to
- Text/Images: Keeps original format
- PDFs/DOCX: Extracts text content to
- Creates a processing summary with details
- View all uploaded files in organized folders
- See processing status and contents
- File size limit: 500MB per file
- Files stored in
/content
directory (gitignored)
- Interactive Q&A with uploaded content
- Content analysis and summaries
- Personalized study plans
- Auto-generated quizzes
- Frontend: Next.js 15, React, TypeScript, Tailwind CSS
- File Processing:
- PDF parsing with
pdf-parse
- DOCX processing with
mammoth
- Video processing with
ffmpeg
- PDF parsing with
- Storage: Local file system (expandable to cloud storage)
-
Clone the repository
git clone <repository-url> cd uc-berkeley-ai-hackathon-2025
-
Install dependencies
npm install
-
Verify ffmpeg installation (required for video processing)
ffmpeg -version
If not installed on Mac:
brew install ffmpeg
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
/content/ # Upload directory (gitignored)
└── 2024-01-15T10-30-00_document/ # Individual file folders
├── document.pdf # Original file
├── extracted_text.txt # Processed content
├── processing_summary.txt # Processing details
└── ... # Other processed files
/app/
├── api/
│ ├── upload/ # File upload endpoint
│ └── files/ # File listing endpoint
├── lib/
│ └── file-processor.ts # Core processing logic
├── upload/ # Upload page
├── learn/ # Learning page (coming soon)
└── page.tsx # Homepage
Upload and process files
- Input: FormData with file
- Output: Processing results and folder info
List all uploaded files
- Output: Array of files/folders with metadata
- Extracts all text content
- Preserves formatting where possible
- Saves to
extracted_text.txt
- Extracts raw text content
- Handles various document structures
- Saves to
extracted_text.txt
- Audio Extraction: Converts to 16kHz mono WAV for transcription
- Screenshots: Captures frames every 5 minutes at high quality
- Transcript Placeholder: Ready for speech recognition integration
- Metadata: Duration and processing info
- Audio Transcription: OpenAI Whisper API integration
- OCR for Images: Text extraction from images
- Cloud Storage: S3/GCS integration
- Real-time Processing: WebSocket updates
- Content Search: Full-text search across processed files
- AI Integration: GPT-4 for content analysis and Q&A
- File processing is asynchronous and handles errors gracefully
- Original files are always preserved
- Processing failures don't prevent file storage
- All file operations use proper error handling
- TypeScript for type safety throughout
- Fork the repository
- Create a feature branch
- Make your changes
- Test file processing with various file types
- Submit a pull request
[Add your license here]