Skip to content

shridmishra/InterviewJS

Repository files navigation

InterviewJS

Master JavaScript & TypeScript Through Interactive Challenges

Features β€’ Demo β€’ Get Started β€’ Tech Stack β€’ Contributing

Stars Forks Issues License


Live Demo


✨ Features

πŸ’» Interactive Coding Challenges

🎯 70+ Curated Problems

  • Basics β€’ Async JS β€’ DOM Manipulation
  • Event Handling β€’ TypeScript Fundamentals

⚑ Instant Feedback

  • Real-time code execution
  • Comprehensive test suites
  • Detailed error messages

πŸ“Š Smart Progress Tracking

  • Solved / Attempted / Todo status
  • Star your favorites
  • Personal notes on each problem

πŸŽ“ Interactive Quizzes

πŸ“ Multiple Choice Questions

  • Instant validation
  • Detailed explanations
  • Score tracking

πŸ† Achievement System

  • Track your improvement
  • Challenge yourself daily
  • Build your streak

πŸ“ˆ Performance Analytics

  • Quiz history
  • Score trends
  • Areas to improve

πŸ‘€ Personalized Experience

πŸ” Secure Authentication

  • Google OAuth integration
  • Email/Password option
  • Protected user data

πŸ“Š Rich Dashboard

  • Activity contribution graph
  • Difficulty-based progress
  • Complete submission history
  • Personal statistics

🎨 Modern Interface

πŸŒ“ Dark/Light Theme

  • Seamless theme switching
  • Eye-friendly color schemes
  • Persistent preferences

✨ Smooth Animations

  • Framer Motion effects
  • Lottie illustrations
  • Polished interactions

πŸ“± Fully Responsive

  • Mobile-first design
  • Tablet optimized
  • Desktop enhanced

πŸ› οΈ Tech Stack

Frontend

Next.js React TypeScript Tailwind CSS

Backend & Database

MongoDB Mongoose NextAuth.js

UI & Design

shadcn/ui Radix UI Framer Motion

Developer Tools

Monaco Editor React Hook Form Zod


πŸš€ Getting Started

Quick Start Guide - Get InterviewJS running locally in under 5 minutes!

πŸ“‹ Prerequisites

Node.js 18.x or higher
MongoDB (local or Atlas)
Google OAuth credentials (optional)

πŸ”§ Installation

1️⃣ Clone the repository

git clone https://github.com/shridmishra/interviewjs.git
cd interviewjs

2️⃣ Install dependencies

npm install

3️⃣ Configure environment variables

Create a .env.local file in the root directory:

# MongoDB Connection
MONGO_URI=mongodb://localhost:27017/interviewjs
# or use MongoDB Atlas:
# MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/interviewjs

# NextAuth Configuration
NEXTAUTH_SECRET=your-secret-key-here-generate-with-openssl
NEXTAUTH_URL=http://localhost:3000

# Google OAuth (optional - for Google login)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

Generate a secure secret:

openssl rand -base64 32

4️⃣ Start the development server

npm run dev

5️⃣ Open your browser

Navigate to http://localhost:3000 πŸŽ‰

🎊 You're all set! Happy coding! πŸš€


πŸ“ Project Structure

src/
β”œβ”€β”€ πŸ“± app/                   # Next.js 15 App Router
β”‚   β”œβ”€β”€ πŸ”Œ api/              # API routes
β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ problems/       # Problem data + user progress
β”‚   β”‚   β”œβ”€β”€ quiz/           # Quiz submission
β”‚   β”‚   └── user/           # User profile & problem data
β”‚   β”œβ”€β”€ πŸ’ͺ challenges/       # Coding challenge pages
β”‚   β”œβ”€β”€ πŸ‘€ profile/          # User profile page
β”‚   └── πŸ“ quiz/             # Quiz page
β”œβ”€β”€ 🎨 components/           # React components
β”‚   β”œβ”€β”€ common/             # Shared components
β”‚   β”œβ”€β”€ modals/             # Modal components
β”‚   β”œβ”€β”€ problems/           # Problem list & detail views
β”‚   └── ui/                 # shadcn/ui components
β”œβ”€β”€ πŸ” context/              # React Context (Auth)
β”œβ”€β”€ πŸ“Š data/                 # Static data (70+ problems)
β”œβ”€β”€ πŸͺ hooks/                # Custom React hooks
β”œβ”€β”€ βš™οΈ lib/                  # Utilities & configurations
β”œβ”€β”€ πŸ—„οΈ models/               # Mongoose models
└── 🎯 types/                # TypeScript types

πŸ—οΈ Architecture Highlights

πŸ“Š Data Flow

Static Definitions

  • Problems in src/data/problems/*.ts
  • Immutable source of truth

User Metadata

  • MongoDB storage
  • Status, stars, notes

Smart Hydration

  • useChallenges hook
  • Merges static + user data

πŸ” Authentication

Multi-Provider

  • Google OAuth
  • Email/Password
  • JWT sessions

Middleware Pattern

  • authMiddleware() helper
  • Protected API routes
  • useAuth() hook

πŸ§ͺ Problem System

Test Execution

  • Isolated code evaluation
  • Real-time feedback
  • Comprehensive test suites

User Progress

  • Overlay data pattern
  • Never modifies source
  • MongoDB persistence

⚑ Available Scripts

npm run dev      # πŸš€ Start development server on :3000
npm run build    # πŸ“¦ Build for production (standalone output)
npm run start    # ▢️  Start production server
npm run lint     # πŸ” Run ESLint

πŸ“ Adding New Problems

Want to contribute new challenges? Follow this guide:

Note: Also see the detailed workflow guide at .agent/workflows/add-problem-step.md

πŸ“– Step-by-Step Tutorial

When adding a new problem set (step), you need to update 3 files:

File Purpose
src/data/topics/{topic}/problems/{N}-{name}.ts Problem definitions
src/lib/problemUtils.ts Used by sitemap and API
src/hooks/useChallenges.ts Critical - Used by practice page UI

1️⃣ Create a new problem file

// src/data/topics/javascript/problems/8-mini-projects.ts
import { Problem, Difficulty } from '@/types';

export const miniProjects: Omit<Problem, 'status' | 'isStarred' | 'notes'>[] = [
  {
    id: 'unique-problem-id',
    title: 'Problem Title',
    difficulty: Difficulty.Easy,   // Easy, Medium, or Hard
    category: 'Mini Projects',
    group: 'Step 8: Mini Projects', // Section header in UI
    description: 'Problem description...',
    starterCode: `function solution() {\n  // Your code here\n}`,
    testCases: [],
    solutionCheck: (userCode: string) => [{
      input: 'Code Check',
      expected: 'Expected behavior',
      actual: userCode.includes('solution') ? 'Correct' : 'Missing',
      passed: userCode.includes('solution'),
    }],
  },
];

2️⃣ Register in useChallenges.ts ⚠️ Critical

// src/hooks/useChallenges.ts

// Add import at top
import { miniProjects } from '../data/topics/javascript/problems/8-mini-projects';

// Add to staticProblems array (JavaScript section)
...[
    ...learnTheBasics,
    ...arrayManipulation,
    // ... other modules,
    ...miniProjects  // Add here
].map(p => ({ ...p, slug: 'js' })),

3️⃣ Register in problemUtils.ts

// src/lib/problemUtils.ts

// Add import
import { miniProjects } from '@/data/topics/javascript/problems/8-mini-projects';

// Add to topicMapping
{ modules: [...existingModules, miniProjects], topic: 'JavaScript', slug: 'js' },

4️⃣ Test your changes πŸ§ͺ

npm run build
  • Verify test cases work correctly
  • Check starter code compiles
  • Ensure solution validation logic is accurate

🀝 Contributing

We love contributions! ❀️

Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated!

How to Contribute

  1. 🍴 Fork the project
  2. 🌿 Create your feature branch
    git checkout -b feature/AmazingFeature
  3. πŸ’Ύ Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. πŸ“€ Push to the branch
    git push origin feature/AmazingFeature
  5. πŸŽ‰ Open a Pull Request

Contribution Ideas

  • πŸ› Report bugs
  • πŸ’‘ Suggest new features
  • πŸ“ Add new problems
  • 🎨 Improve UI/UX
  • πŸ“– Enhance documentation
  • ⚑ Optimize performance

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Shrid Mishra

GitHub LinkedIn


πŸ™ Acknowledgments

Special thanks to these amazing projects and communities:

  • 🎨 shadcn/ui - Beautiful component library
  • ⚑ Next.js - The React framework for production
  • πŸ”· Vercel - Deployment and hosting platform
  • πŸ’š MongoDB - Database solution
  • 🎭 Framer Motion - Animation library
  • 🌈 Tailwind CSS - Utility-first CSS framework

And all the contributors who help make InterviewJS better! πŸŽ‰


⭐ Star this repo if you find it helpful!


Star History



Made with ❀️ and β˜• by Shrid Mishra


Β© 2025 InterviewJS. All rights reserved.

About

Leetcode for MERN stack. Interview problems & theory.

Topics

Resources

Stars

Watchers

Forks

Languages