A platform for creating and solving coding challenges, built with TypeScript, React, and Node.js. Feel free to contribute and help us grow the collection of challenges and concepts!
- 🚀 Interactive coding environment
- ✅ Automated test execution
- 🔒 Secure code execution in Docker containers
- 📊 Progress tracking
- 🏆 Achievement system
- 🤖 In-Editor AI Assistant with progressive help
- 🔐 GitHub OAuth authentication
Currently supported:
- TypeScript/JavaScript
- PHP
- Go
Coming soon:
- Python - Challenges in development
Interactive coding environment with real-time testing and AI assistance
Progress tracking dashboard with achievements and statistics
If you want to solve challenges from the command line, you can use the Coquest CLI. It allows you to interact with almost the same list of challenges directly from your terminal. And you can use your own code editor to solve them.
- Clone →
git clone https://github.com/crisecheverria/codequest-platform.git - Install →
npm install - Start MongoDB →
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password -d mongo - Copy env files →
cp packages/backend/.env.example packages/backend/.env&cp packages/frontend/.env.example packages/frontend/.env - Setup GitHub OAuth → Create OAuth app, update env files with real credentials
- Seed database →
cd packages/backend && npx ts-node src/scripts/seedChallenges.ts && npx ts-node src/scripts/seedConcepts.ts - Start →
npm run dev - Visit →
http://localhost:5173
- Node.js 18+
- Docker
- Go (optional - only required if using native Go execution mode)
- Clone the repository:
git clone https://github.com/crisecheverria/codequest-platform.git
cd codequest-platform- Install dependencies:
npm install- Set up MongoDB with Docker:
# Pull the MongoDB image
docker pull mongo
# Run MongoDB container with authentication enabled
docker run --name mongodb \
-p 27017:27017 \
-e MONGO_INITDB_ROOT_USERNAME=admin \
-e MONGO_INITDB_ROOT_PASSWORD=password \
-d mongoThe MongoDB container is now ready to use with the admin user. The .env.example files are already configured to work with this setup using admin:password credentials.
- Update Your Environment Variables
# Copy examples to .env files
cp packages/backend/.env.example packages/backend/.env
cp packages/frontend/.env.example packages/frontend/.env
# Update the environment variables as needed- Configure GitHub OAuth
To enable user authentication, you'll need to set up GitHub OAuth:
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click "New OAuth App"
- Fill in the application details:
- Application name:
CodeQuest Platform(or your preferred name) - Homepage URL:
http://localhost:5173 - Application description:
Local development for CodeQuest Platform(optional) - Authorization callback URL:
http://localhost:3001/api/auth/github/callback
- Application name:
- Click "Register application"
- Copy the Client ID from the app page
- Click "Generate a new client secret" and copy the Client Secret
- Update your environment files with the real values:
Backend (packages/backend/.env):
# GitHub OAuth Configuration
GITHUB_CLIENT_ID=Ov23liXXXXXXXXXXXXX # Replace with your actual Client ID
GITHUB_CLIENT_SECRET=your-actual-client-secret # Replace with your actual Client Secret
GITHUB_CALLBACK_URL=http://localhost:3001/api/auth/github/callback
# MongoDB Configuration (should already be set)
MONGODB_URI=mongodb://admin:password@localhost:27017/code-challenges?authSource=admin
JWT_SECRET=your-secret-key-change-this-in-production
NODE_ENV=developmentFrontend (packages/frontend/.env):
# GitHub OAuth Configuration
VITE_GITHUB_CLIENT_ID=Ov23liXXXXXXXXXXXXX # Same as backend Client ID
VITE_GITHUB_CALLBACK_URL=http://localhost:3001/api/auth/github/callback
# API Configuration
VITE_API_URL=http://localhost:3001
⚠️ Important: Replace the example values with your actual GitHub OAuth credentials!
- Seed the Database
Before starting the application, you'll need to populate the database with challenges and concepts:
# Navigate to the backend package
cd packages/backend
# Seed challenges
npx ts-node src/scripts/seedChallenges.ts
# Seed concepts
npx ts-node src/scripts/seedConcepts.ts- Start the Development Environment
# From the project root
npm run devThis will start both the frontend and backend services:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:3001
You should now be able to:
- Visit
http://localhost:5173 - Click "Continue with GitHub" to log in
- Start solving coding challenges!
If you need to update or re-seed the database:
cd packages/backend
# Re-seed challenges (updates existing, adds new)
npx ts-node src/scripts/seedChallenges.ts
# Re-seed concepts
npx ts-node src/scripts/seedConcepts.tsYou can reset user progress if needed:
cd packages/backend
# Reset all users (with confirmation)
npx ts-node src/scripts/resetUserProgress.ts
# Reset specific user
npx ts-node src/scripts/resetUserProgress.ts --userId=user_id_here
# Skip confirmation
npx ts-node src/scripts/resetUserProgress.ts --yes
# Completely remove progress data instead of resetting
npx ts-node src/scripts/resetUserProgress.ts --removeYou can use MongoDB Compass (a GUI for MongoDB) to visualize and interact with your database:
- Download and install MongoDB Compass
- Open MongoDB Compass
- Connect to your local MongoDB instance with the connection string:
mongodb://admin:password@localhost:27017/code-challenges?authSource=admin
The platform includes an AI assistant that provides progressive help to users while they work on coding challenges. The assistant offers five levels of assistance:
- Hint: A gentle nudge in the right direction
- Concept: Explanation of relevant programming concepts
- Approach: Step-by-step approach to solve the problem
- Pseudocode: Solution outline in pseudocode
- Code Snippet: Partial code implementation
The AI assistant has two modes:
- Local mode: Uses rule-based suggestions (no API key required)
- External API mode: Uses an external AI service for more tailored assistance
To enable the external API:
- Add the following variables to your
packages/backend/.env:
AI_API_KEY=your_api_key
AI_API_ENDPOINT=https://api.openai.com/v1/chat/completions
USE_EXTERNAL_AI_API=true
- Restart the backend server
The platform supports multiple code execution modes:
All languages (TypeScript, Go, PHP) are executed in secure Docker containers. This is the recommended mode for production.
For development environments, you can enable native Go execution for faster compile times:
- Ensure Go is installed locally (
go versionshould work) - Add to your
packages/backend/.env:
USE_NATIVE_GO_EXECUTOR=true
NATIVE_GO_TIMEOUT=45000
- Restart the backend server
Note: Native execution is only available for Go challenges and requires Go to be installed on the host system.
- Once connected, you can browse collections like
challenges,concepts,users, and more
packages/frontend: React applicationpackages/backend: Node.js API and code execution servicedata/: JSON files for challenges and concepts
- Real-time code editing with syntax highlighting
- Test execution against predefined test cases
- In-editor AI assistance with progressive levels of help
- Earn badges by completing all challenges in a concept category
- Track progress with visual indicators
- Unlock new skill trees as you progress
The AI Assistant helps users solve challenges without giving away the full solution:
- Context-aware: Analyzes the current code and challenge
- Progressive help: Provides increasingly detailed assistance
- Code integration: Can insert code snippets directly into the editor
- Educational: Explains concepts and approaches, not just solutions
If you see Command find requires authentication:
-
Check your backend
.envfile has the correct MongoDB URI:MONGODB_URI=mongodb://admin:password@localhost:27017/code-challenges?authSource=admin -
Restart your development server after updating environment variables:
npm run dev
If GitHub OAuth fails with a 404 error:
-
Verify your GitHub OAuth App settings:
- Homepage URL:
http://localhost:5173 - Callback URL:
http://localhost:3001/api/auth/github/callback
- Homepage URL:
-
Check your environment variables have real values (not placeholders):
# Backend .env should have real values like: GITHUB_CLIENT_ID=Ov23li... # Not "your-client-id" GITHUB_CLIENT_SECRET=ghp_... # Not "your-client-secret"
-
Restart the development server after updating OAuth credentials
If you see routing errors during OAuth:
- This was a known issue that has been fixed in the current version
- Make sure you're using the latest code
The avatar should appear after logging in. If not:
- The backend now automatically fetches user profile data including avatar
- Check browser localStorage for user data:
localStorage.getItem('user')
If you encounter issues with MongoDB:
# Check if the MongoDB container is running
docker ps
# See container logs for errors
docker logs mongodb
# Restart the container if needed
docker restart mongodb
# If container doesn't exist, recreate it:
docker run --name mongodb \
-p 27017:27017 \
-e MONGO_INITDB_ROOT_USERNAME=admin \
-e MONGO_INITDB_ROOT_PASSWORD=password \
-d mongoIf the AI assistant is not working correctly:
- Check if you're using the right environment variables for external API mode
- Ensure your API key is valid
- Check the backend logs for any error messages
- If using local mode, the assistance will be rule-based and less tailored
This repository uses a data-driven approach for seeding challenges and concepts. This makes it easier for contributors to add or modify content without touching the seed scripts.
code-challenge-platform/
├── data/
│ ├── challenges.json
│ └── concepts.json
├── packages/
│ ├── backend/
│ │ └── src/
│ │ └── scripts/
│ │ ├── seedChallenges.ts
│ │ └── seedConcepts.ts
│ └── frontend/
└── package.json
- Challenge and concept data is stored in separate JSON files in the
data/directory. - The seed scripts read from these JSON files instead of having hardcoded data.
To add new challenges or concepts:
- Edit the appropriate JSON file in the
data/directory. - Run the seed script to update the database.
Add a new entry to data/challenges.json following the existing format:
{
"title": "Your Challenge Title",
"description": "Challenge description...",
"difficulty": "easy|medium|hard",
"language": "typescript",
"functionName": "yourFunctionName",
"parameterTypes": ["param1Type", "param2Type"],
"returnType": "returnType",
"template": "function yourFunctionName(...) {\n // Write your code here\n}",
"testCases": [
{
"input": [input1, input2],
"expected": expectedOutput,
"description": "test case description"
}
],
"conceptTags": ["tag1", "tag2"],
"timeLimit": 5000,
"memoryLimit": 128
}Add a new entry to data/concepts.json following the existing format:
{
"name": "Concept Name",
"slug": "concept-slug",
"description": "Concept description...",
"category": "fundamentals|intermediate|advanced",
"language": "all|typescript|javascript",
"order": 21,
"dependencies": ["dependency1", "dependency2"],
"resources": [
{
"title": "Resource Title",
"url": "https://resource-url.com",
"type": "documentation|tutorial|video"
}
]
}- Separation of Concerns: Data is separate from logic
- Easy Collaboration: Contributors can focus on content without touching code
- Versioning: JSON files can be version-controlled separately
- Flexibility: Easy to extend or modify data structure without changing scripts
- Maintainability: Centralized data management makes updates simpler
We welcome contributions to the Code Challenge Platform! Here's how you can help:
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/code-challenge-platform.git - Install dependencies:
npm install - Set up your development environment following the Getting Started section
- Create a new branch for your feature:
git checkout -b feature/your-feature-name - Make your changes
- Test your changes:
npm run test - Lint your code:
npm run lint - Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request
- Edit
data/challenges.jsonto add new coding challenges - Follow the existing format and include comprehensive test cases
- Run
npx ts-node src/scripts/seedChallenges.tsto test your changes
- Edit
data/concepts.jsonto add new learning concepts - Ensure proper categorization and dependencies
- Run
npx ts-node src/scripts/seedConcepts.tsto test your changes
- Bug fixes and performance improvements
- New features and enhancements
- UI/UX improvements
- Documentation updates
- Write tests for new features
- Improve existing test coverage
- Report bugs and issues
- Use TypeScript for all new code
- Follow existing code patterns and conventions
- Write clear, descriptive commit messages
- Include tests for new functionality
- Update documentation as needed
- Provide a clear description of your changes
- Reference any related issues
- Ensure all tests pass
- Keep changes focused and atomic
- Be responsive to feedback and requests for changes
If you find a bug or have a feature request:
- Check existing issues first
- Create a detailed issue with:
- Clear description of the problem
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Environment details (OS, Node version, etc.)
Feel free to open an issue for questions about contributing or reach out through GitHub discussions.