All Projects → RocketChat → Rocket.Chat.Apps-engine

RocketChat / Rocket.Chat.Apps-engine

Licence: MIT license
The Rocket.Chat Apps engine and definitions.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Rocket.Chat.Apps-engine

Material Design Data
关于 Material Design 的一切资料都在这里
Stars: ✭ 1,857 (+1963.33%)
Mutual labels:  apps
Ionic Starter Template
Reinventing the wheel, again! Sorry Ionic Team... but there are many newbies learning on Youtube!
Stars: ✭ 208 (+131.11%)
Mutual labels:  apps
privacysec
I don't have anything to hide, but I don't have anything to show you either.
Stars: ✭ 110 (+22.22%)
Mutual labels:  apps
Cleanandroidcookbook
Set of Clean Android recipes using Kotlin, Dagger, RxJava, Databinding. Goes along with series of articles "Keep Your Droid Clean"
Stars: ✭ 160 (+77.78%)
Mutual labels:  apps
Purrge
🐱 Quickly purrge android apps from your phone
Stars: ✭ 184 (+104.44%)
Mutual labels:  apps
Ios Signer Service
✒ A self-hosted, cross-platform service to sign and install iOS apps, all without a computer
Stars: ✭ 200 (+122.22%)
Mutual labels:  apps
App Talk
Let iOS apps talk - A user contributable directory of iOS apps with x-callback-urls.
Stars: ✭ 136 (+51.11%)
Mutual labels:  apps
neft
Universal Platform
Stars: ✭ 34 (-62.22%)
Mutual labels:  apps
Flutterexampleapps
[Example APPS] Basic Flutter apps, for flutter devs.
Stars: ✭ 15,950 (+17622.22%)
Mutual labels:  apps
Fossapps
Fossapps has been abandoned and replaced by Fossapps Creator.
Stars: ✭ 13 (-85.56%)
Mutual labels:  apps
Cloneapp
📦Easily Backup & Restore Windows Programs Settings
Stars: ✭ 163 (+81.11%)
Mutual labels:  apps
Light dark toggle
An awesome flutter app which artistically animates light and dark mode 😍
Stars: ✭ 175 (+94.44%)
Mutual labels:  apps
Quark Electron
Quark is a cross-platform, integrated development environment for rapidly building - functional , prototypal projects, written in HTML, CSS and JavaScript with native desktop app like capabilities.
Stars: ✭ 224 (+148.89%)
Mutual labels:  apps
Stacks
Stacks ecosystem overview.
Stars: ✭ 1,921 (+2034.44%)
Mutual labels:  apps
gh-token
Create an installation access token for a GitHub app from your terminal 💻
Stars: ✭ 154 (+71.11%)
Mutual labels:  apps
Appstore
🏪 App Store for Nextcloud
Stars: ✭ 149 (+65.56%)
Mutual labels:  apps
Stacks Blockchain
The Stacks 2.0 blockchain implementation
Stars: ✭ 2,549 (+2732.22%)
Mutual labels:  apps
opendatanetwork.com
The Open Data Network
Stars: ✭ 18 (-80%)
Mutual labels:  apps
MADBike
This is the public repository of the MADBike app for iOS. Public bike rental service for BiciMAD.
Stars: ✭ 23 (-74.44%)
Mutual labels:  apps
Django
The Web framework for perfectionists with deadlines.
Stars: ✭ 61,277 (+67985.56%)
Mutual labels:  apps

Thoughts While Working (for docs)

  • Apps which don't provide a valid uuid4 id will be assigned one, but this is not recommended and your App should provide an id
  • The language strings are only done on the clients (TAPi18next.addResourceBundle(lang, projectName, translations);)
  • The implementer of this should restrict the server setting access and environmental variables. Idea is to allow the implementer to have a default set of restricted ones while letting the admin/owner of the server to restrict it even further or lift the restriction on some more. Simple interface with settings and checkbox to allow/disallow them. 🤔

What does the Apps-Engine enable you to do?

The Apps-Engine is Rocket.Chat's plugin framework - it provides the APIs for Rocket.Chat Apps to interact with the host system.

Currently, a Rocket.Chat App can:

  • Listen to message events
    • before/after sent
    • before/after updated
    • before/after deleted
  • Listen to room events
    • before/after created
    • before/after deleted
  • Send messages to users and livechat visitors
  • Register new slash commands
  • Register new HTTP endpoints

Some features the Engine allows Apps to use:

  • Key-Value Storage system
  • App specific settings

Development environment with Rocket.Chat

When developing new functionalities, you need to integrate the local version of the Apps-Engine with your local version of Rocket.Chat.

First of all, make sure you've installed all required packages and compiled the changes you've made to the Apps-Engine, since that is what Rocket.Chat will execute:

npm install
npm run compile

Now, you need to setup a local Rocket.Chat server, so head to the project's README for instructions on getting started (if you haven't already). Make sure to actually clone the repo, since you will probably need to add some code to it in order to make your new functionality work.

After that, cd into Rocket.Chat folder and run:

meteor npm install PATH_TO_APPS_ENGINE

Where PATH_TO_APPS_ENGINE is the path to the Apps-Engine repo you've cloned.

That's it! Now when you start Rocket.Chat with the meteor command, it will use your local Apps-Engine instead of the one on NPM :)

Whenever you make changes to the engine, run npm run compile again - meteor will take care of restarting the server due to the changes.

Troubleshooting

  1. Sometimes, when you update the Apps-Engine code and compile it while Rocket.Chat is running, you might run on errors similar to these:
Unable to resolve some modules:

  "@rocket.chat/apps-engine/definition/AppStatus" in
/Users/dev/rocket.chat/Rocket.Chat/app/apps/client/admin/helpers.js (web.browser)

If you notice problems related to these missing modules, consider running:

  meteor npm install --save @rocket.chat/apps-engine

Simply restart the meteor process and it should be fixed.

  1. Sometimes when using meteor npm install PATH_TO_APPS_ENGINE will cause the following error :-
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path PATH_TO_ROCKETCHAT/node_modules/.staging/@rocket.chat/apps-engine-c7135600/node_modules/@babel/code-frame
npm ERR! dest PATH_TO_ROCKETCHAT/node_modules/.staging/@babel/code-frame-f3697825
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename 'PATH_TO_ROCKETCHAT/node_modules/.staging/@rocket.chat/apps-engine-c7135600/node_modules/@babel/code-frame' -> 'PATH_TO_ROCKETCHAT/node_modules/.staging/@babel/code-frame-f3697825'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

Here PATH_TO_ROCKETCHAT is the path to the main rocketchat server repo in your system To correct this we reinstall the package once again deleting the previous package

~/Rocket.Chat$ rm -rf node_modules/@rocket.chat/apps-engine
~/Rocket.Chat$ cd PATH_TO_APP_ENGINE
~/Rocket.Chat.Apps-engine$ npm install
~/Rocket.Chat.Apps-engine$ cd PATH_TO_ROCKETCHAT
~/Rocket.Chat$ meteor npm install ../Rocket.Chat.Apps-engine

Implementer Needs to Implement:

  • src/server/storage/AppStorage
  • src/server/storage/AppLogStorage
  • src/server/bridges/*

Testing Framework:

Makes great usage of TypeScript and decorators: https://github.com/alsatian-test/alsatian/wiki

  • To run the tests do: npm run unit-tests
  • To generate the coverage information: npm run check-coverage
  • To view the coverage: npm run view-coverage

Rocket.Chat Apps TypeScript Definitions

Handlers

Handlers are essentially "listeners" for different events, except there are various ways to handle an event. When something happens there is pre and post handlers. The set of pre handlers happens before the event is finalized. The set of post handlers happens after the event is finalized. With that said, the rule of thumb is that if you are going to modify, extend, or change the data backing the event then that should be done in the pre handlers. If you are simply wanting to listen for when something happens and not modify anything, then the post is the way to go.

The order in which they happen is:

  • PreEventPrevent
  • PreEventExtend
  • PreEventModify
  • PostEvent

Here is an explanation of what each of them means:

  • Prevent: This is ran to determine whether the event should be prevented or not.
  • Extend: This is ran to allow extending the data without being destructive of the data (adding an attachment to a message for example).
  • Modify: This is ran and allows for destructive changes to the data (change any and everything).
  • PostEvent: Is mostly for simple listening and no changes can be made to the data.

Generating/Updating Documentation

To update or generate the documentation, please commit your changes first and then in a second commit provide the updated documentation.

Engage with us

Share your story

We’d love to hear about your experience and potentially feature it on our Blog.

Subscribe for Updates

Once a month our marketing team releases an email update with news about product releases, company related topics, events and use cases. Sign Up!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].