Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 2.23 KB

Readme.md

File metadata and controls

118 lines (84 loc) · 2.23 KB

Mediator

Table of Contents

Description

Run g++, swiftc, and bun from Telegram!

Topics

swift vapor typescript react docker

About

This bot accepts as input these properties from a user:

  1. language (e.g. C++);
  2. source (e.g. int main() { return 0; });
  3. arguments (e.g. --version);
  4. stdin (e.g. vladimir).

It processes these properties and sends back output of a program to the user.

Results

I can’t believe I am not even in the winners list.

Vladimir’s submission

Getting Started

1. Clone

$ git clone https://github.com/VladimirCreator/compiler_bot.git

2. Prepare .env

COMPILER_BOT_TOKEN=<YOUR_BOTS_TOKEN>
IHaveNotComeUpWithAName=<YOUR_MINI_APPS_URL>

3. Docker

$ docker compose up --detach

Backend

Important

It is required to specify the bot's token and the location of mini app to get this work.
See Getting Started for more information.

Dockerfile installs all required dependecies like g++1, swiftc2, and bun3.

Build

$ swift build --configuration release

Docker

$ docker run --detach --publish 8080:80

Frontend

Build

$ npm install; npm build

Docker

docker run --detach --publish 8080:80
  --volume dist:/usr/share/nginx/html:ro
  nginx

User Guide

Aspects to Improve

Backend

  1. Use a database;
  2. Fetch info from the database;
  3. Dockerfile.

Frontend

  1. Fetch languages from the backend;
  2. The /admin route where I can mutate the database.

Footnotes

  1. Makes possible to compile C++ files.

  2. Makes possible to compile Swift files.

  3. Makes possible to interpret JavaScript and TypeScript files.