Skip to content

HACKMANV8/ByteForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 ByteForge - FocusFlow

Real-Time Meeting Assistant for ADHD and Neurodivergent Students

A comprehensive full-stack web application designed to help students with ADHD and Autism manage their studies more effectively. The platform processes notes, transcribes audio/video content, generates intelligent summaries, and provides an AI-powered chat assistant with context-aware responses.


✨ Features

πŸ“ Process Notes

  • Upload and process PDF and text files
  • Extract text content from PDFs using advanced parsing
  • Generate ADHD-friendly summaries with key concepts, digestible chunks, and study tips
  • Automatically break down complex content into manageable sections

πŸŽ™οΈ Live Recording

  • Real-time meeting and lecture recording using browser MediaRecorder API
  • Instant transcription of recorded audio
  • Role-aware summaries tailored to user's perspective (Student, Developer, etc.)
  • Automatic generation of study artifacts (notes, flashcards, quizzes)

πŸŽ₯ Upload Media

  • Upload audio/video files or provide YouTube URLs
  • Multiple transcription strategies with intelligent fallback:
    • Supadata API for fast transcriptions
    • AssemblyAI for comprehensive summaries
    • Local transcription via Groq Whisper
  • Download and process YouTube videos automatically
  • Generate study materials from video content

πŸ’¬ Ask Questions (Smart Chat)

  • Context-aware AI chat assistant
  • Intelligent Resource Filtering: Automatically detects when you mention specific resources
    • "PDF notes" β†’ Uses only PDF/notes context
    • "YouTube video" β†’ Uses only video/YouTube context
    • "Live recording" β†’ Uses only recording context
    • No mention β†’ Uses all available context
  • Retrieves context from all previous sessions stored in database
  • Real-time conversation with ADHD-friendly responses

πŸ“… Study Schedule Generator

  • Create personalized study schedules based on exam dates
  • Input topics and available study hours
  • AI-generated day-by-day study plans with breaks and variety
  • Optimized for ADHD-friendly learning patterns

πŸ› οΈ Tech Stack

Backend

  • Node.js + Express.js - Server framework
  • MongoDB + Mongoose - Database and ODM
  • Groq SDK - AI/ML services (LLaMA 3.3 & Whisper)
  • JWT - Authentication tokens
  • bcrypt - Password hashing
  • Multer - File upload handling
  • pdf-parse (v2.4.5) - PDF text extraction
  • ytdl-core - YouTube video downloading
  • Zod - Input validation

Frontend

  • React 19 - UI framework
  • Vite - Build tool and dev server
  • Axios - HTTP client
  • CSS3 - Styling with modern features

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18.0.0 or higher)
  • npm or yarn package manager
  • MongoDB (local instance or MongoDB Atlas account)
  • Groq API Key (Get one here)

Optional (for YouTube processing)

  • Supadata API Key (for fast transcriptions)
  • AssemblyAI API Key (for advanced transcriptions)
  • yt-dlp (for YouTube download fallback)
  • FFmpeg (for audio conversion)

πŸš€ Installation & Setup

1. Clone the Repository

git clone <repository-url>
cd ByteForge

2. Backend Setup

cd backend
npm install

Create a .env file in the backend directory:

# Server Configuration
PORT=3001

# Database
MONGO_URI=mongodb://localhost:27017/focusflow
# Or for MongoDB Atlas:
# MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/focusflow

# JWT Secret (generate a strong random string)
JWT_SECRET=your_super_secret_jwt_key_here

# Groq AI API (Required)
GROQ_API_KEY=your_groq_api_key_here

# Optional: YouTube Transcription Services
SUPADATA_API_KEY=your_supadata_key_here
ASSEMBLYAI_API_KEY=your_assemblyai_key_here

# Optional: YouTube Download Settings
ALLOW_YOUTUBE_FALLBACK=true
ENABLE_YTDLP=true
ENABLE_FFMPEG=true
ENABLE_PIPED_FALLBACK=true
ENABLE_ASSEMBLYAI_URL=false

3. Frontend Setup

cd ../frontend
npm install

Create a .env file in the frontend directory (optional):

VITE_API_BASE_URL=http://localhost:3001

4. Start MongoDB

Local MongoDB:

# If using local MongoDB, make sure it's running
mongod

MongoDB Atlas:

  • Create a free cluster at MongoDB Atlas
  • Get your connection string and add it to .env

πŸƒ Running the Project

Development Mode

Terminal 1 - Backend:

cd backend
npm run dev

Server will run on http://localhost:3001

Terminal 2 - Frontend:

cd frontend
npm run dev

Frontend will run on http://localhost:5173 (or port shown in terminal)

Production Mode

Backend:

cd backend
npm start

Frontend:

cd frontend
npm run build
npm run preview

πŸ“‘ API Endpoints

Authentication

  • POST /api/auth/signup - Create new account
  • POST /api/auth/signin - Login

Features

  • POST /api/process-notes - Upload and process PDF/text files
  • POST /api/transcribe - Transcribe audio file
  • POST /api/transcribe-media - Upload media or YouTube URL
  • POST /api/chat - Chat with AI assistant
  • POST /api/study-schedule - Generate study schedule

Results Management

  • GET /api/results - List all user results (optional: ?type=notes|media|transcribe)
  • GET /api/results/:id - Get specific result
  • DELETE /api/results/:id - Delete result

Health Check

  • GET /api/health - Server status

Note: All endpoints except /api/health and /api/auth/* require JWT authentication.


πŸ“ Project Structure

ByteForge/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   └── db.js              # MongoDB connection
β”‚   β”‚   β”œβ”€β”€ controllers/          # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ chatController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ mediaController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ notesController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ scheduleController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ transcribeController.js
β”‚   β”‚   β”‚   └── resultsController.js
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ authMiddleware.js  # JWT verification
β”‚   β”‚   β”‚   β”œβ”€β”€ errorHandler.js   # Error handling
β”‚   β”‚   β”‚   └── validateInput.js # Input validation
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ userModel.js      # User schema
β”‚   β”‚   β”‚   └── resultModel.js    # Results schema
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js            # API routes
β”‚   β”‚   β”‚   └── authRoutes.js    # Auth routes
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ aiGenerator.js    # Groq AI integration
β”‚   β”‚   β”‚   β”œβ”€β”€ fileHandler.js    # File upload config
β”‚   β”‚   β”‚   β”œβ”€β”€ tokenUtils.js     # JWT utilities
β”‚   β”‚   β”‚   └── youtube.js        # YouTube processing
β”‚   β”‚   └── server.js             # Express app setup
β”‚   β”œβ”€β”€ uploads/                  # Temporary file storage
β”‚   └── package.json
β”‚
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”œβ”€β”€ ChatAssistant.jsx
    β”‚   β”‚   β”œβ”€β”€ Login.jsx
    β”‚   β”‚   β”œβ”€β”€ MeetingAssistant.jsx
    β”‚   β”‚   β”œβ”€β”€ MeetingTranscriber.jsx
    β”‚   β”‚   β”œβ”€β”€ NotesProcessor.jsx
    β”‚   β”‚   β”œβ”€β”€ StudySchedule.jsx
    β”‚   β”‚   └── Icon.jsx
    β”‚   β”œβ”€β”€ App.jsx               # Main component
    β”‚   β”œβ”€β”€ App.css               # Global styles
    β”‚   └── main.jsx              # React entry point
    └── package.json

πŸ”‘ Key Features Explained

Context-Aware Chat System

The chat assistant intelligently filters context based on your question:

  • Resource Detection: Analyzes your question for keywords like "PDF", "YouTube", "recording"
  • Smart Filtering: Only uses relevant stored data from previous sessions
  • Context Combination: Merges current tab context with database context
  • Real-time Updates: Automatically loads context from all previous sessions

Multi-Strategy YouTube Processing

When processing YouTube videos, the system requires:

  1. ytdl-core (direct download)
  2. ffmpeg (installed with ytdl)

This ensures maximum reliability and uptime.

PDF Processing with Modern API

Uses pdf-parse v2.4.5 with the new PDFParse class API:

  • Creates parser instance with buffer data
  • Extracts text using getText() method
  • Properly cleans up resources with destroy()
  • Handles both PDF and plain text files

Role-Aware Summaries

Transcriptions can be customized for different roles:

  • Student: Focus on learning objectives, key concepts
  • Developer: Technical details, code references
  • Manager: Action items, decisions, follow-ups
  • Default: General-purpose summary

πŸ”’ Security Features

  • Password Hashing: bcrypt with 10 salt rounds
  • JWT Authentication: Secure token-based auth (7-day expiration)
  • Rate Limiting: 100 requests per 15 minutes per IP
  • Input Validation: Zod schema validation for all user inputs
  • CORS Protection: Configured for secure cross-origin requests
  • Error Handling: Comprehensive error handling with user-friendly messages

πŸ“ Usage Examples

Processing a PDF

  1. Navigate to "Process Notes" tab
  2. Drag and drop or select a PDF file
  3. Wait for processing (shows progress)
  4. View the processed, ADHD-friendly breakdown

Recording a Meeting

  1. Go to "Live Recording" tab
  2. Click "Start Recording"
  3. Speak or let the meeting record
  4. Click "Stop Recording"
  5. View transcript and AI-generated summary

Asking Questions

  1. Go to "Ask Questions" tab
  2. Type: "Summarize the key points from my PDF notes"
  3. The system automatically filters to only PDF context
  4. Get a precise answer based on your notes

YouTube Video Processing

  1. Go to "Upload Media" tab
  2. Paste a YouTube URL
  3. System downloads and transcribes automatically
  4. Get transcript, summary, flashcards, and quiz

πŸ› Troubleshooting

MongoDB Connection Issues

  • Ensure MongoDB is running locally or Atlas cluster is accessible
  • Check .env file has correct MONGO_URI
  • Verify network connectivity

PDF Parsing Errors

  • Ensure PDF files are not corrupted
  • Check file size (max 50MB)
  • Verify pdf-parse package is installed correctly

YouTube Download Failures

  • Check if video is publicly accessible
  • Enable fallback options in .env
  • Verify yt-dlp is installed if using that option

AI API Errors

  • Verify GROQ_API_KEY is set correctly
  • Check API quota limits
  • Ensure internet connection is stable

🀝 Contributing

This project was built as a hackathon submission. Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

This project is open source and available for educational purposes.


πŸ™ Acknowledgments

  • Groq for providing fast AI inference
  • MongoDB for database services
  • All open-source libraries used in this project

πŸ“§ Contact

For questions or support, please open an issue on the repository.


Built with ❀️ for ADHD and Neurodivergent Students

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors