A comprehensive Next.js application for medical exam preparation, featuring real-time exam management, payment processing, and admin dashboard capabilities.
This project is NOT affiliated with, endorsed by, or associated with any government agency, official medical board, or educational institution. This is an independent, open-source educational tool created for learning purposes.
If you use this project or find it helpful, please:
- β Star this repository on GitHub
- π Give proper attribution to the original author
- π Include credits in your implementation
Original Author: @Mbdulrohim
GitHub Repository: github.com/Mbdulrohim/prep
If you use this code in your project, please include the following attribution:
Medical Exam Preparation Platform
Created by Mbdulrohim (https://github.com/Mbdulrohim)
Original Repository: https://github.com/Mbdulrohim/prep
Please star β the repository if this project helps you!
- Interactive Exam System: Timed exams with real-time countdown and auto-submission
- Real-time Data: Live statistics, leaderboards, and progress tracking
- Multi-Category Exams: Support for RN, RM, and RPHN exam categories
- Instant Results: Immediate exam results with detailed analytics
- Smart Question Bank: Dynamic question generation and management
- Live Dashboard: Real-time monitoring of users, exams, and system stats
- Exam Management: Schedule management and question bank administration
- User Management: Access control, university management, and user analytics
- Payment Tracking: Real-time payment verification and user access management
- Feedback System: Live feedback monitoring and management
- Flutterwave: Secure payment processing with webhook support
- Paystack: Alternative payment gateway with full integration
- Access Codes: Manual access code redemption system
- Real-time Verification: Instant payment verification and access granting
- Firebase Authentication: Secure user authentication and authorization
- Real-time Database: Firestore with proper security rules
- Environment Variables: Secure configuration management
- Admin Access Control: Role-based access for admin features
- Node.js 18+
- npm or yarn
- Firebase project
- Flutterwave/Paystack accounts (for payments)
-
Clone the repository
git clone <repository-url> cd prep
-
Install dependencies
npm install
-
Environment Setup
cp .env.example .env.local
Fill in your actual values in
.env.local:- Firebase configuration
- Payment gateway credentials
- OpenAI API key (optional - for AI explanations)
-
Firebase Setup
- Create a Firebase project
- Enable Authentication (Email/Password)
- Create Firestore database
- Deploy security rules:
firebase deploy --only firestore:rules
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
src/
βββ app/ # Next.js App Router pages
β βββ admin/ # Admin dashboard
β βββ api/ # API routes
β βββ dashboard/ # User dashboard
β βββ exam/ # Exam pages
β βββ payment/ # Payment pages
βββ components/ # React components
β βββ admin/ # Admin-specific components
β βββ dashboard/ # Dashboard components
β βββ exam/ # Exam-related components
β βββ feedback/ # Feedback system
β βββ layout/ # Layout components
β βββ leaderboard/ # Leaderboard components
β βββ profile/ # Profile components
β βββ ui/ # Reusable UI components
βββ context/ # React contexts
βββ hooks/ # Custom React hooks
βββ lib/ # Utility libraries
βββ services/ # External services
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
- Create a new Firebase project
- Enable Authentication with Email/Password
- Create a Firestore database
- Download your config and add to
.env.local
- Flutterwave: Get API keys from dashboard
- Paystack: Get API keys from dashboard
- Configure webhooks for payment verification
- First user to register becomes admin
- Or manually set admin role in Firestore
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript checks- Never commit
.envfiles - Use
.env.localfor local development - Use platform-specific env vars for production
- Firestore rules are configured for proper access control
- Admin functions require authentication
- Real-time listeners have proper user validation
- All payments use secure HTTPS webhooks
- Payment verification includes signature validation
- Sensitive payment data is never stored client-side
- onSnapshot listeners for real-time data
- Automatic UI updates without page refresh
- Live indicators showing real-time status
- Memory leak prevention with proper cleanup
- Dashboard statistics
- Leaderboard rankings
- Admin monitoring
- Exam progress tracking
- Feedback system
- Live countdown timer with auto-submission
- Time warnings at 15 and 5 minutes
- Auto-save functionality every 30 seconds
- Immediate navigation to results
- Instant results using in-memory calculations
- Detailed analytics with score breakdown
- Pass/fail determination with 70% threshold
- No database delays for immediate feedback
- Update
src/lib/examData.ts - Add category to routing
- Update admin dashboard
- Test real-time features
- Create new service in
src/lib/ - Add API routes in
src/app/api/ - Update payment components
- Add webhook handling
- Connect your GitHub repository
- Add environment variables
- Deploy automatically on push
- Ensure Node.js 18+ support
- Configure environment variables
- Set up Firebase hosting (optional)
- Firebase connection: Check environment variables
- Payment webhooks: Verify webhook URLs and secrets
- Real-time updates: Check Firestore security rules
- Timer issues: Verify ExamProvider is properly wrapping components
- Enable Firebase debug logging
- Check browser console for errors
- Monitor Network tab for failed requests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Attribution Required: When using this software, you must provide proper attribution to the original author @Mbdulrohim and link to the original repository.
- Original Creator: @Mbdulrohim - Please star β the repository!
- Firebase for backend services
- Next.js for the React framework
- Tailwind CSS for styling
- Lucide React for icons
- Flutterwave & Paystack for payment processing
This software is provided "as is" without warranty of any kind. The authors and contributors are not responsible for any damages or issues that may arise from using this software. Users are responsible for ensuring compliance with all applicable laws and regulations in their jurisdiction.
This project is not affiliated with any government agency or official medical board.
For support, please open an issue in the GitHub repository or contact the development team.
Made with β€οΈ for medical education