A comprehensive web application for storing, viewing, categorizing, and executing code files. This platform supports multiple programming languages and allows you to run HTML websites within the application.
π Now with TypeScript and React support! The project includes a modern frontend built with TypeScript and React. See TYPESCRIPT_REACT_SETUP.md for details.
π€ NEW: AI-Powered C/C++ Code Analysis! The platform now includes intelligent code analysis for C and C++ with security checks, best practices, and alternative implementations. See ENHANCED_COMPILER_README.md for details.
- Upload and store code files organized by language
- Support for Python, Java, C, C++, and HTML
- Add titles and descriptions to your code files
- Automatic categorization by programming language
- Syntax-highlighted code editor (powered by CodeMirror)
- Beautiful, modern UI with dark theme editor
- View all your stored codes in organized categories
- Execute Python, Java, C, and C++ code directly in the browser
- Provide custom input (stdin) for interactive programs
- View program output and error messages in real-time
- Sandboxed execution with timeout limits for security
- Enhanced C/C++ compiler with multiple standards support (C11, C++17, etc.)
- Better error messages with helpful hints
- Intelligent static code analysis for C and C++ code
- Security vulnerability detection (buffer overflows, format strings, etc.)
- Memory leak detection and resource management suggestions
- Best practices recommendations (const correctness, modern C++ features)
- Alternative implementation suggestions (vectors vs arrays, smart pointers, etc.)
- Complete refactored code examples - ChatGPT-style comprehensive code transformations
- π― Full refactored version combining all improvements into working code
- Code quality improvements (magic numbers, uninitialized variables)
- Real-time analysis with detailed, actionable feedback
- π One-click GitHub PR creation with refactored code
- See ENHANCED_COMPILER_README.md for full documentation
- Upload complete HTML websites
- View HTML code with syntax highlighting
- Live preview of HTML websites running inside the platform
- Fullscreen mode for better viewing experience
- Copy code to clipboard
- Refresh preview on demand
- Server-side encrypted Python code examples
- Hybrid RSA-4096 + AES-256-GCM encryption
- Token-based authentication with HMAC-SHA256
- View encrypted code files through secure web interface
- Code is decrypted server-side only (private key never exposed)
- Time-limited access tokens for enhanced security
- Upload single files or multiple files at once
- Support for folder/batch uploads
- Automatic file organization by language
- File preview before upload
- Drag-and-drop support (coming soon)
- Persistent file storage for serverless deployments
- Automatic file synchronization to Vercel Blob
- Files persist across deployments on Vercel
- Graceful fallback to local storage
- Works alongside GitHub integration
- See VERCEL_BLOB_SETUP.md for setup guide
- Create and store notes with rich text content
- Attach multiple screenshots/images to notes
- Server-side storage with Vercel KV (Redis-compatible database)
- Drag-and-drop image upload support
- Image gallery with thumbnail previews
- Edit and delete notes
- Fallback to local memory if KV not configured
- Accessible from any code view page via "π Notes" button
- See VERCEL_KV_SETUP.md for setup guide
- Perfect for documentation, reminders, and visual references
| Language | Extension | Execution Support | Compilation | AI Analysis |
|---|---|---|---|---|
| Python | .py |
β Yes | No | β³ Coming Soon |
| Java | .java |
β Yes | Yes (javac) | β³ Coming Soon |
| C | .c |
β Yes | Yes (gcc/clang) | β Yes |
| C++ | .cpp |
β Yes | Yes (g++/clang++) | β Yes |
| HTML | .html |
π Live Preview | N/A | N/A |
Visit the live demo at: https://shield44-project.github.io/codes_storer_website/
The GitHub Pages deployment includes:
- A landing page explaining the project and features
- The encrypted file viewer (
viewer.html) as a standalone static page
This is primarily a Flask application that requires a Python backend server. GitHub Pages only supports static HTML/CSS/JavaScript files and cannot run the full application with the following features:
- Code execution (Python, Java, C, C++)
- Code storage and upload
- File management
To use these features, you must run the application locally (see installation instructions below).
- β Project landing page with documentation
- β Encrypted file viewer (requires separate decryption server)
- β Static content and documentation
- Python 3.8 or higher
- For code execution support, install:
- Python 3 (for Python code execution)
- Java JDK (for Java code execution)
- GCC (for C code execution)
- G++ (for C++ code execution)
- Clone the repository:
git clone https://github.com/shield44-project/codes_storer_website.git
cd codes_storer_website- Install Python dependencies:
pip install -r requirements.txt- Run the Flask application:
python app.py- Open your browser and navigate to:
http://localhost:5000
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.pyThe application can be configured using environment variables:
CODES_DIRECTORY (optional)
- Directory for storing code files
- Default:
stored_codes - Example:
/tmp/stored_codes(for serverless platforms)
shield44_READ_WRITE_TOKEN (optional, recommended for Vercel)
- Vercel Blob Storage read-write token for persistent storage
- Enables file persistence on serverless platforms
- See VERCEL_BLOB_SETUP.md for setup
- Example:
vercel_blob_rw_GmsSyO1ENI6nA5GJ_ETd7tIhY7RialiPNyz5YaP8U2EZTAZ
GITHUB_TOKEN
- GitHub Personal Access Token for automatic commits
- Requires
reposcope - See GITHUB_INTEGRATION_SETUP.md
GITHUB_REPO
- Target repository for commits
- Default:
shield44-project/pastebins
GITHUB_BRANCH
- Target branch for commits
- Default:
main
FLASK_DEBUG
- Enable debug mode (True/False)
- Default: False (production)
FLASK_HOST
- Server host
- Default:
0.0.0.0
FLASK_PORT
- Server port
- Default:
5000
Single File Upload (Paste Code):
- Click on "Upload New Code" button on the home page
- Select the "π Paste Code" tab
- Select the language (Python, Java, C, C++, or HTML)
- Enter a title for your code
- Optionally add a description
- Paste your code in the code editor
- Click "Upload Code"
Multiple File Upload:
- Click on "Upload New Code" button on the home page
- Select the "π Upload Files" tab
- Select the language
- Click "Select Files" and choose one or more files
- Preview the selected files
- Click "Upload Files"
The repository includes encrypted Python code examples that can be viewed securely:
-
Setup (First Time Only):
- Place your
private_key.pemin the root directory OR - Run
python setup_encryption.pyfor guided setup - See SETUP_ENCRYPTION.md for detailed instructions
- Place your
-
Viewing Files:
- Navigate to
/encrypted-vieweron the running Flask app - Click on any Python file from the list
- Files are automatically decrypted and displayed (no manual token entry needed!)
- Navigate to
Note: The system uses "shield44" as the default token secret for generating access tokens. The private key (private_key.pem) must be present for decryption to work. See SETUP_ENCRYPTION.md for more details.
For Programming Languages (Python, Java, C, C++):
- Navigate to a language category from the home page
- Click on a code file to view it
- Click "
βΆοΈ Run Code" to execute the code - Optionally provide input in the "Input (stdin)" field
- View the output in the output panel
For HTML Websites:
- Navigate to the HTML category
- Click on an HTML file to view it
- The left panel shows the HTML code
- The right panel shows a live preview of the website running
- Use the "π Refresh" button to reload the preview
- Use the "βΆ Fullscreen" button to view the website in fullscreen mode
- Use the "π Copy Code" button to copy the HTML code
All uploaded files are automatically organized by language:
- Python files β Python category
- Java files β Java category
- C files β C category
- C++ files β C++ category
- HTML files β HTML category
codes_storer_website/
βββ app.py # Main Flask application (with encryption support)
βββ config.py # Configuration settings
βββ encrypt_files.py # Tool for encrypting Python files
βββ decrypt_server.py # Standalone decryption server
βββ generate_keys.py # RSA key generation tool
βββ token_gen.py # Access token generation tool
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ ENCRYPTION_README.md # Encryption documentation
βββ .gitignore # Git ignore rules
βββ public_key.pem # RSA public key (committed)
βββ private_key.pem # RSA private key (NOT committed, server-only)
βββ viewer.html # Encrypted file viewer (standalone page)
βββ templates/ # HTML templates
β βββ base.html # Base template
β βββ index.html # Home page
β βββ category.html # Category listing page
β βββ upload.html # Upload form (with multi-file support)
β βββ view_code.html # Code viewer for executable languages
β βββ view_html.html # HTML website viewer with live preview
βββ static/ # Static assets
β βββ css/
β βββ style.css # Stylesheet
βββ encrypted/ # Encrypted Python code examples (committed)
β βββ manifest.json # Index of encrypted files
β βββ *.py.enc.json # Encrypted Python files
βββ stored_codes/ # Storage directory (auto-created, not committed)
βββ python/ # Python files
βββ java/ # Java files
βββ c/ # C files
βββ cpp/ # C++ files
βββ html/ # HTML files
βββ *_metadata.json # Metadata files
- Code execution is sandboxed with 5-second timeout limits
- Temporary directory usage for compilation and execution
- Input sanitization for uploaded code
- HTML preview uses iframe with sandbox attributes
- No direct file system access from executed code
- Command injection prevention with shell=False
- Hybrid RSA-4096 + AES-256-GCM encryption for Python code examples
- Server-side decryption only - private key never exposed to clients
- Token-based authentication with HMAC-SHA256 signatures
- Time-limited access tokens (default 1 hour, configurable)
- Encrypted files stored in repository, safe to commit
- Private key must be kept secure on server (excluded from git)
- See ENCRYPTION_README.md for detailed documentation
- File size limits (16MB max)
- File extension validation
- Filename sanitization to prevent path traversal
- Content-type validation
- Flask: Python web framework
- Python 3: Core backend language
- Cryptography: RSA-OAEP, AES-GCM encryption
- HMAC-SHA256: Token-based authentication
- TypeScript: Type-safe JavaScript development
- React: Component-based UI framework
- Webpack: Module bundler and build tool
- HTML5, CSS3: Modern web standards
- JavaScript (ES6+): Modern JavaScript features
- Node.js & npm: Package management
- ts-loader: TypeScript compilation for Webpack
- CodeMirror: Syntax highlighting
- subprocess: Python code execution
- Compilers: javac (Java), gcc (C), g++ (C++)
This project now includes a modern TypeScript/React frontend. For detailed information about the frontend setup, see TYPESCRIPT_REACT_SETUP.md.
# Install dependencies
npm install
# Start development server
npm start
# Build for production
npm run buildThe React app runs on http://localhost:3000 during development, while the Flask backend runs on http://localhost:5000.
- Chrome/Edge (recommended)
- Firefox
- Safari
- Opera
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- Ensure the required compiler/interpreter is installed
- Check that the PATH environment variable includes the compiler/interpreter
- Check browser console for errors
- Ensure the HTML file is valid
- Try the refresh button
- Check that the code syntax is valid
- Ensure title doesn't contain special characters
- Verify the file extension matches the selected language
- Ensure you're viewing a C or C++ file
- Check browser console for errors
- Try refreshing the page
- See ENHANCED_COMPILER_README.md for troubleshooting
- Install required compilers:
sudo apt-get install gcc g++ clang - System will automatically fall back to online compilation
- Check ENHANCED_COMPILER_README.md for details
- β AI Code Analysis for C/C++ (Completed!)
- β Enhanced C/C++ Compiler with Multiple Standards (Completed!)
- AI Code Analysis for Python, Java, and other languages
- Support for more languages (JavaScript, Ruby, Go, Rust, etc.)
- Machine learning-based bug prediction
- Collaborative code editing
- Code sharing via links
- Syntax checking before upload
- Code version history
- Search functionality
- Code comments and annotations
- Real-time code analysis as you type
- Integration with popular IDEs (VS Code, Vim, etc.)
For issues, questions, or suggestions, please open an issue on GitHub.