diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 456751f..0000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react"] -} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 718f8e0..0000000 --- a/.editorconfig +++ /dev/null @@ -1,291 +0,0 @@ -root = true # top-most EditorConfig file - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -trim_trailing_whitespace = true -insert_final_newline = true -ij_wrap_on_typing = true -# tab_width = 4 -# ij_continuation_indent_size = 8 -# ij_formatter_off_tag = @formatter:off -# ij_formatter_on_tag = @formatter:on -# ij_formatter_tags_enabled = false -# ij_smart_tabs = false - -[{*.js,*.jsx,*.py,*.css}] -max_line_length = 100 - -[*.css] -# ij_css_align_closing_brace_with_properties = false -# ij_css_blank_lines_around_nested_selector = 1 -# ij_css_blank_lines_between_blocks = 1 -# ij_css_brace_placement = 0 -# ij_css_hex_color_long_format = false -# ij_css_hex_color_lower_case = false -# ij_css_hex_color_short_format = false -# ij_css_hex_color_upper_case = false -# ij_css_keep_blank_lines_in_code = 2 -# ij_css_keep_indents_on_empty_lines = false -# ij_css_keep_single_line_blocks = false -# ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow -# ij_css_space_after_colon = true -# ij_css_space_before_opening_brace = true -# ij_css_value_alignment = 0 - -[{*.pyw,*.py}] -# ij_python_align_collections_and_comprehensions = true -# ij_python_align_multiline_imports = true -# ij_python_align_multiline_parameters = true -# ij_python_align_multiline_parameters_in_calls = true -# ij_python_blank_line_at_file_end = true -# ij_python_blank_lines_after_imports = 1 -# ij_python_blank_lines_after_local_imports = 0 -# ij_python_blank_lines_around_class = 1 -# ij_python_blank_lines_around_method = 1 -# ij_python_blank_lines_around_top_level_classes_functions = 2 -# ij_python_blank_lines_before_first_method = 0 -# ij_python_dict_alignment = 0 -# ij_python_dict_new_line_after_left_brace = false -# ij_python_dict_new_line_before_right_brace = false -# ij_python_dict_wrapping = 1 -# ij_python_from_import_new_line_after_left_parenthesis = false -# ij_python_from_import_new_line_before_right_parenthesis = false -# ij_python_from_import_parentheses_force_if_multiline = false -# ij_python_from_import_trailing_comma_if_multiline = false -# ij_python_from_import_wrapping = 1 -# ij_python_hang_closing_brackets = false -# ij_python_keep_blank_lines_in_code = 1 -# ij_python_keep_blank_lines_in_declarations = 1 -# ij_python_keep_indents_on_empty_lines = false -# ij_python_keep_line_breaks = true -# ij_python_new_line_after_colon = false -# ij_python_new_line_after_colon_multi_clause = true -# ij_python_optimize_imports_always_split_from_imports = false -# ij_python_optimize_imports_case_insensitive_order = false -# ij_python_optimize_imports_join_from_imports_with_same_source = false -# ij_python_optimize_imports_sort_by_type_first = true -# ij_python_optimize_imports_sort_imports = true -# ij_python_optimize_imports_sort_names_in_from_imports = false -# ij_python_space_after_comma = true -# ij_python_space_after_number_sign = true -# ij_python_space_after_py_colon = true -# ij_python_space_before_backslash = true -# ij_python_space_before_comma = false -# ij_python_space_before_for_semicolon = false -# ij_python_space_before_lbracket = false -# ij_python_space_before_method_call_parentheses = false -# ij_python_space_before_method_parentheses = false -# ij_python_space_before_number_sign = true -# ij_python_space_before_py_colon = false -# ij_python_space_within_empty_method_call_parentheses = false -# ij_python_space_within_empty_method_parentheses = false -# ij_python_spaces_around_additive_operators = true -# ij_python_spaces_around_assignment_operators = true -# ij_python_spaces_around_bitwise_operators = true -# ij_python_spaces_around_eq_in_keyword_argument = false -# ij_python_spaces_around_eq_in_named_parameter = false -# ij_python_spaces_around_equality_operators = true -# ij_python_spaces_around_multiplicative_operators = true -# ij_python_spaces_around_power_operator = true -# ij_python_spaces_around_relational_operators = true -# ij_python_spaces_around_shift_operators = true -# ij_python_spaces_within_braces = false -# ij_python_spaces_within_brackets = false -# ij_python_spaces_within_method_call_parentheses = false -# ij_python_spaces_within_method_parentheses = false -# ij_python_use_continuation_indent_for_arguments = false -# ij_python_use_continuation_indent_for_collection_and_comprehensions = false -# ij_python_wrap_long_lines = true - -[{*.sht,*.html,*.shtm,*.shtml,*.htm,*.ng}] -# ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 -# ij_html_align_attributes = true -# ij_html_align_text = false -# ij_html_attribute_wrap = normal -# ij_html_block_comment_at_first_column = true -# ij_html_do_not_align_children_of_min_lines = 0 -# ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p -# ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot -# ij_html_enforce_quotes = false -# ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var -# ij_html_keep_blank_lines = 2 -# ij_html_keep_indents_on_empty_lines = false -# ij_html_keep_line_breaks = true -# ij_html_keep_line_breaks_in_text = true -# ij_html_keep_whitespaces = false -# ij_html_keep_whitespaces_inside = span,pre,textarea -# ij_html_line_comment_at_first_column = true -# ij_html_new_line_after_last_attribute = never -# ij_html_new_line_before_first_attribute = never -# ij_html_quote_style = double -# ij_html_remove_new_line_before_tags = br -# ij_html_space_after_tag_name = false -# ij_html_space_around_equality_in_attribute = false -# ij_html_space_inside_empty_tag = false -# ij_html_text_wrap = normal - -[{*.js,*.cjs}] -# ij_continuation_indent_size = 4 -# ij_javascript_align_imports = false -# ij_javascript_align_multiline_array_initializer_expression = false -# ij_javascript_align_multiline_binary_operation = false -# ij_javascript_align_multiline_chained_methods = false -# ij_javascript_align_multiline_extends_list = false -# ij_javascript_align_multiline_for = true -# ij_javascript_align_multiline_parameters = true -# ij_javascript_align_multiline_parameters_in_calls = false -# ij_javascript_align_multiline_ternary_operation = false -# ij_javascript_align_object_properties = 0 -# ij_javascript_align_union_types = false -# ij_javascript_align_var_statements = 0 -# ij_javascript_array_initializer_new_line_after_left_brace = false -# ij_javascript_array_initializer_right_brace_on_new_line = false -# ij_javascript_array_initializer_wrap = off -# ij_javascript_assignment_wrap = off -# ij_javascript_binary_operation_sign_on_next_line = false -# ij_javascript_binary_operation_wrap = off -# ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**/*,@angular/material,@angular/material/typings/** -# ij_javascript_blank_lines_after_imports = 1 -# ij_javascript_blank_lines_around_class = 1 -# ij_javascript_blank_lines_around_field = 0 -# ij_javascript_blank_lines_around_function = 1 -# ij_javascript_blank_lines_around_method = 1 -# ij_javascript_block_brace_style = end_of_line -# ij_javascript_call_parameters_new_line_after_left_paren = false -# ij_javascript_call_parameters_right_paren_on_new_line = false -# ij_javascript_call_parameters_wrap = off -# ij_javascript_catch_on_new_line = false -# ij_javascript_chained_call_dot_on_new_line = true -# ij_javascript_class_brace_style = end_of_line -# ij_javascript_comma_on_new_line = false -# ij_javascript_do_while_brace_force = never -# ij_javascript_else_on_new_line = false -# ij_javascript_enforce_trailing_comma = keep -# ij_javascript_extends_keyword_wrap = off -# ij_javascript_extends_list_wrap = off -# ij_javascript_field_prefix = _ -# ij_javascript_file_name_style = relaxed -# ij_javascript_finally_on_new_line = false -# ij_javascript_for_brace_force = never -# ij_javascript_for_statement_new_line_after_left_paren = false -# ij_javascript_for_statement_right_paren_on_new_line = false -# ij_javascript_for_statement_wrap = off -# ij_javascript_force_quote_style = false -# ij_javascript_force_semicolon_style = false -# ij_javascript_function_expression_brace_style = end_of_line -# ij_javascript_if_brace_force = never -# ij_javascript_import_merge_members = global -# ij_javascript_import_prefer_absolute_path = global -# ij_javascript_import_sort_members = true -# ij_javascript_import_sort_module_name = false -# ij_javascript_import_use_node_resolution = true -# ij_javascript_imports_wrap = on_every_item -# ij_javascript_indent_case_from_switch = true -# ij_javascript_indent_chained_calls = true -# ij_javascript_indent_package_children = 0 -# ij_javascript_jsx_attribute_value = braces -# ij_javascript_keep_blank_lines_in_code = 2 -# ij_javascript_keep_first_column_comment = true -# ij_javascript_keep_indents_on_empty_lines = false -# ij_javascript_keep_line_breaks = true -# ij_javascript_keep_simple_blocks_in_one_line = false -# ij_javascript_keep_simple_methods_in_one_line = false -# ij_javascript_line_comment_add_space = true -# ij_javascript_line_comment_at_first_column = false -# ij_javascript_method_brace_style = end_of_line -# ij_javascript_method_call_chain_wrap = off -# ij_javascript_method_parameters_new_line_after_left_paren = false -# ij_javascript_method_parameters_right_paren_on_new_line = false -# ij_javascript_method_parameters_wrap = off -# ij_javascript_object_literal_wrap = on_every_item -# ij_javascript_parentheses_expression_new_line_after_left_paren = false -# ij_javascript_parentheses_expression_right_paren_on_new_line = false -# ij_javascript_place_assignment_sign_on_next_line = false -# ij_javascript_prefer_as_type_cast = false -# ij_javascript_prefer_parameters_wrap = false -# ij_javascript_reformat_c_style_comments = false -# ij_javascript_space_after_colon = true -# ij_javascript_space_after_comma = true -# ij_javascript_space_after_dots_in_rest_parameter = false -# ij_javascript_space_after_generator_mult = true -# ij_javascript_space_after_property_colon = true -# ij_javascript_space_after_quest = true -# ij_javascript_space_after_type_colon = true -# ij_javascript_space_after_unary_not = false -# ij_javascript_space_before_async_arrow_lparen = true -# ij_javascript_space_before_catch_keyword = true -# ij_javascript_space_before_catch_left_brace = true -# ij_javascript_space_before_catch_parentheses = true -# ij_javascript_space_before_class_lbrace = true -# ij_javascript_space_before_class_left_brace = true -# ij_javascript_space_before_colon = true -# ij_javascript_space_before_comma = false -# ij_javascript_space_before_do_left_brace = true -# ij_javascript_space_before_else_keyword = true -# ij_javascript_space_before_else_left_brace = true -# ij_javascript_space_before_finally_keyword = true -# ij_javascript_space_before_finally_left_brace = true -# ij_javascript_space_before_for_left_brace = true -# ij_javascript_space_before_for_parentheses = true -# ij_javascript_space_before_for_semicolon = false -# ij_javascript_space_before_function_left_parenth = true -# ij_javascript_space_before_generator_mult = false -# ij_javascript_space_before_if_left_brace = true -# ij_javascript_space_before_if_parentheses = true -# ij_javascript_space_before_method_call_parentheses = false -# ij_javascript_space_before_method_left_brace = true -# ij_javascript_space_before_method_parentheses = false -# ij_javascript_space_before_property_colon = false -# ij_javascript_space_before_quest = true -# ij_javascript_space_before_switch_left_brace = true -# ij_javascript_space_before_switch_parentheses = true -# ij_javascript_space_before_try_left_brace = true -# ij_javascript_space_before_type_colon = false -# ij_javascript_space_before_unary_not = false -# ij_javascript_space_before_while_keyword = true -# ij_javascript_space_before_while_left_brace = true -# ij_javascript_space_before_while_parentheses = true -# ij_javascript_spaces_around_additive_operators = true -# ij_javascript_spaces_around_arrow_function_operator = true -# ij_javascript_spaces_around_assignment_operators = true -# ij_javascript_spaces_around_bitwise_operators = true -# ij_javascript_spaces_around_equality_operators = true -# ij_javascript_spaces_around_logical_operators = true -# ij_javascript_spaces_around_multiplicative_operators = true -# ij_javascript_spaces_around_relational_operators = true -# ij_javascript_spaces_around_shift_operators = true -# ij_javascript_spaces_around_unary_operator = false -# ij_javascript_spaces_within_array_initializer_brackets = false -# ij_javascript_spaces_within_brackets = false -# ij_javascript_spaces_within_catch_parentheses = false -# ij_javascript_spaces_within_for_parentheses = false -# ij_javascript_spaces_within_if_parentheses = false -# ij_javascript_spaces_within_imports = false -# ij_javascript_spaces_within_interpolation_expressions = false -# ij_javascript_spaces_within_method_call_parentheses = false -# ij_javascript_spaces_within_method_parentheses = false -# ij_javascript_spaces_within_object_literal_braces = false -# ij_javascript_spaces_within_object_type_braces = true -# ij_javascript_spaces_within_parentheses = false -# ij_javascript_spaces_within_switch_parentheses = false -# ij_javascript_spaces_within_type_assertion = false -# ij_javascript_spaces_within_union_types = true -# ij_javascript_spaces_within_while_parentheses = false -# ij_javascript_special_else_if_treatment = true -# ij_javascript_ternary_operation_signs_on_next_line = false -# ij_javascript_ternary_operation_wrap = off -# ij_javascript_union_types_wrap = on_every_item -# ij_javascript_use_chained_calls_group_indents = false -# ij_javascript_use_double_quotes = true -# ij_javascript_use_explicit_js_extension = global -# ij_javascript_use_path_mapping = always -# ij_javascript_use_public_modifier = false -# ij_javascript_use_semicolon_after_statement = true -# ij_javascript_var_declaration_wrap = normal -# ij_javascript_while_brace_force = never -# ij_javascript_while_on_new_line = false -# ij_javascript_wrap_comments = false - diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 4d6c5b2..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "parser": "babel-eslint", - - "env": { - "browser": true - }, - - "extends": [ - "plugin:react/recommended" - ], - - - "plugins": [ - "react" - ], - - "rules": { - "arrow-body-style": ["off"], - "class-methods-use-this": ["off"], - "comma-dangle": ["warn"], - "dot-notation": ["off"], - "eqeqeq": ["error", "always"], - "import/extensions": ["off"], - "import/prefer-default-export": ["off"], - "indent": ["warn", 4], - "linebreak-style": ["off"], - "max-classes-per-file": ["off"], - "max-len": ["warn", { "code": 100, "ignoreUrls": true }], - "no-console": ["off"], - "no-multi-spaces": ["error", { "ignoreEOLComments": true }], - "no-multiple-empty-lines": ["off"], - "no-param-reassign": ["off"], - "no-plusplus": ["off"], - "no-restricted-syntax": ["off"], - "no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], - "no-useless-constructor": ["off"], - "object-curly-spacing": ["warn"], - "object-shorthand": ["off"], - "operator-linebreak": ["warn"], - "prefer-destructuring": ["off"], - "prefer-template": ["off"], - "quote-props": ["error", "consistent"], - "quotes": ["warn"], - "radix": ["off"], - "react/no-unescaped-entities": [ "error", { "forbid": [">", "}"] }], - "semi": ["error", "always"] - }, - - "settings": { - "react": { - "version": "detect" - } - }, - - "overrides": [ - { - "files": [ "**/*.test.js" ], - "env": { "jest": true } - } - ] -} \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index b68b2ef..5d9b388 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ - + + + \ No newline at end of file diff --git a/.idea/wireframe.iml b/.idea/wireframe.iml index 1d5efb6..995f82f 100644 --- a/.idea/wireframe.iml +++ b/.idea/wireframe.iml @@ -16,7 +16,7 @@ - + diff --git a/README.md b/README.md index c601c27..4a38b2f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # Boilerplate app You can use this to start a new project + +python manage.py createsuperuser +Username: admin +Email address: admin@example.com +Password: password +Password (again): diff --git a/backend/app/admin.py b/backend/app/admin.py deleted file mode 100644 index 04eadf9..0000000 --- a/backend/app/admin.py +++ /dev/null @@ -1,11 +0,0 @@ -""" -This file controls the administrative interface for the web app. -""" - -from django.contrib import admin - -models_to_register = [ -] - -for model in models_to_register: - admin.site.register(model) diff --git a/backend/app/apps.py b/backend/app/apps.py deleted file mode 100644 index b3303c8..0000000 --- a/backend/app/apps.py +++ /dev/null @@ -1,11 +0,0 @@ -""" -Configuration for the app. -""" - -from django.apps import AppConfig - - -class Config(AppConfig): - """Django app""" - # noinspection PyUnresolvedReferences - name = 'app' diff --git a/backend/app/fields.py b/backend/app/fields.py deleted file mode 100644 index e69de29..0000000 diff --git a/backend/app/models.py b/backend/app/models.py deleted file mode 100644 index 32ace9f..0000000 --- a/backend/app/models.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Models for the the sonification web app. -""" diff --git a/backend/app/serializers.py b/backend/app/serializers.py deleted file mode 100644 index 6df8731..0000000 --- a/backend/app/serializers.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Serializers take models or other data structures and present them -in ways that can be transported across the backend/frontend divide, or -allow the frontend to suggest changes to the backend/database. -""" diff --git a/backend/app/test_image.jpg b/backend/app/test_image.jpg deleted file mode 100644 index cb3b96a..0000000 Binary files a/backend/app/test_image.jpg and /dev/null differ diff --git a/backend/app/tests.py b/backend/app/tests.py deleted file mode 100644 index 0b72585..0000000 --- a/backend/app/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Tests for the sonification web app. -""" -# pylint: disable-msg=C0116 -# ignoring pylint's `missing-function-docstring` errors - -from django.test import TestCase - - -class MainTests(TestCase): - """ - Test cases for the brightness, dominant color recognition, and tempo finding private functions - """ - - def test_simple(self): - self.assertEqual(2+2, 4) diff --git a/backend/app/views.py b/backend/app/views.py deleted file mode 100644 index 5306a5e..0000000 --- a/backend/app/views.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -These view functions and classes implement both standard GET routes and API endpoints. - -GET routes produce largely empty HTML pages that expect a React component to attach to them and -handle most view concerns. You can supply a few pieces of data in the render function's context -argument to support this expectation. - -Of particular use are the properties: page_metadata, component_props, and component_name: -page_metadata: these values will be included in the page's element. -Currently, only the `title` property is used. component_props: these can be any properties you -wish to pass into your React components as its highest-level props. -component_name: this should reference the exact name of the React component -you intend to load onto the page. - -Example: -context = { - 'page_metadata': { - 'title': 'Example ID page' - }, - 'component_props': { - 'id': example_id - }, - 'component_name': 'ExampleId' -} -""" -from django.shortcuts import render - - -def index(request): - """ - Home page - """ - - context = { - 'page_metadata': { - 'title': 'Home page' - }, - 'component_name': 'Home' - } - - return render(request, 'index.html', context) diff --git a/backend/config/__init__.py b/backend/config/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/backend/config/settings/__init__.py b/backend/config/settings/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/backend/config/settings/base.py b/backend/config/settings/base.py deleted file mode 100644 index 1c58365..0000000 --- a/backend/config/settings/base.py +++ /dev/null @@ -1,159 +0,0 @@ -""" -Django base settings for ***** project. - -For more information on this file, see -https://docs.djangoproject.com/en/3.1/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/3.1/ref/settings/ -""" - -import os - -CONFIG_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -BACKEND_DIR = os.path.dirname(CONFIG_DIR) -MIGRATIONS_DIR = os.path.join(os.path.dirname(CONFIG_DIR), 'app/migrations') -SETTINGS_DIR = os.path.join(CONFIG_DIR, 'settings') -DB_PATH = os.path.join(BACKEND_DIR, 'db.sqlite3') -PROJECT_ROOT = os.path.dirname(BACKEND_DIR) - -# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ - - -ALLOWED_HOSTS = [] # For production, add domains - - -# Application definition - -INSTALLED_APPS = [ - # django - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - - # 3rd party - 'rest_framework', - 'corsheaders', - 'webpack_loader', - - # our application code - 'app', -] - -MIDDLEWARE = [ - 'corsheaders.middleware.CorsMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'config.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ - os.path.join(BACKEND_DIR, 'templates'), - ], - 'APP_DIRS': True, # our app doesn't, but our third party apps do! - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'config.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/3.1/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BACKEND_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/3.1/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/3.1/howto/static-files/ - -# the url where we'll look for static files -STATIC_URL = '/static/' - -# where collectstatic puts static files for production -STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') - -# where collectstatic looks for static files -STATICFILES_DIRS = ( - os.path.join(PROJECT_ROOT, 'build'), - os.path.join(PROJECT_ROOT, 'assets'), -) - -REST_FRAMEWORK = { - 'DEFAULT_PERMISSION_CLASSES': [ - 'rest_framework.permissions.AllowAny', - ] -} - -CORS_ORIGIN_WHITELIST = [ - 'http://localhost:3000', - 'http://localhost:8000', - 'http://localhost:8080', -] - - -# Django webpack loader settings -WEBPACK_LOADER = { - 'DEFAULT': { - 'BUNDLE_DIR_NAME': './assets/bundles/', - 'STATS_FILE': os.path.join(PROJECT_ROOT, 'webpack-stats.json'), - } -} diff --git a/backend/config/settings/dev.py b/backend/config/settings/dev.py deleted file mode 100644 index 8d8edf5..0000000 --- a/backend/config/settings/dev.py +++ /dev/null @@ -1,18 +0,0 @@ -""" - -Local development Django settings for ***** - -Under no circumstances run the server with these settings in production! - -""" - -from config.settings.base import * # pylint: disable=unused-wildcard-import, wildcard-import - - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'qqucn931x78rx054n(6g(s_3vxppjw$f24e(9&v6rsbd0&0$2e' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] # wildcard diff --git a/backend/config/settings/production.py b/backend/config/settings/production.py deleted file mode 100644 index ef6cdec..0000000 --- a/backend/config/settings/production.py +++ /dev/null @@ -1,18 +0,0 @@ -""" - -Production settings for ***** - -""" - -from .base import * # pylint: disable=unused-wildcard-import, wildcard-import - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False - -# SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] # set in venv activate - -ADMINS = ['rahmed@mit.edu'] # Django will email Ryaan on internal server errors - -ALLOWED_HOSTS = [] - -CORS_ORIGIN_WHITELIST = [] diff --git a/backend/config/urls.py b/backend/config/urls.py deleted file mode 100644 index 031327e..0000000 --- a/backend/config/urls.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/3.0/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URL configuration - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" -from django.contrib import admin -from django.urls import path - -try: - from ..app import views -except (ImportError, ModuleNotFoundError): - from app import views - -urlpatterns = [ - # Django admin page - path('admin/', admin.site.urls), - - # API endpoints - path('', views.index) -] diff --git a/backend/manage.py b/backend/manage.py deleted file mode 100755 index 1558f32..0000000 --- a/backend/manage.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -"""Django's command-line utility for administrative tasks.""" -import os -import sys - - -# pylint: disable=import-outside-toplevel -def main(): - """Main start Django function""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.dev') - try: - from django.core.management import execute_from_command_line - except ImportError as exc: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) from exc - execute_from_command_line(sys.argv) - - -if __name__ == '__main__': - main() diff --git a/backend/templates/index.html b/backend/templates/index.html deleted file mode 100644 index 82b2d7d..0000000 --- a/backend/templates/index.html +++ /dev/null @@ -1,29 +0,0 @@ -{% load render_bundle from webpack_loader %} - - - - - - {{page_metadata.title}} - - - - - {% render_bundle 'index' 'css' %} - - - - -
-

Hello world!

-
- - {{component_props|json_script:"component_props"}} - {{component_name|json_script:"component_name"}} - {% render_bundle 'index' 'js' %} - - - diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index bbd43b8..0000000 --- a/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -## Documentation diff --git a/frontend/common.js b/frontend/common.js deleted file mode 100644 index 21ee721..0000000 --- a/frontend/common.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Common.js -- miscellaneous routines useful throughout the system - */ - - - -/** - * Get the value of a cookie, given its name - * Adapted from https://docs.djangoproject.com/en/2.2/ref/csrf/#ajax - * @param {string} name - The name of the cookie - */ -export function getCookie(name) { - let cookieValue; - if (document.cookie && document.cookie !== "") { - const cookies = document.cookie.split(";"); - for (const rawCookie of cookies) { - const cookie = rawCookie.trim(); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) === (name + "=")) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; -} \ No newline at end of file diff --git a/frontend/components/ErrorNotFoundComponent.js b/frontend/components/ErrorNotFoundComponent.js deleted file mode 100644 index 524d066..0000000 --- a/frontend/components/ErrorNotFoundComponent.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from "react"; - -const ErrorNotFoundComponent = () => { - - return ( - <> -

Error: No React Component found

-

- This is likely an error in development. -
- Make sure that you register your component in index.js and reference it - by name in the relevant view function. -

- - ); -}; - -export default ErrorNotFoundComponent; \ No newline at end of file diff --git a/frontend/components/ExampleId.js b/frontend/components/ExampleId.js deleted file mode 100644 index 916b7f7..0000000 --- a/frontend/components/ExampleId.js +++ /dev/null @@ -1,34 +0,0 @@ -import React, {useState} from "react"; -import * as PropTypes from "prop-types"; -import STYLES from "./ExampleId.module.scss"; - -const ExampleId = ({id}) => { - - const [tracker, setTracker] = useState(0); - - const onButtonClick = () => { - setTracker(previousState => previousState + 1); - }; - - return ( -
-

This is the Example ID page.

-

- This page demonstrates passing view parameters from Django to React - and very simple state management. -

-

View params:

-
    -
  • ID: {id}
  • -
-

Example state: {tracker}

- -
- ); -}; - -ExampleId.propTypes = { - id: PropTypes.number -}; - -export default ExampleId; diff --git a/frontend/components/ExampleId.module.scss b/frontend/components/ExampleId.module.scss deleted file mode 100644 index 727508b..0000000 --- a/frontend/components/ExampleId.module.scss +++ /dev/null @@ -1,4 +0,0 @@ -.list { - list-style: none; - padding: 0.5rem; -} \ No newline at end of file diff --git a/frontend/components/Home.js b/frontend/components/Home.js deleted file mode 100644 index 6696be8..0000000 --- a/frontend/components/Home.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from "react"; - -const Home = () => { - - return ( - <> -

Hello world!

- - ); -}; - -export default Home; diff --git a/frontend/components/global/Base.js b/frontend/components/global/Base.js deleted file mode 100644 index 6651241..0000000 --- a/frontend/components/global/Base.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import Nav from "./Nav"; -import STYLES from "./Base.module.scss"; -import * as PropTypes from "prop-types"; - -const Base = ({children}) => { - return ( - <> -