Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release version 1 #426

Merged
merged 404 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
404 commits
Select commit Hold shift + click to select a range
0b0a32c
#15 - Using environment variable UPLOAD_FOLDER
JarneClauw Mar 10, 2024
f40fc46
#15 - Add static typing to the submissions model
JarneClauw Mar 10, 2024
93032d0
#15 - Fixing linter
JarneClauw Mar 10, 2024
f257342
docker-compose added
warreprovoost Mar 10, 2024
7f9d22e
#15 - Will fix this later
JarneClauw Mar 10, 2024
064f963
#15 - Linter has cyclic imports
JarneClauw Mar 10, 2024
1fc9900
change port
warreprovoost Mar 10, 2024
b01d384
Merge branch 'development' into docker-compose
warreprovoost Mar 10, 2024
e7d3ba8
#15 - Small URL change
JarneClauw Mar 11, 2024
11377d1
fixed extracting of zip and uploading in project upload directory
Gerwoud Mar 11, 2024
bc6e4a9
fix
Gerwoud Mar 11, 2024
62632be
fixed tests
Gerwoud Mar 11, 2024
6f323ec
added test zip file
Gerwoud Mar 11, 2024
b5f8ef9
linter fixes
Gerwoud Mar 11, 2024
72a9b7d
removed some test files
Gerwoud Mar 11, 2024
e1f79c7
Merge branch 'development' into enhancement/projects-file-upload
Gerwoud Mar 11, 2024
12d0aa5
linter and test fixes
Gerwoud Mar 11, 2024
e1624b1
import depedency fix
Gerwoud Mar 11, 2024
123992c
fix import order
Gerwoud Mar 11, 2024
2c3a719
removed import getenv
Gerwoud Mar 11, 2024
33880d6
removed valid_project function
Gerwoud Mar 11, 2024
10b0c1a
fix fstring
Gerwoud Mar 11, 2024
0edbd46
fix: upload_directory
Gerwoud Mar 11, 2024
3438972
removed exist_ok=True
Gerwoud Mar 11, 2024
8892d98
use path.join
Gerwoud Mar 11, 2024
c5e3bc4
added url field
Gerwoud Mar 11, 2024
5c6a28d
fixed not checking for tuple type anymore
Gerwoud Mar 11, 2024
0be828f
fixed env var for tests
Gerwoud Mar 11, 2024
adbb14b
fixed env var for tests
Gerwoud Mar 11, 2024
f0be949
fixed with statements
Gerwoud Mar 11, 2024
220856f
using os.path.split instead of regular split
Gerwoud Mar 11, 2024
8c848d6
added exist_ok
Gerwoud Mar 11, 2024
cb7eac1
i forgot :skull: fix lmao yeet
Gerwoud Mar 11, 2024
6db6fad
i forgot :skull: fix lmao yeet
Gerwoud Mar 11, 2024
058f53e
goofy augh fstring
Gerwoud Mar 11, 2024
2314ff6
another small fix
Gerwoud Mar 11, 2024
251ff29
fixed the 'not fixed eh' problem
Gerwoud Mar 11, 2024
f01fed9
linting
Gerwoud Mar 11, 2024
d53eef1
fix handling fail
Gerwoud Mar 11, 2024
dad7015
added try block
Gerwoud Mar 12, 2024
f4fe9fa
linter
Gerwoud Mar 12, 2024
33c4b59
Merge pull request #62 from SELab-2/enhancement/projects-file-upload
Vucis Mar 12, 2024
998e69e
nginx.conf added
warreprovoost Mar 12, 2024
5dc72f0
rm conf
warreprovoost Mar 12, 2024
2dd65c9
Merge pull request #76 from SELab-2/base/setup-server
warreprovoost Mar 12, 2024
c5c8c90
fixed archieved to archived typo (#84)
Gerwoud Mar 12, 2024
6333ae4
#15 - Spelling
JarneClauw Mar 12, 2024
4eada65
Merge branch 'development' of github.com:SELab-2/UGent-3 into backend…
JarneClauw Mar 12, 2024
3972bb1
#15 - Fixing tests the merge broke
JarneClauw Mar 12, 2024
b3e18b0
Merge pull request #38 from SELab-2/backend/feature/submissions-endpoint
Vucis Mar 12, 2024
7dc3923
Feature/share link (#72)
AronBuzogany Mar 13, 2024
88aef97
added functionlity for downloading files
Gerwoud Mar 13, 2024
c700de1
reformatting
Gerwoud Mar 13, 2024
8582a6c
linter
Gerwoud Mar 13, 2024
cab65e1
niets veranderd? linter flipt
Gerwoud Mar 13, 2024
695514e
small newline change
Gerwoud Mar 13, 2024
0e5bc59
removed f-string formatting
Gerwoud Mar 13, 2024
5514ca2
added 404 and 500 cases
Gerwoud Mar 13, 2024
5e37b9f
fixed tests
Gerwoud Mar 13, 2024
54a3e1e
fixed os.curcwd
Gerwoud Mar 13, 2024
070ec2e
linter
Gerwoud Mar 13, 2024
5c71988
removed print
Gerwoud Mar 14, 2024
9a0d99d
check if file exist and commented code removed
Gerwoud Mar 14, 2024
13e32fc
fixed code duplication
Gerwoud Mar 14, 2024
0045e1f
used basename insteal of .split
Gerwoud Mar 14, 2024
3fbb041
linter fix
Gerwoud Mar 14, 2024
a2e9c32
Backend/tests/review models (#83)
JarneClauw Mar 14, 2024
2fd4cb8
Merge pull request #91 from SELab-2/backend/feature/files-download
Vucis Mar 14, 2024
b168743
Tests/cleanup (#104)
AronBuzogany Mar 14, 2024
ba044fc
fix badge for workflow in readme.md (#108)
Gerwoud Mar 14, 2024
1af5c7e
frontend developper instructions (#110)
Gerwoud Mar 14, 2024
7c0cc08
Merge backend authentication into development (#73)
Vucis Mar 14, 2024
4e34eef
Fix #114 (#115)
AronBuzogany Mar 15, 2024
988da50
Merge cleanup of authentication and tests into development (#111)
Vucis Mar 21, 2024
d247551
Enhancement/debug env variable (#128)
AronBuzogany Mar 21, 2024
5283f0c
fixed backend to frontend typo and added workflow branch argument (#119)
Gerwoud Mar 21, 2024
3d169f8
changed submission status to enum (#133)
AronBuzogany Mar 21, 2024
cdb2dba
Fix #77 changed grading to float (#134)
AronBuzogany Mar 21, 2024
8b4b093
Fixed #112 (#113)
AronBuzogany Mar 21, 2024
2d0574c
Fix for uploading project files (#120)
Gerwoud Mar 21, 2024
f0b9b20
Add get courses tests
JarneClauw Mar 22, 2024
d624566
Add post courses tests
JarneClauw Mar 22, 2024
c8dd663
Add get course tests
JarneClauw Mar 22, 2024
181936a
Add patch course tests
JarneClauw Mar 22, 2024
067fe79
Add delete course tests
JarneClauw Mar 22, 2024
bcee3bc
Removes all usage of str(e) in courses endpoint (#126)
JibrilExe Mar 24, 2024
e770091
changed port to 5001 (#142)
JibrilExe Mar 26, 2024
71eb3d4
Removed is_teacher and is_admin, changed to role enum (#127)
JibrilExe Mar 26, 2024
7c897c1
check if course name is blank (#100)
JibrilExe Mar 26, 2024
3336fd4
started initial readme for repo (#122)
Gerwoud Mar 26, 2024
6aa0f0c
fixed route /docs and edited projects endpoint (#123)
Gerwoud Mar 27, 2024
f8fee40
Base setup for easy translations in frontend (#145)
JibrilExe Mar 27, 2024
c89e4d5
Fix for issue 102. Submissions get now returns summary information in…
AronBuzogany Mar 28, 2024
7dc0ef4
Correctly uploading submission files (#136)
JarneClauw Mar 29, 2024
d4aa951
This should allow frontend to communicate with our backend (#144)
JibrilExe Mar 29, 2024
5d21644
Test invalid user form (#137)
JibrilExe Mar 30, 2024
22bf99e
Test for course with invalid field (#125)
JibrilExe Mar 30, 2024
e4e1cb4
Merge with backend/tests/auth
JarneClauw Mar 30, 2024
acc6dff
courses get finished
JarneClauw Mar 30, 2024
e43bf95
Feature/backend/documentation (#94)
Gerwoud Apr 1, 2024
0aea3a3
Base test class to handle auth (#153)
JarneClauw Apr 1, 2024
8886893
navbar (#80)
JibrilExe Apr 2, 2024
5319395
No longer authenticating teachers/students through url params (#165)
AronBuzogany Apr 3, 2024
0e6efe6
nested translation files (#163)
JibrilExe Apr 3, 2024
cbf5567
return deadline aswel on projects (#168)
JibrilExe Apr 4, 2024
e3ca8f8
Bump vite from 5.1.3 to 5.1.7 in /frontend (#166)
dependabot[bot] Apr 4, 2024
c25c292
Using i18n browser detector and route detection to assign languages a…
AronBuzogany Apr 4, 2024
496cd4d
Frontend/feature/submission post (#150)
AronBuzogany Apr 4, 2024
24e9452
Fixed inconsistently added auth tokens
JarneClauw Apr 4, 2024
63420f7
Whoops added it again
JarneClauw Apr 4, 2024
898bd97
Adding commented out tests
JarneClauw Apr 4, 2024
d6ebac8
Adding all the other auth tests
JarneClauw Apr 4, 2024
00b35e1
Tests for students
JarneClauw Apr 4, 2024
bca8824
Admin tests
JarneClauw Apr 4, 2024
272563c
Merge branch 'development' of github.com:SELab-2/UGent-3 into backend…
JarneClauw Apr 4, 2024
7647381
Forgot part of merge
JarneClauw Apr 4, 2024
d2cf519
Fix #179 (#180)
AronBuzogany Apr 4, 2024
433f421
Whoops
JarneClauw Apr 4, 2024
f8afbe1
Hope this fixes it
JarneClauw Apr 4, 2024
78eb9c7
Typing and comments
JarneClauw Apr 5, 2024
8e572f7
Merge with development
JarneClauw Apr 5, 2024
8730001
updating tests
JarneClauw Apr 5, 2024
3d10ef7
Set title of header using Portal (#177)
JibrilExe Apr 6, 2024
3bd4bf3
Removed paths from db for projects and allowing multiple deadlines (#…
AronBuzogany Apr 6, 2024
1898ed3
Created dynamic deadline calender view/input (#190)
AronBuzogany Apr 8, 2024
bdde5d7
Backend/feature/submission evaluation (#67)
Vucis Apr 9, 2024
b12cd27
Generalizing data field typing tests
JarneClauw Apr 9, 2024
515e177
Cleanup + renaming
JarneClauw Apr 9, 2024
5aead7f
Moving format to functions to make it clearer
JarneClauw Apr 9, 2024
4cdb385
cleanup
JarneClauw Apr 9, 2024
8f34631
Fix test_post_admins
JarneClauw Apr 9, 2024
f9e1f15
Fix test_get_courses_wrong_parameter
JarneClauw Apr 9, 2024
167dcc4
Creates project display for students and solves issue 186 (#187)
AronBuzogany Apr 10, 2024
99a8657
Fixing all tests
JarneClauw Apr 10, 2024
efe31d7
cleanup
JarneClauw Apr 10, 2024
6fd974b
Generalizing some query parameter tests
JarneClauw Apr 10, 2024
b0001fd
Merge remote-tracking branch 'origin' into backend/tests/course-endpoint
JarneClauw Apr 10, 2024
fe87af6
Fixing linter
JarneClauw Apr 10, 2024
2367f22
Whoops
JarneClauw Apr 10, 2024
4f2a9df
Making authorization tests more explicit
JarneClauw Apr 10, 2024
0e6cf49
Merge pull request #138 from SELab-2/backend/tests/course-endpoint
JibrilExe Apr 12, 2024
5deefc6
registering composite types (#197)
AronBuzogany Apr 13, 2024
8ca72d2
Added the runner used to test submissions as an optional field of pro…
AronBuzogany Apr 13, 2024
36ed720
Running evaluator in synchron when runner is set (#203)
AronBuzogany Apr 14, 2024
710526e
Check if submission is LATE (#196)
AronBuzogany Apr 14, 2024
33b2165
router fix (#205)
JibrilExe Apr 14, 2024
1e2a9d6
Added functionality to download submissions (#206)
AronBuzogany Apr 15, 2024
d861ec9
fix the no status on workflow badges (#211)
Gerwoud Apr 17, 2024
0b6698a
The submissions form for project page (#124)
Gerwoud Apr 18, 2024
fb2a885
re added decorator (#214)
Gerwoud Apr 18, 2024
9fd38a5
Backend/project submission authorization issue (#210)
JarneClauw Apr 18, 2024
d9cd5f8
error pages (#93)
Matisse-Sulzer Apr 18, 2024
12120eb
Added endpoint to add a user using a join code (#218)
AronBuzogany Apr 18, 2024
f2de32a
Addding a displayname to a user object (#221)
Vucis Apr 18, 2024
2630299
Homepage student + landing page (#194)
warreprovoost Apr 18, 2024
99ac445
Full authentication (#216)
Vucis Apr 18, 2024
c5e9fbc
Project overview (#219)
Gerwoud Apr 18, 2024
9b61937
Project overview page (#222)
warreprovoost Apr 18, 2024
89d357a
Course views for teacher (#161)
JibrilExe Apr 19, 2024
1a5e076
Fix authentication bugs (#226)
Vucis Apr 25, 2024
4a35f4f
Frontend/enhancement/join code endpoint (#248)
AronBuzogany Apr 25, 2024
afe3893
Fixes several buggs in join code endpoint (#251)
AronBuzogany Apr 25, 2024
40db0ad
fix home/header login button (#228)
warreprovoost Apr 26, 2024
7361514
add label (#258)
warreprovoost Apr 27, 2024
9f400ac
fix logout on server (#264)
warreprovoost Apr 27, 2024
e7098e1
Fix #277 (#278)
AronBuzogany Apr 27, 2024
49eb833
Fix #276 (#281)
AronBuzogany Apr 27, 2024
eb993d3
Changed AUTHENTICATION_URL .env variable (#268)
Vucis Apr 27, 2024
8c459d2
Creates a general code evaluator (#256)
AronBuzogany Apr 27, 2024
c8cfe7f
Authentication fix for backend tests (#280)
Vucis Apr 27, 2024
eb6767c
Fix fill in the course selector (#261)
warreprovoost Apr 27, 2024
0d59f86
use date not hours (#289)
warreprovoost Apr 28, 2024
64018c4
Cleanup of authentication tests (#285)
JarneClauw Apr 28, 2024
1514a5b
Submissions download authorization (#293)
JarneClauw Apr 28, 2024
28fb568
Courses now converts deadlines from string to Date right after fetch …
JibrilExe Apr 30, 2024
9ca85cf
Submission authorization issues (#301)
JarneClauw Apr 30, 2024
7a6c981
Submission issues (#304)
JarneClauw May 3, 2024
c110c10
change path (#305)
warreprovoost May 3, 2024
3f1cef2
course path (#308)
warreprovoost May 4, 2024
82c2a50
Navbar link to homepage added (#262)
warreprovoost May 4, 2024
c0cd627
Fix status on ProjectCards (#307)
warreprovoost May 4, 2024
1e039ab
Fix #253 (#254)
AronBuzogany May 4, 2024
ff90ff4
Seeder for easier demo and frontend testing (#291)
JibrilExe May 4, 2024
9f2540a
Redirecting when creation of project is succesful or showing error me…
AronBuzogany May 4, 2024
c665611
When doing GET on courses, only returning courses you are authorized …
AronBuzogany May 4, 2024
f9b6324
Fix #239 (#316)
AronBuzogany May 4, 2024
ef6afb5
Fix #238 (#317)
AronBuzogany May 4, 2024
27b09ed
Fix #323 (#324)
AronBuzogany May 4, 2024
e9d0b9a
added paper islands, made project cards of equal size, displaying use…
AronBuzogany May 4, 2024
8600115
Added header on error pages and moved env import outside fetchme func…
AronBuzogany May 4, 2024
b370591
added check on posting project (#321)
Vucis May 4, 2024
a524f9b
project form upload in user documentation (#250)
Gerwoud May 4, 2024
ccba571
When no run_tests.sh is given when creating a project, cannot submit.…
warreprovoost May 5, 2024
2bfccbd
changed everything to have 1 env var name (#332)
Gerwoud May 5, 2024
fa6987d
Fix #274 (#314)
AronBuzogany May 5, 2024
48ed4a7
added clipboard to copy the join code and redirecting to course when …
AronBuzogany May 5, 2024
8dd0770
added dutch translation of python evaluator (#333)
Gerwoud May 6, 2024
6a2350f
Added readme for user guide (#330)
Gerwoud May 6, 2024
dcc3040
Textfield performance issue (#334)
Gerwoud May 6, 2024
79b028f
changed documentation location (#337)
Gerwoud May 9, 2024
5c5877d
redirect lang fix (#339)
JibrilExe May 9, 2024
2822c1b
add lang path (#341)
warreprovoost May 9, 2024
4bfa40f
uses display name instead of uid (#328)
Gerwoud May 9, 2024
cbd7f83
Using react mui tabs in project view instead of implementing it again…
AronBuzogany May 11, 2024
1d0b4f8
Fix flickering with data loader (#348)
warreprovoost May 12, 2024
993154e
Seeder should generate unique submission times now (#354)
JibrilExe May 15, 2024
5e0c6e4
Project form/drag drop translations (#359)
JibrilExe May 16, 2024
561a1f3
fixed axios.post to use authentication (#363)
Vucis May 16, 2024
cf2ce81
del (#365)
warreprovoost May 16, 2024
ce15d41
outdated code (#358)
JibrilExe May 16, 2024
c73d4a1
teacher added as student to course for real this time (#368)
JibrilExe May 18, 2024
9ac2763
Submission tests (#362)
JarneClauw May 18, 2024
49462fb
Ignore bad filters on fetches to endpoints (#360)
JibrilExe May 18, 2024
76f90a3
Teacher is now listed as admin on course page (#349)
JibrilExe May 18, 2024
f7d2992
fix join codes bug (#374)
warreprovoost May 19, 2024
d145934
Fix en-us bug (#366)
Vucis May 19, 2024
214dcad
Fix the filter tests (#376)
Gerwoud May 20, 2024
587423b
Documentation/fix/GitHub link (#378)
Gerwoud May 20, 2024
dfc4910
patch score in backend when edited in the frontend and i18n for page …
Gerwoud May 20, 2024
f366e51
update frontend readme variables (#356)
Gerwoud May 20, 2024
86370e6
Frontend testing setup (#290)
Vucis May 20, 2024
e97d2b4
fix JWT refresh to use database (#383)
Vucis May 20, 2024
5597424
Update backend README (#357)
Gerwoud May 20, 2024
de04241
fix requirements/docker dependency bug (#392)
AronBuzogany May 22, 2024
e8b2862
Fix #265 (#353)
AronBuzogany May 23, 2024
9f4237f
removed edit link (#396)
Gerwoud May 23, 2024
fe979f5
added user guide links (#397)
Gerwoud May 23, 2024
37606d4
Add overview button to admin page of projects (#384)
Gerwoud May 23, 2024
92242cd
Fixed join code copy to clipboard (#404)
Vucis May 23, 2024
1fbd30c
Only return projects where u are student if visible for students is t…
JibrilExe May 23, 2024
8509c10
added conditional rendering for edit funtionality (#402)
Gerwoud May 23, 2024
2d694e9
added translation for homepage of user guide (#400)
Gerwoud May 23, 2024
d79bfd9
Groups backend (#338)
JibrilExe May 23, 2024
253ab7b
unzipping submissions on submission (#406)
AronBuzogany May 23, 2024
df9587f
Fixed deadline time left (#407)
Vucis May 23, 2024
e7129cd
Fix #408 (#409)
AronBuzogany May 23, 2024
50dfaaf
Filter on conditions the students projects (#411)
JibrilExe May 23, 2024
c979408
show red dots on home page (#412)
warreprovoost May 23, 2024
15f0c70
Project issues (#410)
JarneClauw May 23, 2024
3d4fe01
Project tests (#416)
JarneClauw May 23, 2024
dd84501
added 403 for overview page (#414)
Gerwoud May 23, 2024
ff7dd73
Student course overview (#417)
warreprovoost May 23, 2024
aa7383f
fixed authorizations in projectview (#418)
AronBuzogany May 23, 2024
8b7aae1
redirecting to homepage when user not logged in (#421)
AronBuzogany May 23, 2024
d3bcf1f
only fetching admins when needed (#420)
AronBuzogany May 23, 2024
dcb556f
Fixed url flickering (#423)
AronBuzogany May 23, 2024
26692db
fix seeder path (#422)
warreprovoost May 23, 2024
41567ce
added explanation (#425)
Gerwoud May 23, 2024
5032fd1
added general evaluator documentation (#424)
Gerwoud May 23, 2024
1b67e31
Header tests frontend (#391)
Vucis May 23, 2024
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
22 changes: 22 additions & 0 deletions .github/workflows/ci-linter-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: UGent-3-backend-linter
run-name: ${{ github.actor }} is running backend linter 🚀
on:
pull_request:
paths:
- 'backend/**'
jobs:
Backend-tests:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'

- name: Run linting
working-directory: ./backend
run: find . -type f -name "*.py" | xargs pylint

30 changes: 30 additions & 0 deletions .github/workflows/ci-linter-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: UGent-3-frontend-linter
run-name: ${{ github.actor }} is running frontend linter 🚀
on:
pull_request:
paths:
- 'frontend/**'
jobs:
Frontend-tests:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
working-directory: ./frontend
run: npm i eslint

- name: Run linting
working-directory: ./frontend
run: npm run lint

27 changes: 27 additions & 0 deletions .github/workflows/ci-test-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: UGent-3-backend-test
run-name: ${{ github.actor }} is running backend tests 🚀
on:
pull_request:
paths:
- 'backend/**'
jobs:
Backend-tests:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'

- name: Install dependencies
working-directory: ./backend
run: pip3 install -r requirements.txt && pip3 install -r dev-requirements.txt

- name: Running tests
working-directory: ./backend
run: bash ./run_tests.sh


38 changes: 38 additions & 0 deletions .github/workflows/ci-test-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: UGent-3-frontend-test
run-name: ${{ github.actor }} is running frontend tests 🚀
on:
pull_request:
paths:
- 'frontend/**'
jobs:
Frontend-tests:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
working-directory: ./frontend
run: npm ci

- name: Build
working-directory: ./frontend
run: npm run build

- name: Preview Web App
working-directory: ./frontend
run: npm run preview &

- name: Running tests
working-directory: ./frontend
run: npm test

62 changes: 0 additions & 62 deletions .github/workflows/ci-tests.yml

This file was deleted.

22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# UGent-3
# UGent-3 project peristerónas
![tests](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-frontend.yaml/badge.svg)
![linter](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-frontend.yaml/badge.svg)
![tests](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg)
![linter](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-backend.yaml/badge.svg)
## Introduction
Project peristerónas was created to aid both teachers and students in achieving a
clear overview of deadlines and projects that need to be submitted.

There's a separate functionality depending on if you're logged in as a teacher or as a student.
For students the main functionality is to have a user-friendly interface to submit projects and check the correctness of their submissions.

When a teacher is logged in they can get an overview of the projects he assigned and check how many students have already
handed in a correct solution for example. It's also possible to edit the project and to grade projects in peristerónas' interface.
## Usage
### Frontend
For the developer instructions of the frontend please refer to the [frontend readme](frontend/README.md)
where clear instructions can be found for usage, test cases, deployment and development.
### Backend
For the developer instructions of the backend please refer to the [backend readme](backend/README.md)
where clear instructions can be found for usage, test cases, deployment and development.
4 changes: 3 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ __pycache__/
htmlcov/
docs/_build/
dist/
venv/
venv/
.env
.run/
18 changes: 16 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
FROM docker:dind as builder

FROM python:3.9

COPY --from=builder /usr/local/bin/docker /usr/local/bin/docker

RUN mkdir /app
WORKDIR /app/
WORKDIR /app

ADD ./project /app/

COPY requirements.txt /app/requirements.txt

RUN pip3 install -r requirements.txt
CMD ["python3", "/app"]

COPY . /app

ENTRYPOINT ["python"]

CMD ["__main__.py"]
24 changes: 24 additions & 0 deletions backend/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM docker:dind

RUN apk add --no-cache \
python3 \
py3-pip \
tzdata

ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone



RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"

COPY . /app

WORKDIR /app

RUN pip3 install --no-cache-dir -r requirements.txt -r dev-requirements.txt

RUN chmod +x /app/entry-point.sh

ENTRYPOINT ["/app/entry-point.sh"]
9 changes: 9 additions & 0 deletions backend/Dockerfile_auth_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.9
RUN mkdir /auth-app
WORKDIR /auth-app
ADD ./test_auth_server /auth-app/
COPY auth_server_requirements.txt /auth-app/requirements.txt
RUN pip3 install -r requirements.txt
COPY . /auth-app
ENTRYPOINT ["python"]
CMD ["__main__.py"]
79 changes: 79 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Project pigeonhole backend
![tests](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg)
![linter](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-backend.yaml/badge.svg)
## Prerequisites
**1. Clone the repo**
```sh
git clone git@github.com:SELab-2/UGent-3.git
```
**2. Installing required packages**

If you want the development environment: run both commands. If you only need to deploy, run the deployment command.

The [dev-requirements.txt](dev-requirements.txt) contains everything for writing tests and linters for maintaining quality code.
On the other hand the regular [requirements.txt](requirements.txt) installs the packages needed for
the regular base application.

- Deployment
```sh
pip install -r requirements.txt
```
- Development
```sh
pip install -r dev-requirements.txt
```

## Setting up the environment variables
The project requires a couple of environment variables to run, if you want to develop on this codebase.
Setting values for these variables can be done with a method to your own liking.

| Variable | Description |
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| POSTGRES_USER | Name of the user, needed to login to the postgres database |
| POSTGRES_PASSWORD | Password of the user, needed to login to the postgres database |
| POSTGRES_HOST | Location of the postgres database |
| POSTGRES_DB | Name of the postgres database |
| API_HOST | Location of the API root |
| CLIENT_ID | [Client id](https://learn.microsoft.com/nl-nl/entra/identity-platform/v2-protocols) |
| CLIENT_SECRET | Client's secret is your personal secret key for authentication, this can be found at the [Entra ID admin center](https://learn.microsoft.com/en-us/purview/sit-defn-azure-ad-client-secret) |
| JWT_SECRET_KEY | JWT secret key is the key used to encode the JWT's and should be kept secret, because otherwise everyone can create "valid" JWT's for our application. Variable should be a random 32 characters long string, if you need more information please refer to the [RDF documentation](https://www.rfc-editor.org/rfc/rfc4868#page-3) |
| TENANT_ID | [Tenant id](https://learn.microsoft.com/nl-nl/entra/fundamentals/whatis), an ID that is used to identify yourself to the microsoft servic |
| HOMEPAGE_URL | URL of where the website's homepage is located |

All the variables except the last one are for the database setup,
these are needed to make a connection with the database.
The last one is for keeping the API restful since the location of the resource should be located.

## Running the project
Once all the setup is done you can start the development server by
navigating to the backend directory and running:
```sh
python project
```
The server should now be located at `localhost:5000` and you can
start developing.

## Maintaining the codebase
### Writing tests
When writing new code it is important to maintain the right functionality so
writing tests is mandatory for this, the test library used in this codebase is [pytest](https://docs.pytest.org/en/8.0.x/).

If you want to write tests we highly advise to read the pytest documentation on how
to write tests, so they are kept conventional.

For executing the tests and testing your newly added functionality
you can run:
```sh
sudo ./run_tests.sh
```

Located in the backend directory.
### Running the linter
This codebase is kept clean by the [pylint](https://pypi.org/project/pylint/) linter.

If you want to execute the linter on all .py files in the project it can simply be done
with the command:
```sh
find . -type f -name "*.py" | xargs pylint
```
The code needs to get a 10/10 score to get pushed to the repository.
4 changes: 4 additions & 0 deletions backend/auth_server_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flask~=3.0.2
flask-restful
python-dotenv~=1.0.1
psycopg2-binary
Loading