Giter Site home page Giter Site logo

dmulxw / openim-electron-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openimsdk/openim-electron-demo

0.0 0.0 0.0 53.75 MB

Instant Messaging web、desktop

Home Page: https://openim.io

License: Apache License 2.0

Shell 0.02% JavaScript 39.96% TypeScript 58.54% HTML 0.08% SCSS 1.39%

openim-electron-demo's Introduction

OpenIM Electron Demo 💬💻

OpenIM DocsOpenIM Serveropenim-sdk-wasmopenim-sdk-core


OpenIM Electron Demo is an open-source instant messaging application built on OpenIM SDK Wasm, OpenIM Server, and Electron. It demonstrates how to quickly integrate instant messaging capabilities into any web app using OpenIM.

Tech Stack 🛠️

Live Demo 🌐

Give it a try at https://web-enterprise.rentsoft.cn.

Dev Setup 🛠️

It is recommended to use version 16.x-18.x.

Follow these steps to set up a local development environment:

  1. Run npm install to install all dependencies.
  2. Modify the request address to your own OpenIM Server IP in the following files:

    Note: You need to deploy OpenIM Server first, the default port of OpenIM Server is 10001, 10002, 10008.

    • src/utils/open_im_sdk_wasm/api/config.js
      export const WS_URL = "ws://your-server-ip:10001";
      export const API_URL = "http://your-server-ip:10002";
      export const USER_URL = "http://your-server-ip:10008";
  3. Run npm run dev to start the development server. Visit http://localhost:5173 to see the result. An Electron application will be launched by default.
  4. Start development! 🎉

Build 🚀

This project allows building web applications and Electron applications separately, but there will be some differences during the build process.

Web Application

  1. Replace the contents of the package_build_web.json file with package.json, removing dependencies required for Electron to run. Also, modify the build script.
  2. Run the following command to build the web application:
    npm run build
  3. The build result will be located in the dist folder.

Electron Application

  1. Replace the contents of the package_build.json file with package.json, keeping only the dependencies required for Electron to function. This significantly reduces the package size. Also, modify the packaging script.
  2. Update the path for wasm import in the utils/open_im_sdk_wasm/api/database/instance.js file:
    - SQL = await initSqlJs({ locateFile: () => '/sql-wasm.wasm' });
    + SQL = await initSqlJs({ locateFile: () => '../sql-wasm.wasm' });
  3. Run one of the following commands to build the Electron application:
    • macOS:
      npm run build:mac
    • Windows:
      npm run build:win
    • Linux:
      npm run build:linux
  4. The build result will be located in the package folder.

Community 👥

Community Meetings 📆

We want anyone to get involved in our community and contributing code, we offer gifts and rewards, and we welcome you to join us every Thursday night.

Our conference is in the OpenIM Slack 🎯, then you can search the Open-IM-Server pipeline to join

We take notes of each biweekly meeting in GitHub discussions, Our historical meeting notes, as well as replays of the meetings are available at Google Docs 📑.

Who are using OpenIM 👀

Check out our user case studies page for a list of the project users. Don't hesitate to leave a 📝comment and share your use case.

License 📄

OpenIM is licensed under the Apache 2.0 license. See LICENSE for the full license text.

openim-electron-demo's People

Contributors

bloomingg avatar lgz5689 avatar kubbot avatar skiffer-git 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.