Skip to content
mlent edited this page Nov 14, 2014 · 2 revisions

Core Technologies

Backend

  • Nginx & uWSGI - serve both Python and static content.
  • Django & Postgres - Primary server-side application.
  • Django Tastypie - Powers the API, which serves data from both Postgres and Neo4j.
  • Neo4j - Stores our textual data.

Frontend

  • Backbone.js with Require - Each section of the website functions as a separate Backbone app, which load common dependencies, such as Models and Collections.
  • For other dependencies see package.json
  • Grunt for building CSS

Layers of Interaction

Templating

These ends first come together in templates/base.html. This file loads the Backbone.js app, sets some global variables needed for localization, and tells sub-templates which CSS file they should be loading.

All the other files directly in templates/ are included directly by the Django backend as declared in web/views.py. If you want to add a new server-level path, you need to edit this file as well as phaidra/urls.py, of course.

For frontend routing, you will find these paths in static/js/apps/. Which of these Backbone routers is included and activated depends on the base url of the currently loaded page. See static/js/main.js for the mappings.

Underscore templates, used by the Backbone app, are available in templates/js/. Generally speaking, the folder hierarchy in static/js/views/ and templates/js/ map to each other 1:1. You will have no trouble finding the underscore template you seek.

API

Textual Endpoints

The endpoints powered by Neo4j include:

  • /api/v1/document/ - List of available documents.
  • /api/v1/sentence/ - List of sentences.
  • /api/v1/word/ - List of words (requires at least one filter, e.g. ?lang=grc).

You will find the corresponding API Resource files for these endpoints in api/.

The textual API powers several parts of the application, including the Reader and the Lessons.

These API endpoints also map to Backbone collections and models, which are available in static/js/models/ and static/js/collections/, which the names you'd expect them to have.

Interaction Endpoints

  • /api/v1/submission/ - List of submissions a user has made.
  • /api/v1/visualization/ - Contains a number of subordinate endpoints for visualizing user knowledge.

These endpoints are used in the user interface to determine

Learning Content Endpoints

  • /api/v1/grammar/ - Grammar topics, as displayed on /lessons/ in the UI.
  • /api/v1/content/ - Learning content, parsed from Markdown into HTML.

These endpoints are used to construct the learning content in /lessons/ in the UI. In combination wit the Textual Endpoints, they are the primary driver of the learning section of the application.

User Endpoint

  • /api/v1/user/ - User information, including name, email, and languages they speak and are currently learning.

Developer Guide

Backend

Frontend

Content Guide

What did you break?

  • Postgres Database
  • Neo4j
  • Django
  • "The server"
  • Git
  • UI
Clone this wiki locally