Coder Social home page Coder Social logo

zollillo / cohesion-catalyst Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 1.41 MB

Repository for the Cohesion Catalyst project that aims to visualize multicollectivity with the help of Meteor and D3.

Home Page: https://zollillo.github.io/cohesion-catalyst/

JavaScript 94.24% CSS 1.73% HTML 4.03%

cohesion-catalyst's Introduction

cohesion-catalyst

Cohesion Catalyst is a web application aimed at visualizing multicollectivity.
Developed as part of the IFAF-funded research project C.Cat - Cohesion Catalyst.
For more information about the project and the application ๐Ÿ‘‰ zollillo.github.io/cohesion-catalyst

Requirements: Meteor version 1.2.1.

License

This work is released under the GNU General Publice License, version 3.

Table of Contents

  1. Project structure ๐Ÿ“
  2. Local configuration ๐Ÿ”ง
  3. Initial data ๐Ÿ‘ถ
  4. Some notes on deployment ๐Ÿš€
  5. Working with Docker ๐Ÿณ

Project structure

The cohesion-catalyst project consists of two Meteor apps that share the same MongoDB database. Furthermore, the two applications use the same private (i.e. unpublished) Meteor package that provides common collections and schema definitions. We use Meteor Up X to deploy both apps to our own server.

The project structure is as follows:

  • /app - the main application for regular users
  • /admin - an admin app for users with admin rights who can control the content in the database.
  • /global-packages - location of private Meteor packages

Local configuration

In order to let the two applications share the same database and private packages, you need to configure the environment. Since the private packages are located outside of the two application contexts, you need to make it available to Meteor's package manager via the environment variable PACKAGE_DIRS. For the admin app the environment variable MONGO_URL needs to be set such that it points to the main application database instance. Additionally, it is required to change the port the admin app listens on.

Setting PACKAGE_DIRS

You need to export (i.e. add) the environment variable PACKAGE_DIRS to your shell and set it to point to the location of the shared packages.

To accomplish this, add the following to the .bashrc file in your home directory:

# Set environment variable to locate shared private packages used with Meteor
export PACKAGE_DIRS="~/path/to/coca-project/global-packages"

Setting MONGO_URL

When you are developing on your local machine and whenever you start the apps locally, run the main app first, then set the MONGO_URL environment variable for the admin app right before you start it:

  1. From the command line, inside the main /app directory, start the app and the MongoDB driver with the usual command:
  $ meteor
  1. Since MongoDB is listening on port 3001 you can then specify the MONGO_URL environment variable for the admin app and set a different port on start using the --port flag.
    So, in another shell, from inside your /admin app directory use the following commands:
  $ MONGO_URL=mongodb://localhost:3001/meteor meteor --port 3100

Initial data

On first-time run of the app (or after a reset), the collections in the database are empty, and we create some initial data. For example, to access the admin app an admin user is created and stored in the database. Their username is [email protected], and the password is password.

Some notes on deployment

In order to use Meteor Up X to deploy both apps you have to create two separate Meteor Up projects in separate directories, each of which containing the specific mup.json file for each app.

As is the case locally configuring the environment applies for deployment as well.

Required environment variables for the main app:

  • PORT
  • ROOT_URL
  • PACKAGE_DIRS

Required environment variables for the admin app:

  • PORT
  • ROOT_URL
  • PACKAGE_DIRS
  • MONGO_URL

Note:

  • The admin app should not install MongoDB, so you set "setupMongo": false in the mup.json file associated with the admin app.
  • PACKAGE_DIRS also needs to be exported in ~/.bashrc on the server. Otherwise, the following error occurs:
    error: unknown package in top-level dependencies: coca:common

Meteor UP X issue

Although setting MONGO_URL in the admin app's mup.json to point to the main application database, the deployment of the admin app fails because connecting to mongodb:27017 fails.

It seems to be a known issue and a workaround fix can be found in this comment.

Working with Docker

To get access to the deployed apps you need to work with the Docker CLI. Therefore, you need to login as root user.

E.g., for inspecting the running containers use:

$ docker ps

To get access to the log files of the main application that are written to the $HOME directory run the following command (logged in as root)

docker exec -it ccat-app bash

where ccat-app is the name of the running application container (use docker ps if you don't know the name). After that, cd into the home directory where you will find the ccat-log directory.

See also the information given on the MUP X project page about accessing MongoDB.

cohesion-catalyst's People

Contributors

hschirmacher avatar zollillo avatar

Watchers

 avatar  avatar

Forkers

chmac

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.