Lua Code Obfuscator/Deobfuscator
Provides a full-stack web app for obfuscating and deobfuscating Roblox Lua scripts with a Monaco editor and PostgreSQL storage.
What this file does
Provides a full-stack web app for obfuscating and deobfuscating Roblox Lua scripts with a Monaco editor and PostgreSQL storage.
When to use it
- Building a Roblox script obfuscation or deobfuscation service
- Creating a dual-pane code editor with processing settings
- Implementing server-side Lua code transformation with metrics
- Setting up a Neon PostgreSQL database with Drizzle ORM
Assumes this stack
Lua Code Obfuscator/Deobfuscator
Overview
This is a full-stack web application that provides Lua code obfuscation and deobfuscation services specifically designed for Roblox scripts. The application features a professional Monaco code editor with dual-pane interface, comprehensive obfuscation settings, and file upload/download functionality. Built with a modern React frontend and Node.js/Express backend.
User Preferences
Preferred communication style: Simple, everyday language.
System Architecture
Frontend Architecture
- Framework: React 18 with TypeScript
- Build Tool: Vite for fast development and optimized builds
- UI Framework: Shadcn/ui components built on Radix UI primitives
- Styling: Tailwind CSS with custom design system
- State Management: TanStack Query for server state management
- Routing: Wouter for lightweight client-side routing
- Code Editor: Monaco Editor with custom Lua/Roblox theme
Backend Architecture
- Runtime: Node.js with Express.js framework
- Language: TypeScript with ES modules
- API Design: RESTful API structure
- Request Validation: Zod schemas for type-safe validation
- Development: Hot reload with Vite integration
Data Storage Solutions
- Primary Database: PostgreSQL with Drizzle ORM
- Database Provider: Neon Database (serverless PostgreSQL)
- Fallback Storage: In-memory storage for development/testing
- Schema Management: Drizzle Kit for migrations and schema management
Key Components
Core Processing Service
- Lua Processor: Handles code obfuscation and deobfuscation logic
- Variable Renaming: Renames local variables with obfuscated names
- String Encoding: Encodes string literals for obfuscation
- Processing Statistics: Tracks metrics like processing time, lines changed, variables renamed
API Endpoints
POST /api/process: Main endpoint for processing Lua code with configurable settings
Frontend Features
- Code Editor: Dual-pane Monaco editor for input/output code
- Processing Settings: Configurable obfuscation options (variable renaming, string encoding, obfuscation levels)
- Statistics Display: Real-time processing metrics and performance data
- Responsive Design: Mobile-friendly interface with proper breakpoints
Database Schema
- Users Table: User management with username/password authentication
- Processed Scripts Table: Stores processing history with input/output code, settings, and metrics
Data Flow
- User Input: User pastes Lua code into the Monaco editor
- Settings Configuration: User selects obfuscation/deobfuscation mode and processing options
- API Request: Frontend sends POST request to
/api/processwith code and settings - Processing: Backend validates request and processes code through Lua processor service
- Database Storage: Processed script and metrics are stored in PostgreSQL
- Response: Backend returns processed code with statistics
- Display: Frontend updates output editor and shows processing metrics
External Dependencies
Frontend Dependencies
- UI Components: Radix UI primitives for accessible components
- Styling: Tailwind CSS for utility-first styling
- Icons: Lucide React for consistent iconography
- Code Editor: Monaco Editor for advanced code editing features
- HTTP Client: Native fetch API with TanStack Query wrapper
Backend Dependencies
- Database: Neon Database (serverless PostgreSQL)
- ORM: Drizzle ORM for type-safe database operations
- Validation: Zod for runtime type checking and validation
- Development Tools: TSX for TypeScript execution, ESBuild for production builds
Development Tools
- TypeScript: Full type safety across the stack
- Vite: Fast development server and build tool
- Drizzle Kit: Database migration and schema management
- Replit Integration: Special handling for Replit development environment
Deployment Strategy
Build Process
- Frontend: Vite builds optimized static assets to
dist/public - Backend: ESBuild bundles server code to
dist/index.js - Database: Drizzle manages schema migrations
Environment Configuration
- Development: Uses TSX for hot reload and Vite dev server
- Production: Serves static files from Express with compiled backend bundle
- Database: Configured via
DATABASE_URLenvironment variable
Scripts
npm run dev: Development mode with hot reloadnpm run build: Production build for both frontend and backendnpm run start: Production servernpm run db:push: Push database schema changes
The application is designed to be easily deployable on various platforms, with special considerations for Replit's environment including the cartographer plugin and runtime error overlay for enhanced development experience.
Recent Changes (January 2025)
✓ Complete Monaco Editor integration with custom Roblox-themed syntax highlighting
✓ Dual-pane code editor interface with input/output panels
✓ Professional Lua obfuscation engine with variable renaming and string encoding
✓ Comprehensive deobfuscation capabilities for common patterns
✓ File upload/download functionality for .lua files
✓ Real-time processing statistics and progress indicators
✓ Responsive dark theme design matching Roblox colors
✓ Fixed all TypeScript and accessibility warnings
✓ Optimized Monaco worker configuration for better performance
✓ PostgreSQL database integration with Neon Database
✓ Persistent storage for all processed scripts and user data
✓ Database schema management with Drizzle ORM
Current Status
The application is fully functional with a professional code editor interface and persistent database storage. Users can obfuscate and deobfuscate Lua scripts with various settings, upload/download files, and view processing statistics in real-time. All processed scripts are now permanently stored in PostgreSQL, allowing for history tracking and data persistence. The interface provides a CodePen-like experience specifically tailored for Roblox script development.
What's inside
10 sections covering architecture, components, data flow, dependencies, deployment, and recent changes
Change this for your project
- Replace
barryjensen-dev/chameleon-codewith your repository name - Replace
Neon Databasewith your PostgreSQL provider or connection string - Replace
Replit Integrationreferences with your own deployment platform details
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Dual-pane Monaco editor with separate input/output panels for code transformation
- Configurable processing settings (variable renaming, string encoding, obfuscation levels) exposed as API parameters
- Real-time processing statistics displayed alongside transformed code
Related Documents
GOOBY - Closing Store Marketplace
Defines a full-stack marketplace app for discovering closing retail stores in NY/NJ/CT/PA, with automated closure scanning and admin review.
GREEN NODE - Project Overview
Describes a full-stack recycling platform with three runtime modes, provider architecture, and development scripts for Cochabamba, Bolivia.
ADN Systems DMR Peer Server
Documents a forked FreeDMR server for amateur radio DMR voice/data routing with bridges, proxies, scheduled voice announcements, and centralized security.