Skip to main content

Overview

Wecode is a Laravel-based online judge system that requires specific server configurations to run properly. This page outlines all system requirements needed before installation.

Server Requirements

Operating System

  • Linux Server (Required)
    • Ubuntu 20.04 LTS or newer (recommended)
    • Any modern Linux distribution with Docker support

PHP Requirements

Wecode is built on Laravel 12, which has specific PHP requirements:
  • PHP Version: 8.4 or higher
  • Required PHP Extensions:
    • BCMath PHP Extension
    • Ctype PHP Extension
    • cURL PHP Extension
    • DOM PHP Extension
    • Fileinfo PHP Extension
    • JSON PHP Extension
    • Mbstring PHP Extension
    • OpenSSL PHP Extension
    • PCRE PHP Extension
    • PDO PHP Extension
    • Tokenizer PHP Extension
    • XML PHP Extension
PHP must have permission to run shell commands using shell_exec() function, specifically shell_exec("php"). This is critical for the judge system to function.

Database

Wecode supports the following databases:
  • MySQL 5.7 or higher
  • PostgreSQL 9.6 or higher
  • MariaDB 10.3 or higher (recommended for Docker deployments)
You’ll need:
  • Database server installed and running
  • Ability to create a new database
  • Database user credentials with full permissions

Docker

Docker is required for secure code execution. Wecode uses Docker containers to sandbox and execute user-submitted code.
  • Docker CE (Community Edition) 20.10 or higher
  • Docker must be configured to allow the web server user (typically www-data or nginx) to manage containers
  • See Docker post-installation steps for proper user permissions

Composer

  • Composer (PHP dependency manager)
  • Version 2.0 or higher recommended
  • Used to install Laravel and PHP dependencies

Optional Components

Perl

  • Recommended but optional
  • Provides more precise time and memory limit enforcement
  • Enables size limits on submitted code output
  • Install with: apt-get install perl (Ubuntu/Debian)

Redis

  • Recommended for production
  • Used for queue management and caching
  • Improves performance for submission processing

File System Permissions

  • Web directory with read/write permissions for PHP
  • Ability to create and modify files in:
    • assignments folder (stores submitted code)
    • tester folder (stores test cases)
    • storage and bootstrap/cache folders (Laravel cache)

Hardware Recommendations

Minimum Requirements

  • CPU: 2 cores
  • RAM: 4 GB
  • Storage: 20 GB SSD
  • Network: 100 Mbps
  • CPU: 4+ cores (better for concurrent submissions)
  • RAM: 8+ GB (depends on concurrent users)
  • Storage: 50+ GB SSD (grows with submissions)
  • Network: 1 Gbps
Hardware requirements scale with the number of concurrent users and submission volume. Each Docker container running student code requires CPU and memory resources.

Network Requirements

  • Outbound HTTPS (443): Required for:
    • Composer package installation
    • Moss plagiarism detection service
    • External integrations
  • Inbound HTTP/HTTPS: For web access
    • Port 80 (HTTP)
    • Port 443 (HTTPS) - recommended with SSL certificate

Software Stack Summary

# Check versions
php --version        # Should be >= 8.4
composer --version   # Should be >= 2.0
docker --version     # Should be >= 20.10
mysql --version      # or mariadb --version
perl --version       # Optional but recommended

Pre-Installation Checklist

Before proceeding with installation, ensure:
  • Linux server with root or sudo access
  • PHP 8.4+ installed with all required extensions
  • shell_exec() enabled in PHP configuration
  • MySQL/PostgreSQL/MariaDB installed and accessible
  • Docker CE installed and running
  • Web server user added to docker group
  • Composer installed globally
  • Perl installed (optional)
  • Sufficient disk space (20+ GB)
  • Directory with read/write permissions prepared

Next Steps

Once all requirements are met, proceed to:

Build docs developers (and LLMs) love