GithubHelp home page GithubHelp logo

banana-boat / terryminal-be Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.81 MB

智能在线终端命令学习平台--后端

Dockerfile 1.71% Go 66.75% Makefile 8.84% Shell 4.71% TypeScript 11.36% Python 6.63%

terryminal-be's Introduction

Terryminal

一款在线终端命令学习平台!

  • 告别终端环境配置,浏览器环境开箱即用
  • AI机器人为你解答一切关于Linux命令的疑问

界面演示

1. 登录 / 注册

2. 控制台 / 终端窗口 / AI机器人

架构图

flowchart LR
  id_client(((Clients))) --HTTP--- id_main(Main Service\nAPI网关 / 鉴权\n用户相关 / 终端交互)
  id_client --Websocket--- id_main

  subgraph Terryminal Services
  id_main --gRPC--- id_chatbot(Chatbot Service\nAI机器人)
  id_main --Docker Engine API--- Docker
  end

  subgraph DataBase
  id_main -.- id_mysql[(Mysql DB)]
  id_chatbot -.- id_mysql
  id_main -.- id_redis[(Redis MQ)]
  end

  subgraph Docker
  id_main --gRPC--- id_bash(Pty Container\n内置Node服务)
  end

  subgraph 第三方API
  id_gpt(OpenAI ChatGPT3.5) --HTTP--- id_chatbot
  end
Loading

ER 图

erDiagram
    USER ||--o{ TERMINAL : own
    TERMINAL ||--|| TERMINAL_TEMPLATE : instantiated-from
    USER {
        int id PK
        string email UK "邮箱"
        string nickname "昵称"
        string password "密码"
        int chatbot_token "Chatbot服务剩余Token数"
        string verification_code "验证码"
        datetime expired_at "验证码过期时间"
        datetime created_at
        datetime updated_at
    }
    TERMINAL {
        string id PK "同Docker容器ID"
        string name UK "实例名称(同Docker容器名)"
        string size "Docker容器体积"
        string remark "用户备注"
        int owner_id FK "所有者ID"
        int template_id FK "模版ID"
        time total_duration "累计使用时长"
        datetime created_at
        datetime updated_at
    }
    TERMINAL_TEMPLATE {
        int id PK
        string name UK "模版名称"
        string image_name "Docker镜像名"
        string size "Docker镜像体积"
        string description "模版描述"
        datetime created_at
        datetime updated_at
    }


Loading

主要依赖

端口划分

为便于本地调试,划分不同服务所使用的端口,作以下规定:

  • main-service 端口范围:3200-3209
  • chatbot-service 端口范围:3210-3219
  • pty-docker 端口范围:3220-3229

接口文档

API 文档

服务端部署

  • 修改根目录下 compose.yaml 与 Makefile 相关信息

  • 应用容器化

    • 方法一:在服务器端拉取代码,执行make build_images,打包镜像
    • 方法二:本地执行make build_push_multi,打包多平台镜像并推至 hub
  • 服务端执行docker compose up -d

terryminal-be's People

Contributors

banana-boat avatar

Stargazers

Crescent avatar  avatar

Watchers

 avatar

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.