An intelligent AI-powered study companion for MSU-IIT students
Live Demo: https://noctua-ai-app.vercel.app
Features β’ Tech Stack β’ Getting Started β’ Configuration β’ Structure
- Create & Organize: Build personalized study workspaces for different subjects or topics
- Document Management: Upload, view, and organize PDF materials within each workspace
- Quick Search: Find your workspaces instantly with search and filter capabilities
- Customizable: Add icons, names, and descriptions to personalize your workspaces
- Intelligent Chat: Ask questions about your uploaded documents with context-aware responses
- Auto-Summarization: Generate comprehensive summaries of your study materials
- Smart Flashcards: Generate study flashcards from your materials
- Interactive Quizzes: Test your knowledge with AI-generated quizzes
- Instant Presentations: Create educational slide decks in seconds
- Gemini Integration: Powered by Google's Gemini 2.0 Flash model for fast, accurate answers
- Chat History: Persistent conversation history with markdown support
- Multi-Format Support: Support for PDF, DOCX, TXT, and Markdown files
- Material Repository: Centralized hub for all your study documents
- Built-in PDF Viewer: View documents directly in the browser
- Text Extraction: Automatic text extraction for AI processing
- Flexible Exports: Download content as PDF, Markdown, or Text
- Batch Upload: Drag-and-drop multiple files at once
- Smart Metadata: Track file size, upload dates, and source organization
- Firebase Authentication: Secure Google sign-in for MSU-IIT students
- User Isolation: Each user's data is completely private and isolated
- Real-time Sync: Changes sync instantly across all your devices
- Firestore Database: Reliable cloud storage for all your materials
- Modern Dark Theme: Easy on the eyes with gradient accents
- Fully Responsive: Optimized experience on mobile, tablet, and desktop
- Smooth Animations: Polished interactions and transitions
- Custom Components: Tailored UI elements for the best user experience
- Admin Dashboard: Overview of all notebooks and sources
- Data Management: Easy cleanup and organization tools
- Debug Interface: Monitor application state and health
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe development
- Vite 7 - Lightning-fast build tool and dev server
- TanStack Router - Type-safe routing with file-based routes
- Tailwind CSS 4.0 - Utility-first CSS framework
- Firebase
- Authentication - Secure Google OAuth
- Firestore - NoSQL cloud database
- Storage - Cloud file storage for PDFs
- Google Gemini AI - Advanced language model (Gemini 2.0 Flash)
- Vercel Functions - Serverless API endpoints
- PDF.js - PDF rendering and text extraction
- React Markdown - Markdown rendering with GFM support
- React Dropzone - File upload with drag-and-drop
- Lucide React - Beautiful icon set
- Vitest - Fast unit testing framework
Before you begin, ensure you have:
- Node.js 18+ and npm (or yarn/pnpm)
- Firebase Project - Create one here
- Google Gemini API Key - Get one here
- MSU-IIT Email - For authentication (or configure your own domain)
git clone <repository-url>
cd noctua-ai-appnpm installCreate a .env file in the root directory:
# Firebase Configuration
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_firebase_app_id
# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_key- Go to Firebase Console β Authentication β Sign-in method
- Enable Google provider
- Configure authorized domains (add your local and production URLs)
- (Optional) Set up domain restrictions for
@g.msuiit.edu.phemails
- Create a Firestore database in production mode
- Add these security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// User-specific notebooks
match /users/{userId}/notebooks/{notebookId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
// Sources within notebooks
match /sources/{sourceId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Summaries
match /summaries/{summaryId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Chat history
match /chats/{chatId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
}- Go to Storage β Rules
- Add these security rules:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /users/{userId}/{allPaths=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}npm run devThe app will be available at http://localhost:3003 π
# Development
npm run dev # Start dev server on port 3003
# Building
npm run build # Build for production
# Preview
npm run serve # Preview production build
# Testing
npm run test # Run unit tests
# Router
npm run generate # Generate TanStack Router routesnoctua-ai-app/
βββ src/
β βββ api/ # API handlers
β β βββ gemini.ts # Gemini AI integration
β βββ components/
β β βββ cards/ # Reusable card components
β β β βββ MaterialCard.tsx
β β β βββ NotebookCard.tsx
β β β βββ SourceCard.tsx
β β β βββ StudioCard.tsx
β β βββ sections/ # Page sections
β β β βββ ChatArea.tsx
β β β βββ MobileTabs.tsx
β β β βββ NotebookHeader.tsx
β β β βββ SourcesSidebar.tsx
β β β βββ StudioSidebar.tsx
β β βββ ui/ # UI components
β β β βββ AppLoader.tsx
β β β βββ CustomUserButton.tsx
β β β βββ ErrorMessage.tsx
β β β βββ MarkdownContent.tsx
β β β βββ Modal.tsx
β β βββ authProvider.tsx # Auth context
β β βββ navigation.tsx # Main navigation
β β βββ pdfViewer.tsx # PDF viewer component
β β βββ signIn.tsx # Sign-in component
β βββ hooks/ # Custom React hooks
β β βββ useAutoScrollToLatestChat.ts
β β βββ useChatHistory.ts
β β βββ useFirebaseAuth.ts
β β βββ useGlobalPdfs.ts
β β βββ useNotebooks.ts
β β βββ useNotebookSources.ts
β β βββ usePDFs.ts
β βββ lib/
β β βββ firestore/ # Firestore operations
β β β βββ chats.ts
β β β βββ flashcards.ts
β β β βββ notebook.ts
β β β βββ presentations.ts
β β β βββ quizzes.ts
β β β βββ sources.ts
β β β βββ summaries.ts
β β βββ gemini.ts # Gemini AI client
β β βββ fileExtractor.ts # Universal file text extraction
β β βββ pdfExtractor.ts # PDF text extraction
β βββ utils/ # Utility functions
β β βββ download.ts # File download helpers
β β βββ formatters.ts # Data formatting helpers
β βββ routes/ # TanStack Router routes
β β βββ __root.tsx # Root layout
β β βββ index.tsx # Workspaces homepage
β β βββ notebook.$notebookId.tsx # Notebook detail
β β βββ repository.tsx # Material repository
β β βββ admin.tsx # Admin dashboard
β β βββ sign-in.tsx # Authentication
β βββ types/ # TypeScript definitions
β β βββ chat.ts
β β βββ flashcard.ts
β β βββ notebook.ts
β β βββ presentation.ts
β β βββ quiz.ts
β β βββ source.ts
β β βββ summary.ts
β βββ firebase.ts # Firebase initialization
β βββ formatters.ts # Utility formatters
β βββ main.tsx # App entry point
β βββ styles.css # Global styles
βββ public/ # Static assets
βββ .env # Environment variables
βββ package.json
βββ tsconfig.json
βββ vite.config.ts
βββ README.md
--background-dark: #0f0f0f
--background-primary: #1a1a1a
--blue-primary: #2A88D8
--blue-accent: #3b82f6
--purple-accent: #5D35B3
--text-primary: #ffffff
--text-secondary: #9ca3af
--border-subtle: #374151- Workspaces Grid: Responsive card layout with hover effects
- PDF Viewer: Full-screen modal with zoom and navigation
- Chat Interface: Message bubbles with markdown rendering
- Upload Modal: Drag-and-drop with progress indicators
- Navigation: Bottom mobile nav, sidebar on desktop
users/{userId}/
βββ notebooks/{notebookId}/
βββ name: string
βββ description: string
βββ icon: string
βββ createdAt: timestamp
βββ updatedAt: timestamp
βββ sources/{sourceId}/
βββ name: string
βββ type: 'pdf'
βββ url: string
βββ size: number
βββ uploadedAt: timestamp
βββ extractedText: string
βββ summaries/{summaryId}/
βββ sourceIds: string[]
βββ summary: string
βββ createdAt: timestamp
βββ chats/{chatId}/
βββ role: 'user' | 'assistant'
βββ content: string
βββ timestamp: timestamp
users/{userId}/
βββ pdfs/{pdfId}.pdf
# Run tests
npm run test
# Run tests in watch mode
npm run test -- --watch
# Run tests with coverage
npm run test -- --coverage- Push your code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy!
Make sure to set all the environment variables from the .env file in your hosting platform.
npm run builddist/
- β Firebase Security Rules - Properly configured for user isolation
- β Environment Variables - Sensitive keys never committed
- β Authentication - Required for all protected routes
- β Input Validation - Sanitized user inputs
- β CORS - Configured for production domains
- Ensure Firestore security rules are properly set
- Verify user is authenticated
- Check that userId matches in the path
- Check Firebase Storage rules
- Verify Storage bucket is configured
- Ensure file size is under Firebase limits (default: 10MB)
- Verify
GEMINI_API_KEYis set correctly - Check API quota in Google AI Studio
- Ensure PDF text extraction completed
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
# Clear Vite cache
rm -rf .vite node_modules/.viteWe welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Write tests for new features
- Update documentation as needed
- Follow the existing code style
This project is licensed under the MIT License - see the LICENSE file for details.
- π§ Email: Your support email
- π Bug Reports: Create an issue
- π‘ Feature Requests: Open a discussion
- π Documentation: Check the
/docsfolder
- Mobile app (React Native)
- Voice input and output
- Collaborative workspaces
- Export notes as PDF/Markdown
- Advanced search with filters
- Flashcard generation
- Study progress tracking
- Integration with LMS systems
- Offline mode support
- Browser extension
- Multi-language support
- Advanced AI models (GPT-4, Claude)
- MSU-IIT for the inspiration
- Google Gemini for AI capabilities
- Firebase for backend infrastructure
- Vercel for hosting
- Built with β€οΈ for LAV and Sir Lua
- β‘ Lighthouse Score: 95+ across all metrics
- π Build Time: ~30 seconds
- π¦ Bundle Size: ~500KB (gzipped)
- π Hot Reload: <50ms
Made with β€οΈ and β by the Noctua AI Team