Skip to content

Commit 2d2a3bc

Browse files
ryanshi42Hanyuan Liploffy06
authored
Leaderboard backend (#63)
* feat: moved advent folder -> puzzles, added some comments * feat(docker): start separation of dev and prod builds, add pytest functionality to backend * feat(docker): added dev/prod to frontend, transition frontend to yarn * fix: remove .vscode folder * fix(makefile): restructured makefile a bit * feat: removed .vscode folder from git * feat(auth): get rudimentary autotesting in place, created clear_database function * feat(test): added all tests for auth/register * fix(puzzle): changed blueprint in routes/puzzle.py * feat(auth): refactored registration system, database connections * fix(auth): minor changes to constructor * feat(auth): implement email verification endpoints * feat(test): using fixtures * feat(auth): finish autotests, still needs commenting * feat(auth): finished writing tests for the most part * feat(auth): complete tests for basic auth system * fix(auth): removed duplicate clear_database function * fix(auth): add basic lockout functionality * update * fix(auth): fix clear_database utility function * leaderboard database complete no trigger * fix(auth): change requests to conform with DB * leaderboard backend complete no trigger * fix(auth): add basic lockout to /login route * leaderboard trigger implemented * more triggers implemented on parts, questions, etc. * almost done leaderboard tests * leaderboard tests complete, besides jwt passing * I have lost my sanity * finished all but tests failing because mail not working * updat * removed useless puzzle test * puzzle tests infinite loop, smtp * first test leaderboard passing * all tests uncommented but frozen on second * finished all leaderboard and puzzle, puzzles not fully tested for 7 days (only 1 day) Co-authored-by: Hanyuan Li <[email protected]> Co-authored-by: Alice Wan <[email protected]>
1 parent 47db08e commit 2d2a3bc

25 files changed

+10579
-9557
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ restart:
4040

4141
test-backend:
4242
docker-compose exec backend pytest . $(args)
43+
44+
test-puzzle:
45+
docker-compose exec backend pytest -vv -s ./test/puzzle $(args)
46+
47+
test-leaderboard:
48+
docker-compose exec backend pytest -vv -s ./test/leaderboard $(args)

Pipfile

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[[source]]
2-
url = "https://pypi.python.org/simple"
3-
verify_ssl = true
4-
name = "pypi"
5-
6-
[packages]
7-
8-
[dev-packages]
9-
10-
[requires]
11-
python_version = "3.8"
1+
[[source]]
2+
url = "https://pypi.python.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
[dev-packages]
9+
10+
[requires]
11+
python_version = "3.8"

backend/Pipfile.lock

+316-189
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/app.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from database.database import db
1111
from routes.auth import auth
1212
from routes.puzzle import puzzle
13+
from routes.leaderboard import leaderboard
1314
from routes.user import user
1415

1516

@@ -61,6 +62,7 @@ def create_app():
6162
# Register smaller parts of the API
6263
app.register_blueprint(auth, url_prefix="/auth")
6364
app.register_blueprint(puzzle, url_prefix="/puzzle")
65+
app.register_blueprint(leaderboard, url_prefix="/leaderboard")
6466
app.register_blueprint(user, url_prefix="/user")
6567

6668
# Register our error handler

0 commit comments

Comments
 (0)