An interactive Python learning platform that enables users to master Python through structured courses, real-time code execution, and comprehensive progress tracking.
Python Secrets is a web-based educational platform designed to teach Python programming through interactive lessons, coding challenges, and quizzes. Users can write and execute Python code directly in their browser using two compilation engines (Pyodide for client-side execution and E2B for server-side execution), providing immediate feedback and a hands-on learning experience.
Built for learners at all levels, from beginners discovering Python basics to advanced users exploring complex topics like distributed systems.
- Structured Curriculum: Multi-level courses organized into chapters and lessons (Beginner, Intermediate, Advanced)
- Progress Tracking: Real-time monitoring of lesson completion and overall course progress
- Solution Unlocking: Users can unlock official solutions after completing lessons
- Persistent State: Code snapshots and quiz answers are saved automatically
- Dual Compiler System:
- Pyodide: Client-side Python execution (runs directly in browser, fast for simple code)
- E2B: Server-side Python execution (isolated environment, supports full Python ecosystem)
- Multi-file Support: Execute projects with multiple files and dependencies
- Real-time Output: stdout, stderr, and error handling displayed immediately
- Monaco Editor: Professional code editing experience with syntax highlighting
- Lessons: Text-based tutorials with code examples and descriptions
- Quizzes: Multiple-choice questions to test understanding
- Challenges: Coding exercises with automated test cases and validation
- Articles & Tutorials: Supplementary learning materials and blog content
- Rating System: 1-5 star ratings for lessons
- Like/Dislike: Quick feedback mechanism on content
- Completion Tracking: Visual progress indicators for courses and lessons
- Optimistic UI: Immediate feedback with background synchronization
- Payload CMS Admin: Full CRUD operations for all content
- Rich Text Editor: Create and edit lessons, quizzes, and articles
- Media Management: Upload and manage images, files, and resources
- User Management: Track user progress and engagement
- Next.js 15.4 - React framework with App Router and Server Components
- React 19.2 - UI library
- TypeScript 5.7 - Type safety and better developer experience
- Tailwind CSS v4 - Utility-first styling
- Radix UI - Accessible component primitives
- Monaco Editor - Professional code editor
- Recharts - Data visualization
- Payload CMS 3.69 - Headless CMS for content management
- PostgreSQL - Primary database (via Supabase)
- Better Auth 1.4 - Authentication system
- E2B Code Interpreter 2.3 - Server-side Python execution
- Pyodide - Client-side Python execution using WebAssembly
- TanStack Query 5.90 - Server state management
- Zustand 5.0 - Client state management
Current Version: 1.0.0
Status: Active Development
The platform is currently in active development with core features implemented including course management, progress tracking, and the dual Python execution system.
- β Payload CMS 3.69 integration
- β Dual Python compiler system (E2B + Pyodide)
- β Course and chapter structure
- β Progress tracking and engagement system
- β Optimistic UI updates
- π Playground (development-only, to be removed in production)
- Node.js:
^18.20.2 || >=20.9.0 - pnpm:
^9 || ^10(required - do not use npm or yarn) - Git
-
Clone the repository
git clone <repository-url> cd python-secrets-2
-
Install dependencies
pnpm install
-
Generate Payload types
pnpm payload generate:types
-
Configure environment
cp .env.example .env # Edit .env with your configuration (see below) -
Start development server
pnpm dev
-
Access the application
- Frontend: http://localhost:3000
- Payload Admin: http://localhost:3000/admin
For detailed setup instructions including external accounts (Supabase, E2B), see the complete setup guide.
Required variables:
DATABASE_URL- PostgreSQL connection string (Supabase)PAYLOAD_SECRET- Payload CMS secret keyE2B_API_KEY- E2B API key for Python executionNEXT_PUBLIC_APP_URL- Application base URL
For detailed information about the project, refer to the documentation in the docs/ folder:
- README - Project overview and features
- SETUP - Complete development setup guide
- ARCHITECTURE - Architecture patterns and data flow
- TECH_STACK - Complete technology stack
- PROJECT_STRUCTURE - Directory organization
- COLLECTIONS - Database schema
- API - API routes and endpoints
- COMPILERS - Python execution system
- AUTH - Authentication system
- STATE_MANAGEMENT - State management patterns
- CONVENTIONS - Code style and conventions
# Development
pnpm dev # Start dev server
pnpm devsafe # Start fresh (clears .next cache)
pnpm build # Build for production
pnpm start # Start production server
# Payload
pnpm payload generate:types # Generate TypeScript types
pnpm payload generate:importmap # Generate import map
# Testing & Linting
pnpm test # Run all tests
pnpm test:int # Integration tests (Vitest)
pnpm test:e2e # End-to-end tests (Playwright)
pnpm lint # Lint codeThis project is licensed under the MIT License - see the LICENSE file for details.
Built with:
- Payload CMS - Headless CMS
- Next.js - React framework
- E2B - Code execution
- Pyodide - Python in browser
For detailed documentation, see the docs folder.
For specific issues or questions about dependencies:
- Payload CMS: payloadcms.com/docs
- Next.js: nextjs.org/docs
- E2B: e2b.dev/docs