-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from SELab-2/development
🎉 First release
- Loading branch information
Showing
183 changed files
with
11,208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Default values | ||
PUID=1000 | ||
PGID=1000 | ||
TZ=Europe/Brussels | ||
|
||
# File directories | ||
DATA_DIR="./data" | ||
BACKEND_DIR="./backend" | ||
FRONTEND_DIR="./frontend" | ||
SSL_DIR="./data/nginx/ssl" | ||
|
||
# Redis | ||
REDIS_IP=192.168.90.10 | ||
REDIS_PORT=6379 | ||
|
||
# Django | ||
DJANGO_SECRET_KEY="" # Set to a random string | ||
DJANGO_DEBUG=True # Django debug mode | ||
DJANGO_DOMAIN_NAME=localhost # Domain name for the Django server | ||
DJANGO_CAS_URL_PREFIX="" # URL prefix for the CAS server. Should be empty for development | ||
DJANGO_CAS_PORT=8080 # Port for the CAS server. Should be 8080 if DJANGO_DOMAIN_NAME is localhost | ||
DJANGO_DB_ENGINE=django.db.backends.sqlite3 # Database engine | ||
DJANGO_REDIS_HOST=${REDIS_IP} # Redis configuration | ||
DJANGO_REDIS_PORT=${REDIS_PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: backend-linting | ||
|
||
on: | ||
push: | ||
branches: [main, development] | ||
pull_request: | ||
branches: [main, development] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
pip install -r ./backend/requirements.txt | ||
- name: Execute linting checks | ||
run: flake8 --config ./backend/.flake8 ./backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: backend-tests | ||
|
||
on: | ||
push: | ||
branches: [main, development] | ||
pull_request: | ||
branches: [main, development] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
pip install -r ./backend/requirements.txt | ||
- name: Compile translations | ||
run: django-admin compilemessages | ||
- name: Execute tests | ||
run: cd backend; python manage.py test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
cd UGent-7 | ||
docker-compose -f production.yml down | ||
${{ secrets.PULL_SCRIPT }} | ||
docker-compose -f production.yml build --no-cache | ||
docker-compose -f production.yml up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.tool-versions | ||
.env | ||
.venv | ||
.idea | ||
.vscode | ||
data/* | ||
data/nginx/ssl/* | ||
data/postres* | ||
data/redis/* | ||
backend/data/production/* | ||
|
||
/node_modules | ||
backend/staticfiles/* | ||
|
||
!data/nginx/ssl/.gitkeep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Default values | ||
PUID=1000 | ||
PGID=1000 | ||
TZ=Europe/Brussels | ||
|
||
# File directories | ||
DATA_DIR="./data" | ||
BACKEND_DIR="./backend" | ||
FRONTEND_DIR="./frontend" | ||
SSL_DIR="" | ||
|
||
# Postgress DB | ||
POSTGRES_IP=192.168.90.9 | ||
POSTGRES_PORT=5432 | ||
POSTGRES_DB=selab | ||
POSTGRES_USER=selab_user | ||
POSTGRES_PASSWORD="" # Set to desired password | ||
|
||
# Redis | ||
REDIS_IP=192.168.90.10 | ||
REDIS_PORT=6379 | ||
|
||
# Django | ||
DJANGO_SECRET_KEY="" # Set to a random string | ||
DJANGO_DEBUG=False # Django debug mode | ||
DJANGO_DOMAIN_NAME="" # Domain name for the Django server | ||
DJANGO_CAS_URL_PREFIX="" # URL prefix for the CAS server | ||
DJANGO_CAS_PORT="" # Port for the CAS server | ||
DJANGO_DB_ENGINE=django.db.backends.postgresql # Database engine configuration | ||
DJANGO_DB_NAME=${POSTGRES_DB} | ||
DJANGO_DB_USER=${POSTGRES_USER} | ||
DJANGO_DB_PASSWORD=${POSTGRES_PASSWORD} | ||
DJANGO_DB_HOST=${POSTGRES_IP} | ||
DJANGO_DB_PORT=${POSTGRES_PORT} | ||
DJANGO_REDIS_HOST=${REDIS_IP} # Redis configuration | ||
DJANGO_REDIS_PORT=${REDIS_PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# UGent-7 | ||
# Ypovoli | ||
|
||
![backend linting](https://github.com/SELab-2/UGent-7/actions/workflows/backend-linting.yaml/badge.svg) | ||
![backend tests](https://github.com/SELab-2/UGent-7/actions/workflows/backend-tests.yaml/badge.svg) | ||
|
||
This application was developed within the framework of the course "Software Engineering Lab 2" within the Computer Science program at Ghent University. | ||
|
||
## Documentation | ||
|
||
See our wiki at [https://github.com/SELab-2/UGent-7/wiki](https://github.com/SELab-2/UGent-7/wiki) for more detailed information on the project's architecture. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[flake8] | ||
|
||
# Ignore unused imports | ||
ignore = F401 | ||
|
||
max-line-length = 125 | ||
|
||
max-complexity = 10 | ||
|
||
exclude = .git, | ||
__pycache__, | ||
.venv, | ||
venv, | ||
migrations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.venv | ||
.idea | ||
db.sqlite3 | ||
__pycache__ | ||
*.mo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.11.4 | ||
|
||
RUN apt update && apt install -y gettext libgettextpo-dev && pip install --upgrade pip | ||
|
||
WORKDIR /code | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
COPY requirements.txt /code/ | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . /code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM python:3.11.4 | ||
|
||
RUN apt update && apt install -y gettext libgettextpo-dev && pip install --upgrade pip | ||
|
||
WORKDIR /code | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
COPY requirements.txt /code/ | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . /code/ | ||
|
||
RUN ./setup.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:3.11.4 | ||
|
||
RUN apt update && apt install -y gettext libgettextpo-dev && pip install --upgrade pip | ||
|
||
WORKDIR /code | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
RUN ./setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Prerequisites | ||
|
||
- python 3.11.8 | ||
|
||
__Django doesn't support python 3.12__ | ||
|
||
# Install instructions | ||
|
||
- Create a virtual environment `python -m venv .venv` (make sure to use the right python version) | ||
|
||
- Activate the virtual environment `source .venv/bin/activate` | ||
|
||
- Run `setup.sh` | ||
|
||
- Run the server `python manage.py runsslserver localhost:8080` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ApiConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "api" | ||
|
||
def ready(self): | ||
from authentication.signals import user_created | ||
from api.signals import user_creation | ||
|
||
user_created.connect(user_creation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- model: api.assistant | ||
pk: '235' | ||
fields: | ||
courses: | ||
- 1 | ||
- model: api.assistant | ||
pk: '236' | ||
fields: | ||
courses: | ||
- 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
- model: api.extracheck | ||
pk: 1 | ||
fields: | ||
project: 123456 | ||
run_script: 'scripts/run.sh' | ||
|
||
- model: api.fileextension | ||
pk: 1 | ||
fields: | ||
extension: 'class' | ||
- model: api.fileextension | ||
pk: 2 | ||
fields: | ||
extension: 'png' | ||
- model: api.fileextension | ||
pk: 3 | ||
fields: | ||
extension: 'java' | ||
- model: api.fileextension | ||
pk: 4 | ||
fields: | ||
extension: 'py' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
- model: api.course | ||
pk: 1 | ||
fields: | ||
name: Math | ||
academic_startyear: 2023 | ||
description: Math course | ||
parent_course: null | ||
- model: api.course | ||
pk: 2 | ||
fields: | ||
name: Sel2 | ||
academic_startyear: 2023 | ||
description: Software course | ||
parent_course: 3 | ||
- model: api.course | ||
pk: 3 | ||
fields: | ||
name: Sel1 | ||
academic_startyear: 2022 | ||
description: Software course | ||
parent_course: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- model: api.group | ||
pk: 1 | ||
fields: | ||
project: 123456 | ||
score: 7 | ||
students: | ||
- '1' | ||
- '2' | ||
- model: api.group | ||
pk: 3 | ||
fields: | ||
project: 123456 | ||
score: 8 | ||
students: [] | ||
- model: api.group | ||
pk: 2 | ||
fields: | ||
project: 1 | ||
score: 8 | ||
students: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- model: api.project | ||
pk: 123456 | ||
fields: | ||
name: sel2 | ||
description: make a project | ||
visible: true | ||
archived: false | ||
start_date: 2024-02-26 00:00:00+00:00 | ||
deadline: 2024-02-27 00:00:00+00:00 | ||
group_size: 3 | ||
max_score: 20 | ||
course: 2 | ||
- model: api.project | ||
pk: 1 | ||
fields: | ||
name: sel3 | ||
description: make a project | ||
visible: true | ||
archived: false | ||
start_date: 2024-02-26 00:00:00+00:00 | ||
deadline: 2024-02-27 00:00:00+00:00 | ||
group_size: 3 | ||
max_score: 20 | ||
course: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- model: api.student | ||
pk: '1' | ||
fields: | ||
student_id: null | ||
courses: | ||
- 1 | ||
- model: api.student | ||
pk: '2' | ||
fields: | ||
student_id: null | ||
courses: [] |
Oops, something went wrong.