Features β’ Demo β’ Get Started β’ Tech Stack β’ Contributing
|
π― 70+ Curated Problems
β‘ Instant Feedback
π Smart Progress Tracking
|
π Multiple Choice Questions
π Achievement System
π Performance Analytics
|
|
π Secure Authentication
π Rich Dashboard
|
π Dark/Light Theme
β¨ Smooth Animations
π± Fully Responsive
|
Quick Start Guide - Get InterviewJS running locally in under 5 minutes!
Node.js 18.x or higher
MongoDB (local or Atlas)
Google OAuth credentials (optional)1οΈβ£ Clone the repository
git clone https://github.com/shridmishra/interviewjs.git
cd interviewjs2οΈβ£ Install dependencies
npm install3οΈβ£ 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-secretGenerate a secure secret:
openssl rand -base64 324οΈβ£ Start the development server
npm run dev5οΈβ£ Open your browser
Navigate to http://localhost:3000 π
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
|
Static Definitions
User Metadata
Smart Hydration
|
Multi-Provider
Middleware Pattern
|
Test Execution
User Progress
|
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 ESLintWant 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
// 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
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated!
- π΄ Fork the project
- πΏ Create your feature branch
git checkout -b feature/AmazingFeature
- πΎ Commit your changes
git commit -m 'Add some AmazingFeature' - π€ Push to the branch
git push origin feature/AmazingFeature
- π Open a Pull Request
- π Report bugs
- π‘ Suggest new features
- π Add new problems
- π¨ Improve UI/UX
- π Enhance documentation
- β‘ Optimize performance
This project is licensed under the MIT License - see the LICENSE file for details.
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! π