Git Product home page Git Product logo

online_chat's Introduction

Online Chat

python实验,使用vue3作为前端,fastapi作为服务后端,socket.io作为实时通讯服务。

预览

预览1

预览2

在线预览

部署

前端

cd onlinechat
yarn install
yarn build

将打包好的dist文件夹放置于服务器上。

若想要部署的路径不为根路径,修改下面的baseurl为你自己的baseurl后再打包

/src/router/index.ts

const router = createRouter({
  // TODO: 部署时修改基本路径
  history: createWebHashHistory("/you/base/url"),
  routes,
});

后端

将backend复制到部署的服务器。

修改数据库连接:

/utils/database
SQLALCHEMY_DATABASE_URL = "you/database/url"

物理机部署

安装依赖:

pip install -r requirements.txt

运行:

uvicorn main:app --host 0.0.0.0 --port 8080

docker部署

建立image:

docker build -t onlinechat:env .

运行docker:

docker run -d \
	-p [port]:23456 \
	--name="onlinechat" \
	onlinechat:env

即可通过服务器ip:port访问(端口记得开安全组(•ω•`))

online_chat's People

Contributors

ling-yunchi avatar

Stargazers

 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.