Web-OS Simulation is a lightweight, browser-based operating system emulator built with PHP, HTML5, CSS3, and JavaScript. It mimics a real desktop environment, allowing users to log in, manage files, run terminal commands, and execute C code—all within the browser.
- 🔐 Secure Login System: User authentication with session management and user switching capabilities.
- 🖥️ Interactive Desktop:
- Draggable desktop icons.
- Live clock and date widget.
- Functional Start Menu and Taskbar.
- 💻 Virtual Terminal: A command-line interface supporting commands like
ls,cd,mkdir,touch,echo,cat, andclear. - 📂 File Manager: Browse directories, view files, and manage content with a PHP-backend.
- 📝 Text Editor: Create, edit, and save text files directly in the OS.
- ⚙️ C Code Runner: Integrated environment to write and execute C programs (e.g., QuickSort) directly from the web interface.
- 🎨 Customization: System settings to personalize the user experience.
| Component | Technology |
|---|---|
| Frontend | HTML5, CSS3, JavaScript (Vanilla) |
| Backend | PHP (Session handling, file I/O, Database auth) |
| Database | MySQL (User credentials) |
| Data | JSON (Folder structures) |
OS-Simulation/
├── code/ # C compiler & execution logic
├── desktop/ # Main desktop environment (icons, taskbar, clock)
├── filemanager/ # File explorer system (JSON + PHP)
├── login/ # User authentication & database connection
├── logout/ # Session destruction scripts
├── settings/ # User preference settings
├── terminal/ # Terminal command parsing & logic
└── texteditor/ # Notepad-like application
This project requires a standard PHP server environment like XAMPP, WAMP, or MAMP.
git clone [https://github.com/yourusername/web-os.git](https://github.com/yourusername/web-os.git)
- Move the project folder to your local server's root directory.
- XAMPP:
C:\xampp\htdocs\ - MAMP:
/Applications/MAMP/htdocs/
- Important: Rename the folder to
OS-Simulationto ensure all internal links work correctly.
- Open phpMyAdmin (
http://localhost/phpmyadmin). - Create a new database named
web_os(or whatever is defined inlogin/login.php). - Run the following SQL command to create the users table:
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
password VARCHAR(255) NOT NULL, -- Use password_hash() in production
role VARCHAR(20) DEFAULT 'user'
);
-- Insert a default test user
INSERT INTO users (username, password) VALUES ('admin', 'password123');
- Optional: Update
login/login.phpif your database credentials differ from the default (root, empty password).
- Open your XAMPP/WAMP Control Panel.
- Start Apache (Web Server).
- Start MySQL (Database).
Open your browser and navigate to:
-
Login Page:
http://localhost/OS-Simulation/login/index.html -
Use the credentials you inserted in Step 3.
-
Desktop Direct Link:
http://localhost/OS-Simulation/desktop/index.html -
(Bypasses login - useful for UI testing)
(Add screenshots of your Desktop, Terminal, and Login screen here)
- Add directory persistence for the Terminal (currently resets on reload).
- Improve mobile responsiveness for the desktop interface.
- Add support for "drag and drop" file uploads.
Contributions are welcome! Feel free to fork this repository and submit a pull request.
Developed by Manish