A full-featured JavaScript interview preparation web application with AI-powered quiz generation, progress tracking, and detailed analytics.
- AI-Powered Quizzes: Generate unique JavaScript questions using OpenAI GPT-4
- 15 Core JavaScript Topics: Closures, Hoisting, this Keyword, Type Coercion, and more
- Progressive Difficulty: Questions adapt based on your practice day
- Timed Quizzes: 20-minute quizzes with countdown timer
- Detailed Analytics: Track performance by topic, view trends over time
- Gamification: Streaks, achievements, points, and level progression
- Dark Mode: Toggle between light and dark themes
- Mobile Responsive: Works great on all device sizes
- PWA Support: Install as a progressive web app
- Node.js 18+
- npm or yarn
- Supabase account
- OpenAI API key
-
Clone the repository
git clone https://github.com/yourusername/prep-js.git cd prep-js -
Install dependencies
npm install
-
Set up environment variables
Copy
.env.exampleto.env.localand fill in your credentials:cp .env.example .env.local
Edit
.env.local:NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key OPENAI_API_KEY=your_openai_api_key NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Set up the database
Go to your Supabase project's SQL Editor and run the contents of
supabase-schema.sql.The default access key is
prepjs2024. You can change this by:const bcrypt = require('bcryptjs'); const hash = bcrypt.hashSync('your-secret-key', 10); console.log(hash);
Then update the
access_keyin theuserstable. -
Run the development server
npm run dev
-
Open the app
Navigate to http://localhost:3000
src/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── quiz/ # Quiz generation & submission
│ │ └── user/ # User stats & achievements
│ ├── analytics/ # Analytics page
│ ├── dashboard/ # Dashboard page
│ ├── login/ # Login page
│ ├── profile/ # Profile page
│ └── quiz/ # Quiz pages
├── components/ # React components
│ ├── analytics/ # Analytics components
│ ├── auth/ # Authentication components
│ ├── layout/ # Layout components (Navbar, etc.)
│ ├── quiz/ # Quiz components
│ └── ui/ # Reusable UI components
├── lib/ # Utility functions
│ ├── quiz.ts # Quiz logic & OpenAI integration
│ ├── store.ts # Zustand state management
│ ├── supabase-client.ts # Browser Supabase client
│ └── supabase-server.ts # Server Supabase client
└── types/ # TypeScript type definitions
- Closures
- Hoisting
- The
thisKeyword - Type Coercion
- Prototypes and Inheritance
- Event Loop and Asynchronous Execution
- Scope (Lexical vs Block)
- Equality Operators (
==vs===) - Arrow Functions
- Truthy/Falsy Values
- Operator Precedence and Associativity
- Array and Object Behaviors
- IIFEs (Immediately Invoked Function Expressions)
- Promises and Async/Await
- Strict Mode
- Perfect Score: Score 10/10 on any quiz
- Speed Demon: Complete a quiz under 10 minutes with >80%
- Week Warrior: Maintain a 7-day streak
- Month Master: Maintain a 30-day streak
- Century Champion: Maintain a 100-day streak
- And more!
| Days | Easy | Medium | Hard |
|---|---|---|---|
| 1-7 | 5 | 3 | 2 |
| 8-14 | 2 | 4 | 4 |
| 15+ | 1 | 2 | 7 |
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- Database: Supabase (PostgreSQL)
- AI: OpenAI GPT-4
- State Management: Zustand
- Charts: Recharts
- Icons: Lucide React
- Syntax Highlighting: Prism.js
The app includes:
- Login Page: Secure access key authentication
- Dashboard: Overview of stats, recent quizzes, and quick actions
- Quiz Page: Timed questions with syntax-highlighted code
- Results Page: Detailed breakdown with explanations
- Analytics Page: Charts and topic performance analysis
- Profile Page: User stats and account actions
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Make sure to set these in your deployment platform:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYOPENAI_API_KEYNEXT_PUBLIC_APP_URL
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you have any questions or issues, please open an issue on GitHub.