Giter Site home page Giter Site logo

jakt-playground's Introduction

jakt-playground

  • frontend - is a single page application that connects to the backend url specified in .env
  • backend - is a http server that handles the requests by passing the input to the one time docker container
  • sandbox - contains the Dockerfile and the scripts to set up the image

Building Instructions

Windows/WSL2

TODO

Prerequisites

  • Rust
  • Jakt
  • Node.js (yarn)
  • Docker

Setting up Jakt

If you don't have jakt installed run those commands:

git clone https://github.com/SerenityOS/jakt
cd jakt
cargo install --path .

Make sure to set the enviorment JAKT_HOME and JAKT_PLAYGROUND_HOME:

export JAKT_HOME="/path/to/jakt"
export JAKT_PLAYGROUND_HOME="/path/to/jakt-playground"

Starting the backend

If you don't have rust installed run this command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

And you are set! To run it run:

cd backend
cargo run

This project can accept this arguments

  • ALLOW_ORIGIN - sets access-control-allow-origin header (default: *)
  • PORT - sets server's port (default: 8080)

You can pass those arguments like this:

ALLOW_ORIGIN="https://example.com" PORT="4242" cargo run

Building the Docker image

Make sure you have Docker installed:

sudo apt update
sudo apt install docker.io
sudo systemctl start docker

Then you only need to run this shell. This will create an image called jakt_sandbox:

bash sandbox/setup.sh

You are free to run this command to clean up unused images:

docker image prune

Building the UI

If you don't have node.js installed, run these commands:

# Install Node Version Manager
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

# Install the latest version
nvm install node

# Install yarn
npm -g install yarn

Install the packages:

cd frontend
yarn install

Create .env file and change VITE_SERVER_URL to the backend url:

VITE_SERVER_URL=http://localhost:8080

and run it:

yarn dev

or build the project:

yarn build

jakt-playground's People

Contributors

sophiajt avatar surrealegg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jakt-playground's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.