Khela is an online Integrated Development Environment (IDE) playground designed to support the seamless execution of Node.js and Vanilla JavaScript code.
Before you can run Khela locally, you'll need to have Node.js, Redis, and npm (or Yarn) installed on your machine. Follow these steps to get Khela up and running:
- Clone the repository:
git clone https://github.com/spiritanand/khela.git cd khela
- Install the dependencies:
Note: If you are on macOS you will need to install XCode for compiling the source code of the dependency
pnpm install
node-pty
. - Configure the environment variables:
Update the
cd apps/web cp .env.example .env.local
.env.local
file with the required environment variables i.e.REDIS_URL
andNEXT_PUBLIC_WS_URL
. Refer to - Redis local setup using Docker and Redis Insight for viewing your Redis DB in a GUI. - Start the development server
pnpm dev
To use Khela, navigate to http://localhost:3000
in your web browser after starting the development server. From there,
you can create new playgrounds for Node.js or Vanilla JavaScript, write your code, and execute it in real-time within
the integrated terminal.
- Interactive Coding Environment: Supports Node.js and Vanilla JavaScript execution.
- Real-time Execution: Instant code execution in the browser + Hot reload for the frontend.
- Persistent Storage: Uses Redis to store playground IDs and code snippets.
- Real-time Communication: Utilizes WebSockets for seamless frontend and backend communication.
- Next.js
- Express
- Redis
- WebSocket (ws for node and native WebSocket for browser)
Please refer to the package.json
file for a detailed list of dependencies and their respective versions.
Khela is open source and available under the MIT License.