Skip to content
Andrés G. Saravia edited this page Jul 16, 2013 · 8 revisions

In this wiki I intend to explain the implementation ideas behind this project. I want this to serve as a guide to the code and how to hack it.

General idea

I envisioned Research Engine to be a place in which I could record all my activities related to my current research and this involves many areas. Being a good researcher, in my opinion, involves not only working on specific problems but also attending meetings (and preparing talk to give in them), make a lot of teaching and have some public outreach. If you look at the top menu on the site you will find it mostly superfluous since it has only 3 items: Home, Projects and Login / User but I keep it because I have hope that in the future there's also a section for organizing your teaching, having some way of public outreach and any other tool that might be useful. For the moment, almost all the code in this project revolves around working on specific research problems in collaboration with other people. I call each one of these a Project.

I tend to have a separate source file for each (sub)section of the website. Inside each file you find first some global variables and utility functions, then Datastore definitions and then web handlers definitions.

In the [[generic.py | file:generic.py]] file I made some definitions that I think would be useful for any section of the site, being a project (the only implemented section so far) or something else; every section on the site depends of this file. Here you find the Datastore definintion for the users and some generic URL and Blobstore Handlers.

In the [[projects.py | file:projects.py]] file you will find definitions for handling things related to all areas of a Project so every section that has to do with a Project depends on this file. Those files are [[code.py | file:code.py]], [[collab_writing.py | file:collab_writting.py]], [[datasets.py | file:datasets.py]], [[forum.py | file:forum.py]], [[notebooks.py | file:notebooks.py]] and [[wiki.py | file:wiki.py]] each one representing a sidebar-menu option inside each project. Perhaps, if the code becomes bigger, I should throw all these files inside a folder to make clear they are all part of a single section on the site.

File structure

In the root of it you will find these files:

  • .gitignore: Things to be ignored by Git.
  • README.md: No need to explain.
  • app.yaml: Basic site configuration.
  • appengine_config.py: Patch to handle long file descriptions in the BlobstoreUploadHandler. See this issue
  • cron.yaml: Scheduled actions. For now it's just the daily email notifications.
  • indexes.yaml: Indexes to Datastore queries. It's generated automatically in the development server.
  • mail.py: Handle incoming email. Nothing useful here right now, I'm sorry to say.
  • main.py: The main app definition. Here you can find the mapping of URLs to webapp2 Handlers.

And some directories:

  • [[css/ | dir:css]]: Here you can find all the stylesheets used in the templates.
  • [[doc/ | dir:doc]]: For now just license and credits.
  • [[js/ | dir:js]]: Javascript definitions to be included in the templates.
  • [[lib/ | dir:lib]]: Third-party Python libraries used.
  • [[src/ | dir:src]]: All other Python source files for this project.
  • [[static/ | dir:static]]: Some static elements used in the site.
  • [[templates/ | dir:templates]]: The HTML Jinja templates.

To start understanding how the code works I suggest you look at the main.py file to see the URL to Handlers mappings and have a look at the same time at the [[src/ | dir:src]] page in this wiki.

Clone this wiki locally