Skip to content

Commit 1424e11

Browse files
authored
Merge pull request #55 from aninternetof/development
Release v0.3
2 parents f56f5c8 + 03f14ff commit 1424e11

53 files changed

Lines changed: 956 additions & 258 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
include = rovercode_web/*
3-
omit = *migrations*, *tests*
2+
source = rovercode_web/, mission_control/
3+
omit = *migrations*, *tests*, *templates*, *static*
44
plugins =
55
django_coverage_plugin

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ node_modules/
6161
# User-uploaded media
6262
rovercode_web/media/
6363

64-
64+
# Testing output
65+
coverage.xml
66+
tests.xml
67+
.cache/
6568

6669
staticfiles/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "blockly"]
22
path = mission_control/static/blockly
33
url = https://github.com/aninternetof/blockly
4-
[submodule "closure-library"]
5-
path = mission_control/static/closure-library
6-
url = https://github.com/google/closure-library
74
[submodule "JS-Interpreter"]
85
path = mission_control/static/JS-Interpreter
96
url = https://github.com/NeilFraser/JS-Interpreter

.prospector.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
strictness: veryhigh
2+
doc-warnings: true
3+
test-warnings: true
4+
5+
ignore-paths:
6+
- mission_control/static/
7+
- mission_control/migrations/
8+
- rovercode_web/users/
9+
- rovercode_web/contrib/
10+
- config/
11+
- docs/
12+
- manage.py
13+
14+
pep8:
15+
full: true
16+
17+
pep257:
18+
run: true
19+
disable:
20+
# 1 blank line required before class docstring
21+
- D203

.travis.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
sudo: true
22
before_install:
3-
- sudo apt-get update -qq
4-
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
5-
- sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev
6-
- sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip
7-
- sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev
8-
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
3+
- sudo apt-get update -qq
4+
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev
5+
xvfb
6+
- sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev
7+
libwebp-dev
8+
- sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv
9+
python-pip
10+
- sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev
11+
libreadline-dev
12+
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev
13+
wget curl llvm
14+
install:
15+
- pip install -r requirements/local.txt
16+
- pip install coveralls
17+
script:
18+
- py.test --cov-report=
19+
- prospector
20+
after_success:
21+
- coveralls
922
language: python
1023
python:
11-
- "3.5"
12-
24+
- '3.5'
25+
deploy:
26+
- provider: codedeploy
27+
access_key_id: AKIAIZTZIW2KWAYZ6MUQ
28+
secret_access_key:
29+
secure: KTdHFUfomQvGqnulNo+K6IaVdl/WIuKvhvFNkXEfYOdfn4kWL0vf7F1aarhWN+Ptcj5QCiqpsa6KNi4U+f5J2K2xQUa4wZmQa1gLkw5l6Uaw9zbpbB3I4nywjGfNtPRKAwc8caQ80EaaSBHl3GsgJnTFszWkhWmY4k6bfvLLconLtRXFB07YS9mqwq6CvZ40RBiI2rUW1zgYGz6FRJhd0k/QGCqv3k+D3sPYad8/e3yapOhDTIFJESUMQt94rmg4n2gYBJMggk+aZ2yarSV7mr9Samf3HnGZ1VbONqsEH1rKlDsR9uT77udv8scryJDWlVyCAWpwr8y1Od2b6+VbWayWBY/xoPoeQLsQoReI6fzQy4fgk24F+Yxe5dxvSBkeil5Vq1yBKpBhxq53+Mto8mKTFXa0/6uNMD7JN+0kl6kbJVrIULhpd3/QYtF7DH2TYMhWsO0duGwz4k/IpsDMWddsIVrxCiaEKMKpD8ZY5WlV8Qun72/wlRaC557upK+LVJm89WntCEypoPEHNWYvzulVe0weWVlv89053ryP7rHa5PUwh8N0NLwI9dxAJ7WcgXjuiaZCtqLsbIXCpBOECstWFS8Kd/FS6Y3Tp4CRIN0Jt80BciKFV5HTyYWPsXnaFqNmt/PyRHkwgdIj4ULo2xLNAyXUQGS4RoPSdBVh9O4=
30+
revision_type: github
31+
application: beta-rovercode-web
32+
deployment_group: beta-rovercode-web
33+
on:
34+
repo: aninternetof/rovercode-web
35+
branch: development
36+
- provider: codedeploy
37+
access_key_id: AKIAIZTZIW2KWAYZ6MUQ
38+
secret_access_key:
39+
secure: KTdHFUfomQvGqnulNo+K6IaVdl/WIuKvhvFNkXEfYOdfn4kWL0vf7F1aarhWN+Ptcj5QCiqpsa6KNi4U+f5J2K2xQUa4wZmQa1gLkw5l6Uaw9zbpbB3I4nywjGfNtPRKAwc8caQ80EaaSBHl3GsgJnTFszWkhWmY4k6bfvLLconLtRXFB07YS9mqwq6CvZ40RBiI2rUW1zgYGz6FRJhd0k/QGCqv3k+D3sPYad8/e3yapOhDTIFJESUMQt94rmg4n2gYBJMggk+aZ2yarSV7mr9Samf3HnGZ1VbONqsEH1rKlDsR9uT77udv8scryJDWlVyCAWpwr8y1Od2b6+VbWayWBY/xoPoeQLsQoReI6fzQy4fgk24F+Yxe5dxvSBkeil5Vq1yBKpBhxq53+Mto8mKTFXa0/6uNMD7JN+0kl6kbJVrIULhpd3/QYtF7DH2TYMhWsO0duGwz4k/IpsDMWddsIVrxCiaEKMKpD8ZY5WlV8Qun72/wlRaC557upK+LVJm89WntCEypoPEHNWYvzulVe0weWVlv89053ryP7rHa5PUwh8N0NLwI9dxAJ7WcgXjuiaZCtqLsbIXCpBOECstWFS8Kd/FS6Y3Tp4CRIN0Jt80BciKFV5HTyYWPsXnaFqNmt/PyRHkwgdIj4ULo2xLNAyXUQGS4RoPSdBVh9O4=
40+
revision_type: github
41+
application: rovercode-web
42+
deployment_group: rovercode-web
43+
on:
44+
repo: aninternetof/rovercode-web
45+
branch: master

README.rst

Lines changed: 33 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,49 @@
1-
Rovercode Web
2-
=============
1+
.. .. image:: http://localhost:8000/static/images/screenshot.jpg
2+
.. image:: https://rovercode.com/static/images/screenshot.jpg
33

4-
Block-based programming for educational robots.
4+
rovercode
5+
=============
6+
rovercode-web
7+
-------------
58

9+
:License: GPLv3
10+
.. image:: https://img.shields.io/badge/chat-on%20Slack-41AB8C.svg?style=flat
11+
:target: http://chat.rovercode.com/
12+
.. image:: https://img.shields.io/badge/join-mailing%20list-yellow.svg?style=flat
13+
:target: http://rovercode.org/cgi-bin/mailman/listinfo/developers
614
.. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg
7-
:target: https://github.com/pydanny/cookiecutter-django/
8-
:alt: Built with Cookiecutter Django
15+
:target: https://github.com/pydanny/cookiecutter-django/
16+
:alt: Built with Cookiecutter Django
17+
.. image:: https://api.travis-ci.org/aninternetof/rovercode-web.svg
18+
:target: https://travis-ci.org/aninternetof/rovercode-web
19+
.. image:: https://coveralls.io/repos/github/aninternetof/rovercode-web/badge.svg?branch=development
20+
:target: https://coveralls.io/github/aninternetof/rovercode-web?branch=deveopment
921

22+
rovercode is easy-to-use package for controlling robots (rovers) that can sense and react to their environment. The Blockly editor makes it easy to program and run your bot straight from your browser. Just drag and drop your commands to drive motors, read values from a variety of supported sensors, and see what your rover sees with the built in webcam viewer.
23+
rovercode runs on any single-board-computer supported by the `Adafruit Python GPIO wrapper library <https://github.com/adafruit/Adafruit_Python_GPIO>`_, including the NextThingCo CHIP, Raspberry Pi, and BeagleBone Black. Once installed, just connect to your rover and get started.
1024

11-
:License: GPLv3
12-
25+
**rovercode is made up of two parts.** rovercode-web (this repo) is the web app that is hosted on the Internet. rovercode (`a different repo <https://github.com/aninternetof/rovercode>`_) is the service that runs on the rover.
1326

14-
Settings
15-
--------
27+
Setup
28+
-----
29+
Install `docker <https://docs.docker.com/engine/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_, then
1630

17-
Moved to settings_.
31+
.. code-block:: bash
1832
19-
.. _settings: http://cookiecutter-django.readthedocs.io/en/latest/settings.html
33+
$ git clone --recursive https://github.com/aninternetof/rovercode-web.git && cd rovercode-web
34+
$ sudo docker-compose -f dev.yml build
35+
$ sudo docker-compose -f dev.yml up
36+
$ google-chrome localhost:8000
2037
2138
Basic Commands
2239
--------------
40+
rovercode-web runs is built with Django. During development, you can do regular Django things like this:
2341

24-
Setting Up Your Users
25-
^^^^^^^^^^^^^^^^^^^^^
26-
27-
* To create a **normal user account**, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
28-
29-
* To create an **superuser account**, use this command::
30-
31-
$ python manage.py createsuperuser
32-
33-
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
34-
35-
Test coverage
36-
^^^^^^^^^^^^^
37-
38-
To run the tests, check your test coverage, and generate an HTML coverage report::
39-
40-
$ coverage run manage.py test
41-
$ coverage html
42-
$ open htmlcov/index.html
43-
44-
Running tests with py.test
45-
~~~~~~~~~~~~~~~~~~~~~~~~~~
46-
47-
::
48-
49-
$ py.test
50-
51-
Live reloading and Sass CSS compilation
52-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53-
54-
Moved to `Live reloading and SASS compilation`_.
55-
56-
.. _`Live reloading and SASS compilation`: http://cookiecutter-django.readthedocs.io/en/latest/live-reloading-and-sass-compilation.html
57-
58-
42+
.. code-block:: bash
5943
44+
$ docker-compose -f dev.yml run django python manage.py migrate
45+
$ docker-compose -f dev.yml run django python manage.py createsuperuser
6046
61-
Email Server
62-
^^^^^^^^^^^^
63-
64-
In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server `MailHog`_ with a web interface is available as docker container.
65-
66-
.. _mailhog: https://github.com/mailhog/MailHog
67-
68-
Container mailhog will start automatically when you will run all docker containers.
69-
Please check `cookiecutter-django Docker documentation`_ for more details how to start all containers.
70-
71-
With MailHog running, to view messages that are sent by your application, open your browser and go to ``http://127.0.0.1:8025``
72-
73-
74-
75-
76-
Sentry
77-
^^^^^^
78-
79-
Sentry is an error logging aggregator service. You can sign up for a free account at https://sentry.io/signup/?code=cookiecutter or download and host it yourself.
80-
The system is setup with reasonable defaults, including 404 logging and integration with the WSGI application.
81-
82-
You must set the DSN url in production.
83-
84-
85-
Deployment
86-
----------
87-
88-
The following details how to deploy this application.
89-
90-
91-
92-
Docker
93-
^^^^^^
94-
95-
See detailed `cookiecutter-django Docker documentation`_.
47+
If anything gives you trouble, see the detailed `cookiecutter-django Docker documentation`_.
9648

9749
.. _`cookiecutter-django Docker documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html
98-
99-

appspec.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 0.0
2+
os: linux
3+
files:
4+
- source: /
5+
destination: /home/ubuntu/rovercode-web
6+
hooks:
7+
BeforeInstall:
8+
- location: deploy-scripts/remove_prev_install.sh
9+
AfterInstall:
10+
- location: deploy-scripts/clone_subrepos.sh
11+
- location: deploy-scripts/rename_app.sh
12+
- location: deploy-scripts/create_env.sh
13+
- location: deploy-scripts/change_ownership.sh
14+
ApplicationStart:
15+
- location: deploy-scripts/start_app.sh

config/settings/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@
4040
'allauth', # registration
4141
'allauth.account', # registration
4242
'allauth.socialaccount', # registration
43+
'rest_framework',
4344
)
4445

4546
# Apps specific for this project go here.
4647
LOCAL_APPS = (
4748
# custom users app
4849
'rovercode_web.users.apps.UsersConfig',
4950
# Your stuff: custom apps go here
51+
'mission_control.apps.MissionControlConfig'
5052
)
5153

5254
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps

config/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
url(r'^accounts/', include('allauth.urls')),
2222

2323
# Your stuff: custom urls includes go here
24-
url(r'^mission-control/', include('mission_control.urls')),
24+
url(r'^mission-control/', include('mission_control.urls', namespace='mission-control')),
2525

2626
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
2727

deploy-scripts/change_ownership.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
chown -R ubuntu:ubuntu /home/ubuntu/rovercode-web

0 commit comments

Comments
 (0)