Pyscape is a web-based adaptive learning platform focused on Python, Artificial Intelligence, Machine Learning, Data Science, Generative AI, and Agentic AI. The platform provides personalized learning paths, interactive algorithm visualizations, project-based labs, real-time challenges, and an integrated portfolio system to showcase completed work.
-
Adaptive Learning Platform
- Personalized learning paths
- Gamified learning (XP, badges, levels)
- Reddit-style topic selection
-
Algorithm Visualizer
- Interactive step-by-step algorithm visualization
- Compare different algorithms
-
Project Labs
- Guided practical projects
- Performance metrics and visualization
- Portfolio integration
-
Real-time Code Duels βοΈ
- Live 1v1 coding battles via WebSockets
- Matchmaking system by difficulty and language
- Real-time code execution with Judge0 API
- XP rewards and leaderboard rankings
- In-duel chat and live progress tracking
-
Real-time Learning Engagement
- AI news and updates dashboard
- ML Sandbox with Multi-Language Code Execution
- JavaScript (client-side execution)
- Python, Java, C, C++ (server-side execution via Judge0 API)
- Real-time code compilation and execution
- Interactive input/output handling
- Syntax highlighting and error reporting
-
Portfolio View
- Project showcasing
- Performance metrics
- Exportable as PDF
- Frontend: React.js, Tailwind CSS, Framer Motion
- Backend: Supabase (Postgres + Auth)
- AI & Learning Engine: OpenAI/Anthropic API, LangChain
- Algorithm Visualizer: D3.js / React-Vis
- Real-time Components: Supabase Realtime, WebSockets, Pyodide
- Code Execution: Judge0 CE API via RapidAPI, CodeMirror Editor
The ML Sandbox provides a comprehensive code execution environment supporting multiple programming languages:
- JavaScript: Instant browser-based execution with live console output
- Python: Server-side execution with full library support (NumPy, Pandas, Matplotlib)
- Java: Compile and run Java programs with automatic compilation
- C/C++: Native compilation and execution with GCC
- π¨ Modern Code Editor: Syntax highlighting, auto-completion, and multiple themes
- β‘ Real-time Execution: Instant feedback with detailed output and error reporting
- π Interactive Input: Support for user input through stdin for interactive programs
- π Theme Support: Dark and light mode with customizable interface
- πΎ Code Management: Copy, share, and download code snippets
- π Secure Execution: All server-side code runs in isolated, secure environments
- Client-side (JavaScript): Runs directly in browser sandbox for immediate feedback
- Server-side (Python, Java, C, C++): Powered by Judge0 CE API for secure, scalable execution
pyscape.workflow.mp4
code.duel.full.mp4
- Node.js (v16+)
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/pyscape.git cd pyscape -
Install dependencies:
npm install -
Create a
.envfile in the root directory with the following variables:REACT_APP_SUPABASE_URL=your-supabase-project-url REACT_APP_SUPABASE_ANON_KEY=your-supabase-anon-key REACT_APP_GNEWS_API_KEY=your-gnews-api-key REACT_APP_RAPIDAPI_KEY=your-rapidapi-key-hereAPI Keys Setup:
- Supabase: Create a project at supabase.com and get your URL and anon key
- GNews API: Get your API key from gnews.io
- RapidAPI (for Code Execution):
- Go to RapidAPI Judge0 CE
- Sign up for a free account (150 requests/month)
- Subscribe to the free plan
- Copy your
X-RapidAPI-Keyfrom the dashboard - Add it to your
.envfile asREACT_APP_RAPIDAPI_KEY
-
Set up Supabase Database:
Go to your Supabase dashboard β SQL Editor and run the following SQL to create the required tables:
-- Create the profiles table CREATE TABLE public.profiles ( id UUID REFERENCES auth.users(id) ON DELETE CASCADE PRIMARY KEY, full_name TEXT, nickname TEXT, gender TEXT, role TEXT, organization TEXT, bio TEXT, avatar_url TEXT, profile_complete BOOLEAN DEFAULT FALSE, onboarding_completed BOOLEAN DEFAULT FALSE, selected_topics TEXT[], created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Enable Row Level Security ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY; -- Create policies to allow authenticated users to manage their own profiles CREATE POLICY "Users can view their own profile" ON public.profiles FOR SELECT USING (auth.uid() = id); CREATE POLICY "Users can insert their own profile" ON public.profiles FOR INSERT WITH CHECK (auth.uid() = id); CREATE POLICY "Users can update their own profile" ON public.profiles FOR UPDATE USING (auth.uid() = id); -- Create an updated_at trigger CREATE OR REPLACE FUNCTION public.handle_updated_at() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER profiles_updated_at BEFORE UPDATE ON public.profiles FOR EACH ROW EXECUTE FUNCTION public.handle_updated_at();
If you already have an existing profiles table, run this migration:
-- Add the selected_topics column to existing table ALTER TABLE public.profiles ADD COLUMN selected_topics TEXT[] DEFAULT NULL; -- Add comment for documentation COMMENT ON COLUMN public.profiles.selected_topics IS 'Array of topic IDs selected by user during onboarding';
-
Start the development server:
npm start -
Start the Code Duel WebSocket Server (for real-time duels):
cd backend npm install npm run dev:duelThe WebSocket server will run on
ws://localhost:8080 -
Open http://localhost:3000 in your browser.
The profiles table stores user profile information:
| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key, references auth.users(id) |
| full_name | TEXT | User's full name |
| nickname | TEXT | User's preferred nickname |
| gender | TEXT | User's gender |
| role | TEXT | User's role (Student, Professional, etc.) |
| organization | TEXT | User's organization/school |
| bio | TEXT | User's biography |
| avatar_url | TEXT | URL to user's avatar image |
| profile_complete | BOOLEAN | Whether profile setup is complete |
| onboarding_completed | BOOLEAN | Whether topic selection is complete |
| selected_topics | TEXT[] | Array of selected topic IDs |
| created_at | TIMESTAMPTZ | Record creation timestamp |
| updated_at | TIMESTAMPTZ | Last update timestamp |
The profiles table uses RLS policies to ensure users can only access their own data:
- Users can SELECT their own profile
- Users can INSERT their own profile
- Users can UPDATE their own profile
pyscape/
βββ public/
βββ src/
β βββ components/
β β βββ auth/
β β βββ codeDuel/
β β βββ dashboard/
β β βββ layout/
β β βββ portfolio/
β β βββ projects/
β β βββ sandbox/
β β βββ visualizer/
β βββ context/
β βββ hooks/
β βββ pages/
β βββ utils/
β βββ App.js
β βββ index.js
βββ package.json
To build the app for production:
npm run build
This creates an optimized build in the build folder that can be deployed to any static hosting service.
Problem: "Cannot connect to WebSocket server" error
Solution:
- Ensure the Code Duel WebSocket server is running:
cd backend && npm run dev:duel - Verify it's running on port 8080 (check terminal output)
- Check your firewall isn't blocking WebSocket connections
- Ensure your backend
.envfile has the correct Supabase and RapidAPI keys
Problem: "Code execution failed" during duels
Solution:
- Verify your RapidAPI key is valid and has Judge0 API access
- Check your RapidAPI usage limits haven't been exceeded
- Ensure the Judge0 API subscription is active on RapidAPI
- Check browser console and server logs for detailed error messages
Problem: Can't find an opponent / stuck in queue
Solution:
- The matchmaking system requires at least 2 players in queue
- For testing, open the app in multiple browser windows/tabs
- Check that both players selected the same difficulty and language
- If queue gets large (4+), system will match even with different preferences
Problem: "RapidAPI key not configured" error in ML Sandbox
Solution:
- Ensure you have added
REACT_APP_RAPIDAPI_KEYto your.envfile - Restart your development server after adding the key
- Verify your RapidAPI subscription is active
- Check that your key has the correct permissions for Judge0 CE API
Problem: Code execution timeout or errors
Solution:
- Check your internet connection
- Verify your RapidAPI usage limits (150 requests/month on free plan)
- Ensure your code doesn't have infinite loops or excessive resource usage
- Try running simpler code first to test the connection
Problem: JavaScript code works but server-side languages don't
Solution:
- JavaScript runs locally, while Python/Java/C++ require RapidAPI
- Verify your RapidAPI key is correctly configured
- Check browser network tab for failed API requests
- Ensure you're subscribed to the Judge0 CE API on RapidAPI
Problem: Application won't start
Solution:
- Run
npm installto ensure all dependencies are installed - Check that all environment variables are set in
.env - Verify Node.js version is 16 or higher
- Clear npm cache:
npm cache clean --force
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Design inspiration from modern developer platforms and learning environments
- Algorithm visualizations inspired by AlgoViz and similar educational tools