SimonLoir / EdgeRunner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EdgeRunners

A mobile code editor that runs on touch based devices. It is built using React Native.

Getting Started

Start by cloning this repository on your local machine. In the project directory, run:

npm install

To install the dependencies using expo cli, run:

cd apps/app
npx expo install

Running the app in development mode

Android

npm run android

iOS

npm run ios

Project Structure

  • apps:
    • app: The main React Native app.
    • server: The server that runs the code.
  • packages: Shared code between the app and the server.
  • playground: A playground to test LSP features (contains an example for textDocument/semanticTokens).
  • projects: Contains projects that are used to test the app.

Server

The server is a simple Express server that runs the code. It uses tRPC to define the API routes.

Development

To start the server in dev mode, run:

cd apps/server
npm run dev

To start the server in dev mode using docker, run:

docker compose up

Production

To start the server in production mode using docker, run:

docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d

You can configure the domain name in the docker-compose.prod.yml file. You need to create a reverse proxy to forward the requests to the server.

In this case, we use Treafik as a reverse proxy :

version: '3'

services:
    reverse-proxy:
        restart: always
        # The official v2 Traefik docker image
        image: traefik:v2.9
        # Enables the web UI and tells Traefik to listen to docker
        command:
            - --api.insecure=true
            - --providers.docker
            - --entrypoints.http.address=:80
            - --entrypoints.https.address=:443
            - --certificatesresolvers.letsencrypt.acme.httpchallenge=true
            - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http
            # Don't forget to change the email address (or set the EMAIL_ADDRESS environment variable)
            - --certificatesresolvers.letsencrypt.acme.email=${EMAIL_ADDRESS}
            - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
        networks:
            - web
        ports:
            # The HTTP port
            - '0.0.0.0:80:80'
            - '0.0.0.0:443:443'
            - '0.0.0.0:8080:8080'
        volumes:
            # So that Traefik can listen to the Docker events
            - /var/run/docker.sock:/var/run/docker.sock
            - letsencrypt:/letsencrypt
        labels:
            # middleware redirect
            - traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
            # global redirect to https
            - traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)
            - traefik.http.routers.redirs.entrypoints=http
            - traefik.http.routers.redirs.middlewares=redirect-to-https
networks:
    web:
        external: true
volumes:
    letsencrypt:

You also need to create a network called web :

docker network create web

About

License:MIT License


Languages

Language:TypeScript 95.3%Language:JavaScript 1.7%Language:Kotlin 1.0%Language:Ruby 0.7%Language:Dockerfile 0.6%Language:Objective-C++ 0.6%Language:Objective-C 0.1%Language:Handlebars 0.0%Language:C 0.0%Language:Swift 0.0%Language:Prolog 0.0%Language:Python 0.0%Language:CSS 0.0%