-
- {/* Introduction Section */}
-
-
-
- Velox Engine Documentation
-
-
- Welcome to the official documentation for Velox. The Velox Engine is a distributed, high-performance Remote Code Execution (RCE) environment designed specifically for competitive programming, online IDEs, and judging platforms.
-
-
-
-
-
- {/* Architecture Section */}
-
-
Architecture Overview
-
- Unlike traditional judging platforms that rely on single monolithic databases to queue and process code submissions (which inevitably buckle under contest traffic loads), Velox utilizes a deeply decoupled architecture:
-
-
-
- - API Gateway (Go): Ingests massive concurrency streams and handles routing.
- - Redis Queue: Operates strictly as a blazingly fast in-memory task broker ensuring
0% packet loss.
- - Worker Fleet (Docker): Instantly scales up independent, isolated sub-containers that execute untrusted code securely using Linux namespaces and cgroups.
-
-
-
- Because execution environments are pre-warmed, cold starts are effectively zero. Your users receive feedback in the exact time it takes to compile and run their script—no overhead.
-
-
-
-
-
- {/* Quick Start Section */}
-
-
Quick Start
-
- Submitting code to Velox requires a single HTTP request. Our engine bypasses traditional complex WebSocket setups for simple polling loops, or you can supply a webhook URL for immediate asynchronous callbacks.
-
-
-
Submitting a Job
-
To run your first code snippet, send a POST request to the job submittal endpoint.
-
-
-
-
-
-
- Note: Always ensure you are limiting the cpu_time_limit to prevent malicious users from triggering infinite loops on your workers. Max allowed value without an Enterprise license is 15000ms.
-
-
-
-
Understanding the Response
-
Once the worker successfully executes your payload inside an isolated container, the engine will return detailed CPU metrics, memory traces, and output streams.
-
-
-
-
- The status field will return one of the following exact competitive-programming standard verdicts:
-
- Accepted
- Wrong Answer
- Time Limit Exceeded
- Runtime Error
-
-
-
-
+
+
+
+
);
}
diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx
index c511fac..a493a8f 100644
--- a/frontend/app/layout.tsx
+++ b/frontend/app/layout.tsx
@@ -13,8 +13,14 @@ const jetbrainsMono = JetBrains_Mono({
});
export const metadata: Metadata = {
- title: "Velox | High-Performance Code Execution",
+ title: "Velox Engine",
description: "A distributed, high-performance Online Code Judger and Remote Code Execution Engine built for developers.",
+ applicationName: "Velox",
+ icons: {
+ icon: '/icon.svg',
+ shortcut: '/icon.svg',
+ apple: '/icon.svg',
+ }
};
import { SearchModal } from "@/components/ui/SearchModal";
diff --git a/frontend/components/dashboard/LogoutButton.tsx b/frontend/components/dashboard/LogoutButton.tsx
index a491184..f448a19 100644
--- a/frontend/components/dashboard/LogoutButton.tsx
+++ b/frontend/components/dashboard/LogoutButton.tsx
@@ -10,7 +10,7 @@ export default function LogoutButton() {
// Clear the authentication token
localStorage.removeItem('token');
// Redirect to the login page
- router.push('/login');
+ router.push('/');
};
return (
diff --git a/frontend/components/docs/DocumentationContent.tsx b/frontend/components/docs/DocumentationContent.tsx
new file mode 100644
index 0000000..8a39c7e
--- /dev/null
+++ b/frontend/components/docs/DocumentationContent.tsx
@@ -0,0 +1,202 @@
+import React from 'react';
+
+export default function DocumentationContent() {
+ return (
+
+
+
+
Velox Engine Documentation
+
+ Velox is a high-performance, containerized code execution engine (Online Judge) designed for immediate API-driven code compilation and execution. Securely submit source code, execute tests, and track granular telemetry natively through your API keys.
+
+
+
+
+
+ {/* Architecture Section */}
+
+
+
+
+ Unlike traditional judging platforms that rely on single monolithic databases to queue and process code submissions, Velox utilizes a deeply decoupled architecture built natively in Go:
+
+
+ {/* Visual Architecture Diagram */}
+
+
+ {/* Gateway Node */}
+
+
+
+
+
API Gateway
+
Go / Express
+
+
+
+ {/* Arrow */}
+
+
+
+ {/* Redis Node */}
+
+
+
+
+
Queue
+
Redis Broker
+
+
+
+ {/* Arrow */}
+
+
+
+ {/* Worker Node */}
+
+
+
+
+
Worker Fleet
+
Docker Containers
+
+
+
+
+
+ {/* Detailed Context */}
+
+ -
+
+ API Gateway Ingests massive concurrency streams, authenticates API secret tokens synchronously, and pipes payloads into the buffer array.
+
+ -
+
+ Redis Queue Broker Operates strictly as a blazingly fast in-memory task broker ensuring
0% packet delay. It distributes jobs to the next available worker immediately.
+
+ -
+
+ Worker Fleet Instantly spawns secure, isolated Docker sub-containers that execute untrusted code independently using standard Linux namespaces to sandbox memory and disk access.
+
+
+
+
+
+ {/* Quick Start Title Injection */}
+
+
Quick Start Guide
+
+
+ {/* Authentication Section */}
+
+
+
+
+ All requests to the execution engine are protected via your project's API Secret. Pass the key dynamically using standard Bearer Token Authentication.
+
+
+ Authorization: Bearer velox_sk_YOUR_SECRET_KEY
+
+
+
+
+ {/* Dispatch Endpoint Section */}
+
+
+
2
+
Dispatch Job (POST /submit)
+
+
+
+ Dispatch source code asynchronously into the container orchestration queue. Returns a temporary Tracker ID that you can use to poll telemetry.
+
+
+
+ Required Payload
+
+
+{`{
+ "language": "cpp",
+ "source_code": "#include \\nusing namespace std;\\nint main() { cout << \\"Hello World\\" << endl; return 0; }",
+ "time_limit": 5000,
+ "memory_limit": 512000
+}`}
+
+
+
+
+
Capabilities
+
+ - ▹C / C++ (GCC 12)
+ - ▹Java (OpenJDK 17)
+ - ▹Python 3.x
+ - ▹Node.js / TypeScript
+ - ▹C# (.NET Core)
+
+
+
+
Constraints
+
+ - ▹Max Time: 5s (5000ms)
+ - ▹Max Memory: 512MB
+ - ▹No Network / Disk I/O
+
+
+
+
+
+
+ {/* Polling Endpoint Section */}
+
+
+
3
+
Status Telemetry (GET /status)
+
+
+
+ Query the execution queue strictly via the returned submission_id parameter. Evaluates execution state and returns metrics like compile times, runtime logs, and stdout constraints.
+
+
+
+ GET /status?submission_id=123-abc
+
+
+
+
Standard Return Payload
+
+{`{
+ "submission_id": "123-abc",
+ "overall_state": "Accepted",
+ "results": null
+}`}
+
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/components/docs/Sidebar.tsx b/frontend/components/docs/Sidebar.tsx
index 718986f..d48c65b 100644
--- a/frontend/components/docs/Sidebar.tsx
+++ b/frontend/components/docs/Sidebar.tsx
@@ -13,27 +13,38 @@ export function Sidebar() {
const [activeId, setActiveId] = useState
('introduction');
useEffect(() => {
- const observer = new IntersectionObserver(
- (entries) => {
- entries.forEach((entry) => {
- if (entry.isIntersecting) {
- setActiveId(entry.target.id);
+ const handleScroll = () => {
+ // Find the currently active section by checking element bounds
+ const headerOffset = 150; // Offset for sticky headers
+
+ // Get all elements in reverse order (bottom to top)
+ for (let i = docLinks.length - 1; i >= 0; i--) {
+ const section = document.getElementById(docLinks[i].id);
+ if (section) {
+ const rect = section.getBoundingClientRect();
+ // If the top of the section is above our focal point
+ if (rect.top <= headerOffset) {
+ setActiveId(docLinks[i].id);
+ return;
}
- });
- },
- {
- // Trigger heavily towards the top of the viewport
- rootMargin: '-20% 0px -70% 0px'
+ }
}
- );
+
+ // If we're at the very top, just set it to the first item
+ if (window.scrollY < 50) {
+ setActiveId(docLinks[0].id);
+ }
+ };
- // Initial check and observation
- docLinks.forEach((link) => {
- const el = document.getElementById(link.id);
- if (el) observer.observe(el);
- });
+ // Run once on mount
+ setTimeout(handleScroll, 200);
- return () => observer.disconnect();
+ // Attach to scroll listener
+ window.addEventListener('scroll', handleScroll, { passive: true });
+
+ return () => {
+ window.removeEventListener('scroll', handleScroll);
+ };
}, []);
const handleClick = (e: React.MouseEvent, id: string) => {