adaptive-learning / flocs

Intelligent application for learning computer science.
GNU General Public License v2.0
1 stars 5 forks source link

Flow of Computer Science

Flocs is an intelligent web application for learning computer science, aiming at creating a flow experience. Flocs is developed by Adaptive Learning group at Faculty of informatics, Masaryk university.

Start working on the project

  1. Install Python 3, virtualenv, virtualenvwrapper and npm:

    $ sudo pacman -S python python-virtualenv python-virtualenvwrapper npm
  2. Install Grunt and Bower using npm:

    $ sudo npm install -g grunt-cli karma-cli bower
  3. Configure virtualenv and virtualenvwrapper by adding the following two lines in your ~/.bashrc:

    export WORKON_HOME=~/.virtualenvs
    source /usr/bin/virtualenvwrapper.sh

    Load the changes:

    $ source ~/.bashrc
  4. Clone the project repository:

    $ git clone https://github.com/effa/flocs.git
  5. Create virtual environment and bind it with the project directory:

    $ cd flocs
    $ mkvirtualenv flocs && setvirtualenvproject

    The name of the virtual environment (flocs) should now appear in front of the prompt.

  6. Install dependencies and initialize DB:

    $ make update

    The make update command uses pip, npm and bower to install both backend and frontend dependencies (including django and pylint) and it also sets up the database for development. (See Makefile for details.)

You can check that Django was installed correctly by command django-admin --version, which should output 1.8.2. You can deactivate the virtual environment by calling deactivate.

Workflow

  1. Start the virtual environment and jump to the project directory:

    $ workon flocs
  2. Pull the changes from the repository.

    $ git pull
  3. Update dependencies and database:

    $ make update
  4. Take a look at the code written by your friends (quick code review). Also look at the issues, documentation and diagrams to decide what feature you want to implement.

  5. Create and checkout a git branch for the implemented feature.

    $ git checkout -b name_of_the_feature
  6. Write unit tests for the implemented feature (and possibly integration tests as well). Check that the tests don't pass.

    $ make test
  7. Develop the feature. Enjoy it, experience the state of flow :-)

    • If you need a python console (with all models automatically imported), call:

      $ ./manage.py shell_plus

    • If you need a testing server, call:

      $ ./manage.py runserver

    • If you change data in fixtures and want to load them to the database:

      $ make db-load-data

    • If you change the data model, create and apply a migration:

      $ ./manage.py makemigrations $ ./manage.py migrate

    • If you are working on frontend, you need to start the testing server and run grunt work task to automatically apply all changes into a development build (concatenating html partials, JavaScript and CSS files, compiling index.html, etc.). This can be done by a single command:

      $ ./manage.py gruntserver

    • Take a regular breaks (e.g. after 25 minutes), stretch yourself (including your eyes).

  8. Test the implemented feature and check the code by pylint:

    $ make test
    $ make check
  9. Commit changes:

    $ git add changed_files
    $ git commit -m "Implement feature X"
  10. Merge the feature branch to the master branch:

    $ git checkout master
    $ git merge name_of_the_feature
  11. Push changes to the GitHub:

    $ git push
  12. Deactivate the virtual environment:

    $ deactivate
  13. Celebrate the developed feature with some physical exercise and healthy snack.

Additional recommendations