Skip to content

Web-based Rust Compiler, playground and API to write, compile, and execute Rust programs with instant compiler feedback and sandboxed runtime. Great for learning, prototyping, and sharing runnable Rust snippets without installing a toolchain.

Notifications You must be signed in to change notification settings

Patricklumowa/Online-Rust-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compily - Online Rust Compiler

A modern, interactive web-based Rust compiler that allows you to write, compile, and execute Rust code directly in your browser. It supports real-time output streaming, interactive standard input (stdin), and now features a full-stack architecture with user authentication and snippet management.

License Rust React SQLite

✨ Features

  • Real-time Compilation: Instant feedback with streaming output.
  • Interactive Input: Support for std::io::stdin allows you to interact with your running programs.
  • User Authentication: Secure Login and Registration using JWT and Argon2 hashing.
  • Snippet Management: Save, Edit, Delete, and List your code snippets (CRUD).
  • Modern UI: Built with React, HeroUI, and Framer Motion for a sleek, glassmorphism aesthetic.
  • Monaco Editor: Full-featured code editor with syntax highlighting for Rust.
  • API Documentation: Interactive Swagger UI for backend endpoints.

🛠️ Tech Stack

Backend

  • Language: Rust
  • Framework: Axum
  • Database: SQLite (via sqlx)
  • Authentication: JWT (jsonwebtoken) & Argon2
  • Documentation: Utoipa (Swagger UI)
  • Runtime: Tokio
  • Communication: WebSockets (axum::extract::ws) & REST API

Frontend

  • Framework: React 19 + Vite
  • Routing: React Router Dom
  • State Management: Context API (Auth)
  • UI Library: HeroUI (NextUI) + Tailwind CSS
  • Editor: Monaco Editor (@monaco-editor/react)
  • Animations: Framer Motion

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/Patricklumowa/Online-Rust-Compiler.git
    cd Online-Rust-Compiler
  2. Start the Backend

    cd backend
    cargo run

    The server will start on http://localhost:3001.

    • API: http://localhost:3001
    • Swagger UI: http://localhost:3001/swagger-ui
    • WebSocket: ws://localhost:3001/ws
  3. Start the Frontend Open a new terminal:

    cd frontend
    npm install
    npm run dev

    The UI will be available at http://localhost:5173.

📝 Usage

  1. Register/Login: Create an account to save your work.
  2. Dashboard: Manage your saved snippets.
  3. Editor: Write Rust code.
  4. Run: Click Run Code to compile and execute.
  5. Save: Persist your snippets to the database.
  6. Interact: If your program asks for input, type in the terminal pane.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Web-based Rust Compiler, playground and API to write, compile, and execute Rust programs with instant compiler feedback and sandboxed runtime. Great for learning, prototyping, and sharing runnable Rust snippets without installing a toolchain.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published