A retro-styled Macintosh-inspired AI study companion with voice input, document upload, and intelligent chat capabilities.
- Lecture Recording: Record or upload lectures with automatic transcription and AI-generated notes
- AI Chatbot: Multi-modal conversations with document, voice, and YouTube video support
- YouTube Analyzer: Analyze YouTube videos with automatic transcription and summarization
- Document Processing: Upload and chat with PDFs, DOCX, and TXT files
- Voice Input: Record audio with instant Whisper API transcriptions
- Flashcard Generator: Auto-generate study flashcards from any content
- Quiz Creator: Create interactive quizzes from lectures, documents, or videos
- Persistent Storage: All content persists across page switches until tab is closed
- Classic Mac UI: Beautiful System 6-inspired retro interface
Frontend:
- React 18 with TypeScript
- Vite (fast development & build)
- Tailwind CSS
- Axios for API calls
Backend:
- Node.js with Express
- TypeScript
- OpenAI API (GPT-4o-mini & Whisper)
- Multer for file uploads
- pdf-parse, mammoth for document processing
- Node.js 18+ installed
- OpenAI API key (get one at https://platform.openai.com/api-keys)
- npm or yarn package manager
From the root directory:
# 1. Create backend .env file with your OpenAI API key
echo "OPENAI_API_KEY=your_actual_api_key_here" > backend/.env
echo "PORT=3001" >> backend/.env
echo "NODE_ENV=development" >> backend/.env
# 2. Install all dependencies (both frontend and backend)
npm run install:all
# 3. Start both frontend and backend servers
npm run devBoth servers will start automatically:
- Backend:
http://localhost:3001 - Frontend:
http://localhost:5173
If you prefer to run frontend and backend separately:
Backend:
cd backend
echo "OPENAI_API_KEY=your_actual_api_key_here" > .env
echo "PORT=3001" >> .env
echo "NODE_ENV=development" >> .env
npm install
npm run devFrontend (in a new terminal):
cd frontend
npm install
npm run devVisit http://localhost:5173 in your browser to use the app!
IMPORTANT: Your OpenAI API key was posted publicly in the chat. Please:
- Go to https://platform.openai.com/api-keys
- Revoke the exposed API key
- Create a new API key
- Update your
backend/.envfile with the new key - Never commit
.envfiles to git (already in.gitignore)
From the root directory:
npm run install:all- Install dependencies for both frontend and backendnpm run dev- Start both frontend and backend in development modenpm run dev:backend- Start only the backend servernpm run dev:frontend- Start only the frontend servernpm run build- Build both frontend and backend for productionnpm run clean- Remove all node_modules and uploaded files
The app opens to Lecture Recording by default. Toggle between Lecture Recording and AI Chatbot using the navigation buttons.
- Record live or upload audio/video files
- Get automatic transcription using Whisper AI
- Receive AI-generated notes, summaries, and key points
- Generate flashcards or quizzes from your lecture
- Chat with your lecture notes for deeper understanding
Access multiple content types through the + menu:
- Click + → "Upload Document"
- Select PDF, DOCX, or TXT files
- Get automatic summary and chat about content
- Click + → "Voice Input"
- Allow microphone access
- Record your voice note
- Automatic transcription and analysis
- Click + → "Analyze YouTube"
- Paste any YouTube URL
- Get video transcription and summary
- Chat about video content
Generate flashcards and quizzes from any uploaded content:
- Click "Generate Flashcards" for study cards
- Click "Generate Quiz" for practice questions
- Review and edit generated content
- All content persists until you close the tab
COGnitive/
├── backend/
│ ├── src/
│ │ ├── index.ts # Express server
│ │ ├── routes/ # API endpoints
│ │ ├── services/ # OpenAI, document processing
│ │ ├── middleware/ # File upload handlers
│ │ └── types/ # TypeScript definitions
│ ├── uploads/ # Temporary file storage
│ ├── package.json
│ └── .env # API keys (not in git)
│
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API client
│ │ ├── App.tsx # Main app component
│ │ └── main.tsx # Entry point
│ ├── index.html
│ ├── package.json
│ └── vite.config.ts
│
└── README.md
- Make sure
.envfile exists with your OpenAI API key - Check if port 3001 is already in use
- Run
npm installagain
- Ensure backend is running on port 3001
- Check browser console for CORS errors
- Verify
VITE_API_URLin frontend (uses proxy by default)
- Check file size (max 10MB for documents)
- Ensure file type is PDF, DOCX, DOC, or TXT
- Check backend logs for errors
- Grant microphone permissions in browser
- Use HTTPS or localhost (required for microphone access)
- Check browser compatibility (Chrome/Edge recommended)
GET /health- Health checkPOST /api/chat- Send chat messages with optional context and imagesPOST /api/upload/document- Upload and process documentsPOST /api/upload/audio- Transcribe audio files
POST /api/lectures/record- Upload live recordingPOST /api/lectures/upload- Upload pre-recorded lectureGET /api/lectures/status/:jobId- Check processing statusPOST /api/lectures/:jobId/flashcards- Generate flashcards from lecturePOST /api/lectures/:jobId/quiz- Generate quiz from lecture
POST /api/youtube/analyze- Analyze YouTube videoPOST /api/youtube/flashcards- Generate flashcards from transcriptPOST /api/youtube/quiz- Generate quiz from transcript
The app features a classic Macintosh System 6 aesthetic with:
- Chicago-style fonts
- Pixelated icons
- Classic Mac window chrome
- Retro gray color scheme
This project is open source and available for educational purposes.
Future enhancements could include:
- Database integration for permanent storage
- User authentication and accounts
- Cloud storage for lectures
- Export features (PDF, Anki cards, etc.)
- Mobile app version
- Collaborative study features
Made with React, Node.js, and OpenAI