LaTeX to online interactive materials.
If you want to install it on Windows, set 'Setting up a server on Windows' below.
-
Install
g++
,nodejs
andmongodb
on your computer (under Debian, may also neednodejs-legacy
package) -
Run an instance of mongo server:
mongod --dbpath <insert-your-path>
You may have to make the path. For example,
mkdir -p /tmp/data/db
mongod --dbpath /tmp/data/db
-
Fetch and unpack the sample database Unpack the tarball:
tar xfzv database.tar.gz
This creates a directory containing BSON and JSON files
-
Import the database into mongo:
mongorestore <path-to-db-directory-with-BSON-files>
-
Clone the repository:
git clone https://github.com/kisonecat/ximera
-
Create file
env.sh
with content:export XIMERA_MONGO_URL=127.0.0.1 export XIMERA_MONGO_DATABASE=test export XIMERA_COOKIE_SECRET=thisismysecretcookieyoushouldchangethis export COURSERA_CONSUMER_KEY=thisisacourserakey export COURSERA_CONSUMER_SECRET=courserasecretkey export LTI_KEY=myltikey export LTI_SECRET=myltisecret export GITHUB_WEBHOOK_SECRET=githubwebhooksecret
Type source env.sh
to execute those commands
Note that if you used a different database name, you should set XIMERA_MONGO_DATABASE to the name of your database.
-
Go into the
ximera
directory within thekisonecat
repository and usenpm
to install all other js scripts needed by the servercd <path-to-ximera> npm install (you may be required to answer a prompt or two)
You might have to install bower by running the following commands
node ./node_modules/bower/bin/bower install
cd ./components/mathquill
npm install
cd ../..
mkdir -p components/syntaxhighlighter/amd
node node_modules/requirejs/bin/r.js -convert components/syntaxhighlighter/scripts components/syntaxhighlighter/amd
-
Run the
ximera
serverapps.js
using:node app.js
-
View the
ximera
server in your web browser atlocalhost:3000
Before we get started, I must inform that I implemented a portable version of the server. You may need to make minor variations to the environment variables if you install it formally (meaning into the Windows registry).
-
Download the necessary programs.
- Download nodejs. I downloaded the Windows binary (.exe) version into my working directory. Choose 32-bit or 64-bit based on your system.
- Download mongodb. I downloaded the
zip
version portable version and decompressed it into a subfolder of my working directory, rather than themsi
installer. - Download the most recent version of npm and decompress it.
- Download the sample database. It will be a
.tar.gz
file. You will need to decompress it. I good utility to use is 7zip. This will create a folder calledtest
which should contain a bunch of.BSON
and.JSON
files.
-
Clone the ximera server repository by running
git clone https://github.com/kisonecat/ximera
in the command prompt in your working directory. An easy way to get to the command prompt from the windows file explorer is to hold down Shift and right click on the folder and select 'Open command window here'. -
Make a batchfile with the following lines.
:: change to wherever node.exe resides. Use %~dp0 for the path of the location of this batch file. SET NodejsPath=%~dp0 :: change to whereever npm.cmd resides. SET NPMPath=%~dp0 :: This is the folder where the mongod.exe file lives, within the mongdb directory. %~dp0 heads it off because it is a subfolder of %~dp0. SET MongoDBPath=%~dp0mongodb-win32-x86_64-2008plus-2.6.3\bin :: Implement these into the system path, for this session. SET Path=%path%%NodejsPath%;%NPMPath%;%MongoDBPath% SET XIMERA_MONGO_URL=127.0.0.1 SET XIMERA_MONGO_DATABASE=test SET XIMERA_COOKIE_SECRET=thisismysecretcookieyoushouldchangethis SET COURSERA_CONSUMER_KEY=thisisacourserakey SET COURSERA_CONSUMER_SECRET=courserasecretkey SET LTI_KEY=myltikey SET LTI_SECRET=myltisecret SET GITHUB_WEBHOOK_SECRET=githubwebhooksecret
-
Open the command window and run the following commands
- Run the batch file you created typing in the name of the batch file.
- Change to the ximera server folder:
cd ximera
- Run
npm install
to install all the other js scripts needed by the server. This will take a while. I get the error line:npm ERR! not ok code 0
. Just ignore it. - Run an instance of mongo as by running:
mongod --dbpath .
(dont forget the period)
-
Without closing that command window, open another one
- Run the batch file again.
- Import the test database into mongo by running:
mongorestore ./test/
, changing the path appropriately. The Windows UAC will pop up. You will need administrator access to bypass it. - Change to the ximera server folder:
cd ximera
- Run
app.js
:node app.js
. You will have another UAC pop up asking whether to give node public network access.
-
Open the browser and type in
localhost:3000
into the command line and you should get this:
The css files are missing (if you noticed, after you opened your browser, in the command window you got the error LESS file error : 'bootstrap.less' wasn't found
)