How peter-dated-projects/04-13-2025_speech-to-text-mac works
Project type and purpose
• This is a full-stack, real-time speech-to-text application optimized for macOS M2 using the whisper.cpp Python port.
• It comprises a Next.js/React frontend, a Flask backend exposing REST/streaming APIs, and a MongoDB database.
File structure
• Top-level directories:
• assets/models – pre-downloaded whisper.cpp model files
• backend/ – Flask app
◦ backend.py & main.py – entry points
◦ api/ – three modules: storage.py, streaming.py, stt.py (with accompanying .md docs)
◦ models/ – ORM-style Python models (session, recording, segment, conversation, user)
◦ mongodb.conf, setup.sh – database config & setup script
◦ static/ – static assets served by Flask
◦ logs/ – runtime logs for debugging/inference
• frontend/ – Next.js React app
◦ app/components/ – UI widgets (AudioRecorder, Conversation, Message, etc.)
◦ public/ – static files
◦ config/build: tsconfig.json, next.config.ts, eslint.config.mjs, package.json
• Root config files: .env, requirements.txt, setup.py, pyproject.toml
README for additional insights
• Confirms the three parts: React/Next.js frontend, Flask backend, MongoDB database
• Emphasizes real-time STT on M2 using whisper.cpp Python port