Codouss is a comprehensive web-based REPL (Read-Eval-Print Loop) platform that enables instant code execution across multiple programming languages directly in your browser. Built with modern technologies and a focus on user experience, it provides a VS Code-like coding environment with powerful features for learning, prototyping, and collaboration.
- Monaco Editor Integration: Full VS Code editing experience in browser
- Multi-Language Support: Python, JavaScript, TypeScript
- Instant Code Execution: Client-side execution with Pyodide for Python
- Real-time Output: Live execution results with comprehensive error handling
- Syntax Highlighting: Language-specific syntax highlighting and autocomplete
- Create & Save Scripts: Persistent script storage with cloud synchronization
- Script Library: Organized dashboard with search and filtering
- Auto-save: Never lose your work with automatic saving
- Script Operations: Edit, delete, duplicate, and organize scripts
- Import/Export: Download scripts and import existing code
- Secure Authentication: JWT-based login system with encrypted passwords
- User Registration: Quick and easy account creation
- Cross-Device Sync: Access your scripts from anywhere
- Session Management: Secure session handling with auto-refresh
- Password Security: Secure password hashing and change functionality
- Python: Full Python 3 with NumPy, Pandas, Matplotlib libraries
- JavaScript: Modern ES6+ features, async/await, Promise support
- TypeScript: Type-safe JavaScript with full TypeScript compilation
- Extensible Architecture: Easy to add more programming languages
- Optimized for Coding: Eye-friendly dark theme designed for long coding sessions
- Syntax Highlighting: Beautiful, accurate syntax highlighting for all languages
- Terminal-style Output: Realistic terminal appearance with color-coded output
- Responsive Design: Works perfectly on desktop, tablet, and mobile devices
- Clean Dashboard: Beautiful card-based script management interface
- Smart Search: Find scripts by name, content, or programming language
- Activity Stats: View your coding activity and favorite languages
- Quick Actions: Fast access to common operations
- User Profile Page: Complete profile management with avatar and stats
- Activity Statistics: Track your coding activity and progress
- Account Information: View and edit username, email, and account details
- Data Export: Download all your scripts and data in JSON format
- Account Security: Secure account deletion with confirmation
- Editor Customization: Font size, theme, tab size, line numbers
- Code Preferences: Default language, auto-save, word wrap, minimap
- Privacy Controls: Public profile, activity visibility settings
- Security Settings: Password change, notification preferences
- Data Management: Export data, reset settings, account controls
- Duplicate Prevention: Intelligent handling of duplicate script names
- Script Forking: Create copies of scripts with auto-generated unique names
- Validation: Real-time validation with helpful error messages
- Bulk Operations: Select and manage multiple scripts at once
- Secure Execution: Client-side code execution eliminates server security risks
- Performance Optimized: Fast execution with WebAssembly (Pyodide)
- Error Handling: Comprehensive error capture and display
- Output Formatting: Clean, readable output with proper formatting
- Monaco Editor: Full VS Code editing experience with IntelliSense
- Live Collaboration Ready: Architecture supports future real-time features
- Extensible Plugin System: Ready for custom language plugins
- API-First Design: RESTful API for all operations
- React 18 with TypeScript for type-safe development
- Vite for lightning-fast development and optimized builds
- TailwindCSS for modern, responsive styling
- Monaco Editor for professional code editing experience
- Pyodide for secure client-side Python execution
- Framer Motion for smooth animations and transitions
- React Query for efficient API state management
- React Router for seamless navigation
- Flask web framework with RESTful API design
- SQLAlchemy ORM for database operations
- JWT Authentication for secure user sessions
- SQLite database (easily upgradeable to PostgreSQL/MySQL)
- CORS for secure cross-origin requests
- Werkzeug for password hashing and security
- TypeScript for enhanced code quality and developer experience
- ESLint & Prettier for code formatting and linting
- Vitest for comprehensive testing
- Concurrently for development server management
codouss/
βββ frontend/ # React + TypeScript frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ ui/ # Core UI component library (40+ components)
β β βββ pages/ # Application pages
β β β βββ Auth.tsx # Login/Register page
β β β βββ Dashboard.tsx # Script management dashboard
β β β βββ Editor.tsx # Code editor with execution
β β β βββ Profile.tsx # User profile management
β β β βββ Settings.tsx # User preferences
β β β βββ NotFound.tsx # 404 error page
β β βββ contexts/ # React contexts
β β β βββ AuthContext.tsx # User authentication
β β β βββ CodeExecutionContext.tsx # Code execution state
β β βββ lib/ # Utilities and API clients
β β β βββ api.ts # API client functions
β β β βββ codeExecution.ts # Pyodide integration
β β β βββ errorHandling.ts # Error management
β β β βββ utils.ts # Utility functions
β β βββ hooks/ # Custom React hooks
β βββ public/ # Static assets
β βββ package.json # Frontend dependencies
βββ backend/ # Flask backend API
β βββ app.py # Main Flask application
β βββ config.py # Configuration settings
β βββ requirements.txt # Python dependencies
β βββ .env.example # Environment variables template
βββ package.json # Root package.json for monorepo
βββ README.md # This comprehensive documentation
βββ START.md # Quick start guide
- Node.js 18+ and npm (for frontend)
- Python 3.8+ and pip (for backend)
- Git for version control
-
Clone the Repository
git clone <repository-url> cd codouss
-
Install All Dependencies
npm run install:all
-
Set Up Environment Variables
cd backend cp .env.example .env # Edit .env with your configuration
-
Start Development Servers
# From root directory - starts both frontend and backend npm run dev -
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
cd frontend
npm install
npm run devcd backend
pip install -r requirements.txt
python app.py- Create Account: Register with username, email, and password
- Dashboard: View your script library and activity statistics
- Create Script: Click "New Script" to start coding
- Choose Language: Select Python, JavaScript, or TypeScript
- Write Code: Use Monaco editor with full autocomplete and syntax highlighting
- Execute: Click "Run" to execute code instantly in your browser
- Save Script: Give your script a name and save for future access
- Libraries: NumPy, Pandas, Matplotlib pre-installed
- Execution: Secure client-side execution via Pyodide
- Features: Full Python 3 syntax, exception handling, output capture
- Security: Sandboxed execution with no server-side risks
- Features: ES6+, async/await, modern JavaScript APIs
- Execution: Direct browser execution in isolated scope
- Capabilities: DOM manipulation, fetch API, Promise handling
- Security: Controlled execution environment
- Features: Full TypeScript syntax with type checking
- Compilation: Automatic transpilation to JavaScript
- Type Safety: Real-time type error detection
- IntelliSense: Advanced code completion and hints
- Script Library: View all saved scripts with thumbnails
- Search & Filter: Find scripts by name, content, or language
- Statistics: View coding activity and favorite languages
- Quick Actions: Edit, delete, fork, or run scripts
- Script Forking: Create copies with auto-generated unique names
- Bulk Management: Select and operate on multiple scripts
- Import/Export: Share scripts or backup your work
- Version History: Track script modifications
- Personal Information: Update username, email, and avatar
- Activity Stats: View coding statistics and achievements
- Data Export: Download all scripts and profile data
- Account Security: Manage password and security settings
- Theme Options: Dark, light, or high-contrast themes
- Font Settings: Adjustable font size and family
- Editor Features: Line numbers, minimap, word wrap, auto-save
- Language Defaults: Set preferred programming language
Create backend/.env file:
# Security Keys (CHANGE IN PRODUCTION)
SECRET_KEY=your-super-secret-key-here
JWT_SECRET_KEY=your-jwt-secret-key-here
# Database Configuration
DATABASE_URL=sqlite:///codouss.db
# For PostgreSQL: DATABASE_URL=postgresql://username:password@localhost/codouss
# For MySQL: DATABASE_URL=mysql://username:password@localhost/codouss
# CORS Settings
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
# Environment
FLASK_ENV=development
FLASK_DEBUG=1DATABASE_URL=sqlite:///codouss.dbDATABASE_URL=postgresql://username:password@host:port/databaseDATABASE_URL=mysql://username:password@host:port/databasecd frontend
npm run build- Upload
frontend/dist/folder - Set build command:
npm run build - Set publish directory:
dist
cd backend
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app# Backend Dockerfile
FROM python:3.9-slim
WORKDIR /app
COPY backend/ .
RUN pip install -r requirements.txt
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "app:app"]SECRET_KEY=your-production-secret-key
JWT_SECRET_KEY=your-production-jwt-key
DATABASE_URL=your-production-database-url
CORS_ORIGINS=https://your-domain.com
FLASK_ENV=production- Client-side Execution: All code runs in user's browser (Pyodide for Python)
- Sandboxed Environment: Isolated execution with limited system access
- No Server-side Code Execution: Eliminates server security vulnerabilities
- Input Validation: All user inputs validated and sanitized
- JWT Tokens: Stateless authentication with secure token handling
- Password Hashing: Bcrypt password hashing with salt
- Session Management: Secure session handling with auto-refresh
- CORS Protection: Proper cross-origin request handling
- Input Sanitization: All inputs validated against XSS and injection
- SQL Injection Prevention: Parameterized queries with SQLAlchemy
- Secure Headers: Proper security headers implementation
- Data Privacy: User data encrypted and properly handled
- Code Splitting: Optimized bundle sizes with lazy loading
- Asset Optimization: Compressed images and minified code
- Caching Strategy: Efficient browser caching for static assets
- Loading States: Smooth user experience with loading indicators
- Database Indexing: Optimized queries with proper indexing
- Connection Pooling: Efficient database connection management
- Caching: Response caching where appropriate
- API Optimization: Minimal response payloads and efficient endpoints
- Pyodide Optimization: Cached Python environment for faster execution
- WebAssembly: Near-native execution speed for Python code
- Memory Management: Efficient memory usage and cleanup
- Concurrent Execution: Non-blocking code execution
CREATE TABLE user (
id VARCHAR(36) PRIMARY KEY,
username VARCHAR(80) UNIQUE NOT NULL,
email VARCHAR(120) UNIQUE NOT NULL,
password_hash VARCHAR(200) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE script (
id VARCHAR(36) PRIMARY KEY,
title VARCHAR(200) NOT NULL,
content TEXT DEFAULT '',
language VARCHAR(50) DEFAULT 'python',
user_id VARCHAR(36) NOT NULL,
is_public BOOLEAN DEFAULT FALSE,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE
);POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current user info
GET /api/scripts- Get user's scriptsPOST /api/scripts- Create new scriptGET /api/scripts/{id}- Get specific scriptPUT /api/scripts/{id}- Update scriptDELETE /api/scripts/{id}- Delete scriptPOST /api/scripts/{id}/fork- Fork scriptPOST /api/scripts/check-name- Check name availability
GET /api/user/profile- Get user profilePUT /api/user/profile- Update profilePUT /api/user/password- Change passwordGET /api/user/settings- Get user settingsPUT /api/user/settings- Update settingsGET /api/user/export- Export user dataDELETE /api/user/account- Delete account
GET /api/public/scripts- Get public scriptsGET /api/health- Health check
# Frontend tests
cd frontend
npm test
# Backend tests (if implemented)
cd backend
python -m pytest- Unit Tests: Core utility functions and API endpoints
- Integration Tests: Full user workflows and authentication
- E2E Tests: Complete user journeys from registration to execution
- β Multi-language code execution (Python, JavaScript, TypeScript)
- β User authentication and account management
- β Script saving and management
- β Profile and settings pages
- β Dark theme optimized for coding
- β Responsive design for all devices
- β Comprehensive error handling
- β Data export and import
- π Real-time collaboration and sharing
- π Code sharing with public script library
- οΏ½οΏ½ Plugin system for custom languages
- π Advanced code analysis and linting
- π Integration with GitHub/GitLab
- π Mobile app (React Native)
- π Team workspaces and collaboration
- π Code completion and AI assistance
- π Live collaboration editing
- π Video chat integration for pair programming
- π Advanced analytics and insights
- π Custom themes and editor extensions
- π Marketplace for code snippets
- π Educational features and tutorials
We welcome contributions! Here's how to get started:
- Fork the Repository
- Create Feature Branch:
git checkout -b feature/amazing-feature - Follow Code Standards: Use TypeScript for frontend, PEP 8 for backend
- Write Tests: Include tests for new features
- Update Documentation: Keep README and comments current
- Commit Changes:
git commit -m 'Add amazing feature' - Push to Branch:
git push origin feature/amazing-feature - Open Pull Request: Describe your changes clearly
- Frontend: TypeScript, ESLint, Prettier formatting
- Backend: Python PEP 8, type hints, docstrings
- UI/UX: Follow existing design patterns and accessibility guidelines
- Testing: Write tests for new functionality
- Check browser console for errors
- Ensure stable internet connection (loads from CDN)
- Try refreshing the page or clearing browser cache
- Verify Flask server is running on port 5000
- Check CORS settings in backend configuration
- Ensure environment variables are properly set
- Run
npm installin frontend directory - Clear
node_modulesand reinstall if needed - Check Node.js version compatibility
- Verify database connection string
- Check file permissions for SQLite database
- Ensure database migrations are applied
- GitHub Issues: Report bugs and request features
- Documentation: Check this README and START.md
This project is licensed under the MIT License - see the LICENSE file for details.
- Monaco Editor team for the excellent web-based code editor
- Pyodide project for bringing Python to the browser
- React and Flask communities for robust frameworks
- TailwindCSS for beautiful, utility-first styling
- Radix UI for accessible component primitives