A chat app built with React and packaged as a Moodle local plugin.
PHP JavaScript Gherkin CSS HTML XSLT
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
admin Merge branch 'MDL-51109-29' of git://github.com/danpoltawski/moodle i… Sep 1, 2015
auth
availability
backup
badges
blocks Merge branch 'MDL-51148-29-enfix' of git://github.com/mudrd8mz/moodle… Aug 27, 2015
blog
cache
calendar
cohort
comment
completion
course
enrol
error MDL-49360 core_lib: add new method get_local_referer() Jul 27, 2015
files
filter MDL-33765 filter_glossary: fixed jshint warning Jun 29, 2015
grade
group MDL-50709 groups: Prevent XSS in grouping description Sep 8, 2015
install
iplookup
lang
lib
local
login MDL-50791 auth: add heading on signup form page Aug 31, 2015
message MDL-50880 message: correctly compare with empty string Aug 20, 2015
mnet
mod
my MDL-51062 behat: permission steps should work without js Aug 10, 2015
notes
pix
plagiarism MDL-39752 fix whitespace errors Mar 10, 2015
portfolio
question Merge branch 'MDL-51179-29' of git://github.com/damyon/moodle into MO… Sep 3, 2015
rating
report
repository MDL-51148 lang: Merge English strings from the en_fix language pack Aug 26, 2015
rss MDL-46463 core_rss: coding style cleanup in /rss Jul 23, 2014
tag
theme
user
userpix
webservice MDL-39353 xmlrpc: Add proxy support Jun 10, 2015
.csslintrc
.gitignore MDL-49840 testing: Stop ignoring composer.lock Apr 14, 2015
.jshintrc MDL-49046 javascript: Add support for AMD modules and jquery. Feb 23, 2015
.shifter.json
COPYING.txt license MDL-20717 Updated the COPYING file to GPLv3 for head Jan 8, 2010
Gruntfile.js MDL-50001 grunt: Make grunt work on windows May 5, 2015
README.md
TRADEMARK.txt MDL-20700 coding style cleanup - cvs keywords removed, closign php ta… Nov 1, 2009
behat.yml.dist MDL-37046 behat: Adding empty Behat config file Jan 29, 2013
brokenfile.php
composer.json
composer.lock
config-dist.php
draftfile.php
file.php MDL-48799 Files API: fixed legacy directory fallback. Feb 1, 2015
help.php MDL-48389 forms: added page title to help text Dec 9, 2014
help_ajax.php
index.php MDL-49689 navigation: Allow the user to set their homepage. Apr 13, 2015
install.php
mdeploy.php MDL-49087 mnet: Ensure typeroot is in dirroot Mar 3, 2015
mdeploytest.php MDL-49087 mnet: Ensure typeroot is in dirroot Mar 3, 2015
moodlereadme.txt
package.json
phpunit.xml.dist
pluginfile.php
screenshot.jpg
tags.txt
version.php Moodle release 2.9.2 Sep 12, 2015

README.md

moodle-react-demo

A chat app built with React and packaged as a Moodle local plugin.

Screenshot

Screenshot

Overview

The app is packaged as a Moodle local plugin in local/reactchat.

The back-end code is organized with Silex and containers two controllers (one for serving the front-end code and another for serving the RESTful API).

The moodle_service_provider (local/reactchat/providers) encapsulates all dealings with Moodle.

The chat_service_provider provides means to fetch and save chat messages.

On the front-end, Chat is the main react compoment which contains all code for communicating with the server. It includes two other compoments MessageForm and MessageList (MessageList in turn includes multiple Message compoments). The react components are located in local/reactchat/static/components.

The react components are written in JSX syntax. I have included the in-browser JSX transformer and have left-out certain usual functionality such as optimistic updates in order to keep the code as minimal and readable as possible.

This isn't intended for production usage, but as a quick demo and starting point for investigating React within Moodle.