GithubHelp home page GithubHelp logo

sebthedev / recal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from recalapp/recal

0.0 2.0 0.0 95.98 MB

First a COS 333 project, now a very popular tool at Princeton for course selection

Home Page: http://recal.io

License: MIT License

Shell 0.25% Python 27.58% JavaScript 4.96% CSS 32.06% TypeScript 22.16% Makefile 0.09% HTML 12.90%

recal's Introduction

Overview

ReCal is a course selection tool widely used at Princeton University.

Runbook

Initial setup

TODO

Updating for a new semester

Make a new branch, e.g. sp16 , then make the following changes to settings/common.py , landing, and status pages:

https://github.com/maximz/recal/commit/4dbc0684c132051cc4ed72dc7efae92a8b9949cd

Test out on test-recal:

git remote add dev https://git.heroku.com/test-recal.git
git push dev sp16:master
heroku run python manage.py course_selection_courses_init --app=test-recal
# heroku run python manage.py clear_cache --app=test-recal # not needed but may help

Test at test-recal.herokuapp.com.

If good, then add a message to the main page: https://github.com/maximz/recal/commit/8bc566f7b8cd45f351b90d4294bbebf883c22baa

Then merge sp16 into master , and deploy as follows:

git push origin master
git remote add prod https://git.heroku.com/newice.git
git push prod master
heroku run python manage.py course_selection_courses_init --app=newice

Then, test on recal.io. And bump number of dynos. Then send out emails.

Updating Buildpacks

If relying on the older Multipack Buildpack, which is now deprecated, update the buildpacks as present on the .buildpacks file:

heroku buildpacks:set -r dev https://github.com/heroku/heroku-buildpack-nodejs#v80
heroku buildpacks:add -r dev https://github.com/naphatkrit/recal-heroku-typescript-buildpack#v1
heroku buildpacks:add -r dev https://github.com/ejholmes/heroku-buildpack-bower
heroku buildpacks:add -r dev https://github.com/naphatkrit/heroku-buildpack-pdftk
heroku buildpacks:add -r dev https://github.com/heroku/heroku-buildpack-python#v57

Switch -r dev with -r prod if changing the production buildpacks.

Workflow

We will be using a rebase workflow. This is much easier for rollbacks, and since we are not open-sourced, we don't have to deal with pull requests.

Working on a New Feature

Use the following template.

git checkout -b fb1
# do your work here
...
# end of work
git fetch origin master:master # this is the same as `git checkout master && git pff && git checkout fb1`
git rebase -i master
git checkout master
git mff fb1

pull --ff-only and merge --ff-only

git pull does not always do the right thing, as it tries to merge. We never want merging, so I recommend adding the following aliases to your ~/.gitconfig:

[alias]
    ...
    pff = pull --ff-only
    mff = merge --ff-only
    ...

What if I Can't Fast-Forward on Master?

# on master
git fetch
git rebase origin/master

Dev Environment Setup

Installing Prerequisites

Heroku Toolbelt

ReCal uses Heroku. For testing, it is recommended to use Heroku's Foreman, as opposed to using Django's built-in testing web server. To get Foreman, install Heroku Toolbelt.

Environmental Variable

Copy the file .env_example into .env and fill in the appropriate variable. Then, execute it as a Bash script, or to make things easier, use autoenv.

Postgres

ReCal uses Postgres as its database. First, download Postgres. For Mac, the easiest thing is to install Postgres.app. Create an empty database for use with ReCal. Django will take care of the rest.

PIP

We use PIP to keep track of our required packages. First, install PIP. Optionally, but recommended, use virtualenv to keep ReCal's PIP packages separate from your other projects. On a Mac, also install virtualenvwrapper, which exposes a nice command-line interface. When you have everything setup, run the following:

pip install -r requirements.txt

You may also need to install PDFtk manually in order to successfully run the command above. PDFtk is a dependency for parsing PDF files in python, which we use for generating course enrollment worksheets.

Initial Setup

Django

We need to give django a chance to set up everything. To do that, run the script setup_database. Note that you must have your environmental variables set up correctly for this to work.

Static Assets

To install, compile, and collect static assets:

npm install
bin/compile_static

Running the Test Environment

Issue this command:

heroku local

You can now access the test environment at localhost:PORT, where PORT is the actual port number. By default, PORT is 5000.

collectstatic

Whenever you make changes to the static file, you must tell Django about it. To do that, run:

python manage.py collectstatic

If that fails, ignore the npm dependencies and run

python manage.py collectstatic -i node_modules

recal's People

Contributors

naphatkrit avatar dxue2012 avatar maximz avatar panchr avatar

Watchers

James Cloos avatar Sebastian Hallum Clarke 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.