GithubHelp home page GithubHelp logo

sophiebits / rmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uwflow/rmc

0.0 2.0 0.0 38.66 MB

Flow is a website that lets you plan courses with friends.

Home Page: http://uwflow.com

License: MIT License

Python 18.74% Shell 1.61% JavaScript 66.61% Ruby 0.06% CSS 12.99%

rmc's Introduction

Flow

Plan your courses

Getting up and running

To set up your dev environment, run make install.

We work inside a virtualenv, so remember to source ~/.virtualenv/rmc/bin/activate whenever you're working within the repo.

You should now be ready to boot the local server, with make local.

Once it starts running, point your browser to http://localhost:5000/

Getting seed data

Run the following to get some basic course data into the DB.

make init_data

Why RMC?

It might seem funny that this repository and a bunch of the code references rmc.

RMC stands for "Rate My Courses", which was the prototype name for this project before it was given the (slightly) better name of Flow.

Because of the profileration of this 3 letter prefix throughout the code, and the unfortunate coupling of the repository name and our python namespace, we decided to leave it be.

Directory structure

If you're eager to dive into the code, you might want to read this first. This isn't exhaustive, but it should be enough to get you started if you want to contribute.

  • config/: Configuration for frameworks, databases, or anything that might vary between the development environment and production.
  • data/: This is where we collect data and load it into the database
    • crawler.py downloads data by scraping pages and hitting APIs
    • processor.py processes the data grabbed by crawler.py and loads it into the DB
    • aggregator.py is run on a regular schedule (daily for the most part) to keep our data up to date
  • models/: "Schema" definitions for our models backed by MongoEngine
  • server/: Request handlers, static assets, and templates
    • templates/: Jinja2 templates
      • Files in here ending with _page.html (e.g. course_page.html) are rendered directly by the Flask server with render_template calls, with the exception of the base_*_page.html files which other _page.html templates inherit from.
      • Most of the other files (e.g. course.html) contain Underscore templates used to render stuff on the client-side
    • static: Static assets eventually ending up as files served directly by nginx when on production
      • js: All our JavaScript code, organized into RequireJS modules
        • ext/: All third party JavaScript code
        • main.js: The entry point for JavaScript executing on page load
      • sass: We don't write CSS directly for Flow, we use the SCSS flavor of Sass, which compiles down to CSS
    • server.py: The majority of the request handlers for the application, written in Flask

Using the REPL

If you need a REPL to fool around with the database or test out some code, check out tools/devshell.py.

It automatically loads some imports and connects to the database for you. This setup code can be found in tools/devshell_eval.py.

Here's what an example session might look like:

$ tools/devshell.py
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
Type "copyright", "credits" or "license" for more information.

IPython 0.13.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: m.User.objects(first_name__in=['Jamie', 'David', 'Sandy', 'Mack'],
last_name__in=['Wong', 'Hu', 'Duan', 'Wu'])
Out[1]: [<User: David Hu>, <User: Mack Duan>, <User: Sandy Wu>, <User: Jamie Wong>]

Running tests

To run all the tests in the entire system:

make alltest

To run all the tests except the really slow ones (namely Selenium tests):

make test

To run all the tests under a specific directory tree or in a specific file:

PYTHONPATH=.. nosetests server/api
PYTHONPATH=.. nosetests server/api/v1_test.py

Contributing

When you're ready to contribute, take a look at the contributing guidelines and our style guide.

If you have questions or would like to discuss how to contribute, come chat with us in our public chat room.

rmc's People

Contributors

divad12 avatar gabrielwong avatar jlfwong avatar jswu avatar kartiktalwar avatar klistwan avatar mario54 avatar mduan avatar pushrax avatar yingted avatar

Watchers

 avatar  avatar

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.