@cs124/mace
v2026.1.3
Published
Code execution coordination microservice for the CS124 platform.
Downloads
81
Readme
@cs124/mace
Code execution coordination microservice for the CS124 platform.
Overview
This service provides:
- Secure code execution for Java and Kotlin
- Sandboxed execution environment
- Code compilation and testing
- Integration with submission systems
- Performance monitoring and limits
Development
Prerequisites
- Node.js 22.18.0
- Docker (for dependencies and sandboxing)
- Java and Kotlin runtimes
Quick Start
# Install dependencies
rush update
# Start dependencies
npm run backend
# Start development server
rushx startThe service will be available at http://localhost:8085
Common Commands
# Development
rushx start # Start development server
rushx build # Build for production
rushx check # Run all quality checks
rushx test # Run tests
# Code Quality
rushx prettier # Format code
rushx eslint # Lint TypeScript/JavaScript
rushx tsc # Type check
rushx depcheck # Check for unused dependenciesProject Structure
/server- Main server implementation/client- Client-side types and utilities/container- Docker container configuration/bundled- Built server bundle (generated)
Technology Stack
- Runtime: Node.js 22.18.0
- Framework: Koa.js
- Language: TypeScript
- Execution: Docker-based sandboxing
- Languages: Java, Kotlin
- Build: esbuild
- Container: Docker with Alpine Linux
Features
- Secure Execution: Sandboxed code execution environment
- Multi-Language: Support for Java and Kotlin
- Performance Limits: CPU and memory constraints
- Compilation: Automatic compilation and error reporting
- Testing: Automated test execution
- Security: Isolated execution prevents system access
Security
- Sandboxing: All code runs in isolated Docker containers
- Resource Limits: CPU and memory restrictions
- Network Isolation: No external network access
- File System: Read-only file system with limited write access
- Time Limits: Execution timeout protection
Execution Flow
- Receive code submission
- Validate and sanitize input
- Create isolated execution environment
- Compile code (if necessary)
- Execute with resource limits
- Return results or errors
- Clean up execution environment
Docker Deployment
The service is containerized using Docker with Node.js 22.18.0 Alpine.
Contributing
- Always run
rushx checkbefore committing - Follow existing code conventions
- Use TypeScript for type safety
- Test with various code samples
- Ensure security measures are maintained
