Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Onboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# IEEE Hackathon Website Template

A customizable website template for hackathons run by [IEEE University of Toronto Student Branch](https://ieee.utoronto.ca/).

## IEEE Web Team 2025-2026
#### Directors
- Aaron Gu
- Ashwin Santhosh

#### Advisors
- Mustafa Abdulrahman
- Carmen Chau

#### Associates
- Wahib Barqawi
- Aidan Tran
- Warrick Tsui

---

## Quick Start Guide

### 1. Install Prerequisites
- Python 3.9
- [Docker](https://docs.docker.com/get-docker/) + [Docker Compose](https://docs.docker.com/compose/install/)
- Node.js v16

### 2. Setup Environment
```bash
# Create and activate conda environment
conda env create -f environment.yml
conda activate ieee-htsl

# Set required environment variables
conda env config vars set SECRET_KEY=123
conda env config vars set DEBUG=1
conda env config vars set REACT_APP_DEV_SERVER_URL=http://localhost:8000

# Reactivate environment
conda deactivate
conda activate ieee-htsl
```

### 3. Start Services
```bash
# Launch database and cache
docker compose -f development/docker-compose.yml up -d

# Apply database migrations
cd hackathon_site
python manage.py migrate
```

### 4. Build Assets
```bash
# Compile SCSS to CSS
yarn run scss

# Watch for SCSS changes (optional)
yarn run scss-watch
```
### 5. Run Development Servers
```bash
# Start Django server (main site)
python manage.py runserver

### 6. Access
* Main site: http://localhost:8000

* Admin: http://localhost:8000/admin
73 changes: 73 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: ieee-htsl
channels:
- conda-forge
- defaults

dependencies:
# Core language and C‑library deps
- python=3.9
- libpq
- psycopg2 # pre‑built, with libpq
- pip # so we can install the rest via pip

# All remaining packages come from PyPI
- pip:
- appdirs==1.4.3
- asgiref==3.8.1
- attrs==19.3.0
- black==19.10b0
- certifi==2020.4.5.1
- chardet==3.0.4
- click==7.1.2
- confusable-homoglyphs==3.3.1
- coreapi==2.3.3
- coreschema==0.0.4
- defusedxml==0.7.1
- diff-match-patch==20241021
- dj-rest-auth==1.0.6
- Django==3.2.15
- django-client-side-image-cropping==0.1.9
- django-cors-headers==3.3.0
- django-debug-toolbar==2.2.1
- django-filter==2.4.0
- django-import-export==2.5.0
- django-recaptcha==2.0.6
- django-redis==4.12.1
- django-registration==3.1.2
- djangorestframework==3.11.2
- dotenv==0.9.9
- drf-yasg==1.17.1
- et_xmlfile==2.0.0
- gunicorn==20.0.4
- idna==2.9
- inflection==0.5.0
- itypes==1.2.0
- Jinja2==2.11.3
- MarkupSafe==1.1.1
- odfpy==1.4.1
- openpyxl==3.1.5
- packaging==20.4
- pathspec==0.8.0
- Pillow==9.0.1
- psycopg2-binary==2.9.10 # optional: you can remove this since conda’s psycopg2 is already installed
- pyparsing==2.4.7
- python-dateutil==2.8.2
- python-dotenv==1.1.0
- pytz==2020.1
- PyYAML==5.3
- qrcode==7.3.1
- redis==3.5.3
- regex==2021.4.4
- requests==2.25.1
- ruamel.yaml==0.16.10
- ruamel.yaml.clib==0.2.12
- six==1.15.0
- sqlparse==0.3.1
- tablib==3.7.0
- toml==0.10.0
- typed_ast==1.4.1
- typing_extensions==4.12.2
- uritemplate==3.0.1
- urllib3==1.26.5
- xlrd==2.0.1
- xlwt==1.3.0
4 changes: 2 additions & 2 deletions hackathon_site/event/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.conf import settings
from django.http import HttpResponseServerError
from django.template.loader import render_to_string
from drf_yasg.utils import swagger_auto_schema
from drf_spectacular.utils import extend_schema

from rest_framework import generics, mixins, status, permissions
from rest_framework.exceptions import ValidationError, PermissionDenied
Expand Down Expand Up @@ -253,7 +253,7 @@ def get_permissions(self):
def patch(self, request, *args, **kwargs):
return self.partial_update(request, *args, **kwargs)

@swagger_auto_schema(responses={201: ProfileCreateResponseSerializer})
@extend_schema(responses={201: ProfileCreateResponseSerializer})
def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
Expand Down
33 changes: 21 additions & 12 deletions hackathon_site/hackathon_site/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if DEBUG:
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
INTERNAL_IPS = ["localhost", "127.0.0.1"]
CORS_ORIGIN_REGEX_WHITELIST = [
CORS_ALLOWED_ORIGIN_REGEXES = [
r"^https?://localhost:?\d*$",
]
EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend"
Expand All @@ -49,7 +49,7 @@
"hardware.hackstudentlife.ca",
"www.hardware.hackstudentlife.ca",
]
CORS_ORIGIN_REGEX_WHITELIST = [
CORS_ALLOWED_ORIGIN_REGEXES = [
r"^https://(?:www\.)?hackstudentlife\.ca",
r"^https://(?:www\.)?\w+\.hackstudentlife\.ca",
]
Expand Down Expand Up @@ -109,7 +109,8 @@
"rest_framework",
"rest_framework.authtoken",
"dj_rest_auth",
"drf_yasg",
"drf_spectacular",
"drf_spectacular_sidecar",
"import_export",
"django_filters",
"client_side_image_cropping",
Expand Down Expand Up @@ -220,6 +221,7 @@
],
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.IsAuthenticated"],
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
"PAGE_SIZE": 1000,
"DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend",],
}
Expand All @@ -238,9 +240,16 @@

USE_TZ = True

# Swagger
# https://drf-yasg.readthedocs.io/en/stable/settings.html
SWAGGER_SETTINGS = {"DEFAULT_MODEL_RENDERING": "example", "DEEP_LINKING": True}
# drf-spectacular
# https://drf-spectacular.readthedocs.io/en/latest/settings.html
SPECTACULAR_SETTINGS = {
"TITLE": "Hardware Hackathon API",
"DESCRIPTION": "API Endpoint Visualization for Hardware Hackathon",
"VERSION": "1.0.0",
"SWAGGER_UI_DIST": "SIDECAR",
"SWAGGER_UI_FAVICON_HREF": "SIDECAR",
"REDOC_DIST": "SIDECAR",
}

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
Expand Down Expand Up @@ -318,12 +327,12 @@
CONTACT_EMAIL = DEFAULT_FROM_EMAIL
HSS_ADMIN_EMAIL = "hardware@hackstudentlife.ca"

REGISTRATION_OPEN_DATE = datetime(2024, 3, 1, tzinfo=TZ_INFO)
REGISTRATION_CLOSE_DATE = datetime(2024, 3, 8, 23, 59, 0, tzinfo=TZ_INFO)
EVENT_START_DATE = datetime(2024, 3, 22, 7, 30, 0, tzinfo=TZ_INFO)
EVENT_END_DATE = datetime(2024, 3, 22, 18, 0, 0, tzinfo=TZ_INFO)
HARDWARE_SIGN_OUT_START_DATE = datetime(2020, 9, 1, tzinfo=TZ_INFO)
HARDWARE_SIGN_OUT_END_DATE = datetime(2024, 9, 30, tzinfo=TZ_INFO)
REGISTRATION_OPEN_DATE = datetime(2026, 2, 1, tzinfo=TZ_INFO)
REGISTRATION_CLOSE_DATE = datetime(2026, 3, 1, 23, 59, 0, tzinfo=TZ_INFO)
EVENT_START_DATE = datetime(2026, 3, 22, 7, 30, 0, tzinfo=TZ_INFO)
EVENT_END_DATE = datetime(2026, 3, 22, 18, 0, 0, tzinfo=TZ_INFO)
HARDWARE_SIGN_OUT_START_DATE = datetime(2026, 9, 1, tzinfo=TZ_INFO)
HARDWARE_SIGN_OUT_END_DATE = datetime(2026, 9, 30, tzinfo=TZ_INFO)

# Registration user requirements
MINIMUM_AGE = 18
Expand Down
20 changes: 5 additions & 15 deletions hackathon_site/hackathon_site/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,19 @@
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from django.conf import settings

from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView

from registration.views import ResumeView

schema_view = get_schema_view(
openapi.Info(
title="Hardware Hackathon API",
default_version="v1",
description="API Endpoint Visualization for Hardware Hackathon",
),
public=bool(settings.DEBUG),
)

urlpatterns = [
path("admin/", admin.site.urls),
path("api/", include("api.urls", namespace="api")),
url(
r"^swagger/$",
schema_view.with_ui("swagger", cache_timeout=0),
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
path(
"swagger/",
SpectacularSwaggerView.as_view(url_name="schema"),
name="schema-swagger-ui",
),
path("registration/", include("registration.urls", namespace="registration")),
Expand Down
6 changes: 3 additions & 3 deletions hackathon_site/hardware/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django_filters import rest_framework as filters
from django.db import transaction
from django.http import HttpResponseServerError
from drf_yasg.utils import swagger_auto_schema
from drf_spectacular.utils import extend_schema
from django.template.loader import render_to_string

from rest_framework import generics, mixins, status, permissions
Expand Down Expand Up @@ -193,7 +193,7 @@ def get(self, request, *args, **kwargs):
return self.list(request, *args, **kwargs)

@transaction.atomic
@swagger_auto_schema(responses={201: OrderCreateResponseSerializer})
@extend_schema(responses={201: OrderCreateResponseSerializer})
def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
Expand Down Expand Up @@ -353,7 +353,7 @@ class OrderItemReturnView(generics.GenericAPIView):
)

@transaction.atomic
@swagger_auto_schema(responses={201: OrderItemReturnResponseSerializer})
@extend_schema(responses={201: OrderItemReturnResponseSerializer})
def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
Expand Down
Loading
Loading