Skip to content

Improvement#19

Merged
RespectMathias merged 28 commits intomainfrom
improvement
May 22, 2025
Merged

Improvement#19
RespectMathias merged 28 commits intomainfrom
improvement

Conversation

@RespectMathias
Copy link
Copy Markdown
Contributor

✨ Description

Adds:

  • A run script instead of having commands run with runserver which is not recommended
  • BFS
  • Refactored CBF
  • Account management page and properly uses Django auth
  • Fix favicon

Linked Issue:

🔄 Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 🔧 Improvement

✅ Checklist

  • 📝 Code follows project style guidelines
  • 🔗 Relevant issue is linked and moved to 'In Progress'
  • 🧪 All relevant tests have been added or updated
  • ✔️ Continuous integration (CI) tests have passed
  • 👀 Ready for review

📄 Additional Information

Fixed that runserver did not work with activate, so calling executable directly
Added:
- Automatic csv download.
- Using django from venv
Fixed:
- Proper utilization of -c in subprocess e.g. as a string array
Fixed that runserver did not work with activate, so calling executable directly
Added:
- Automatic csv download.
- Using django from venv
Fixed:
- Proper utilization of -c in subprocess e.g. as a string array
Added:
- Rebased with main
- Fixed login related pages by properly using django.contrib.auth
- Additional pages
Fixed:
- Readded Wasi's styling
Added:
- Admin panel button for superusers so you don't need to navigate via url
Added:
- bfs unit tests
- cbf unit tests
@RespectMathias RespectMathias requested a review from Copilot May 22, 2025 16:03
@RespectMathias RespectMathias self-assigned this May 22, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the project by introducing a unified setup script, adding two recommendation engines (BFS- and content-based), refactoring account management with Django auth URLs and templates, and updating documentation and IDE integrations.

  • Added run.py script to streamline environment setup and data import
  • Introduced GraphRecommender (BFS) and refactored BookRecommender (CBF)
  • Replaced custom account pages with Django auth templates and updated navigation/favicon

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/presentation/templates/registration/*.html New Django auth templates for login, password reset, and account deletion
src/presentation/templates/base.html Loaded static, added favicon, improved auth nav UI
src/presentation/templates/book_details.html Added “You May Also Like” section using recommended_books
src/data_access/apps.py Removed automatic migrations and seeding on startup
src/config/urls.py & settings.py Included django.contrib.auth.urls and updated login/logout URLs
src/business_logic/cbf.py & bfs.py Added and refactored recommendation engines
run.py New setup/run orchestrator script
README.md Updated installation instructions for run.py
.vscode/tasks.json & launch.json Added VSCode task and preLaunchTask for project setup
Comments suppressed due to low confidence (1)

src/business_logic/bfs.py:7

  • [nitpick] New recommendation logic in GraphRecommender isn’t covered by tests. Consider adding unit tests for different depths and edge cases.
class GraphRecommender:

Comment thread src/presentation/templates/base.html Outdated
Comment thread src/business_logic/cbf.py Outdated
Comment thread src/business_logic/bfs.py
Comment thread src/business_logic/cbf.py Outdated
Comment thread .vscode/tasks.json Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RespectMathias RespectMathias requested a review from Copilot May 22, 2025 16:19
Fixed:
- Crossplatform paths
- Book ids instead of titles to get instances for cbf
- print into comment because we don't need to log this since it will get returned empty
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces standalone setup/run scripting, content- and graph-based recommenders, and a full suite of Django auth templates with favicon support.

  • Adds run.py for streamlined environment setup, migrations, superuser creation, and data import
  • Implements BookRecommender (CBF) and GraphRecommender (BFS) in business_logic/
  • Integrates Django auth URLs and templates (login, password reset, account deletion) and updates base.html for favicon/nav and README for new workflow

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/presentation/templates/registration/password_reset_form.html New password reset request form template
src/presentation/templates/registration/password_reset_email.html New password reset email body template
src/presentation/templates/registration/password_reset_done.html Template confirming reset email sent
src/presentation/templates/registration/password_reset_confirm.html Template for entering new password via reset link
src/presentation/templates/registration/password_reset_complete.html Template confirming password change completed
src/presentation/templates/registration/login.html Custom login template for Django auth
src/presentation/templates/registration/logged_out.html Template for post-logout acknowledgment
src/presentation/templates/registration/delete_account_confirm.html Confirmation template for permanent account deletion
src/presentation/templates/login.html Removed legacy login template
src/presentation/templates/book_details.html Adds “You May Also Like” recommendations section
src/presentation/templates/base.html Loads static, adds favicon link, and updates navbar with logout/profile
src/data_access/apps.py Removes automatic migration/seeding logic
src/config/urls.py Registers Django auth URLs under /accounts/
src/config/settings.py Cleans up seeding settings, adds login/logout redirect and email backend
src/business_logic/cbf.py Refactors content-based filtering recommender
src/business_logic/bfs.py Implements graph-based BFS recommender
run.py New run script for setup and server orchestration
README.md Updates setup instructions to use run.py
.vscode/tasks.json Adds “Setup Django Project” task to run setup-only flag
.vscode/launch.json Adjusts launch config to call setup task and use forward slashes
Comments suppressed due to low confidence (1)

src/business_logic/cbf.py:23

  • [nitpick] Using a slash in the column name ("review/score") can lead to ambiguities or require special handling. Consider using snake_case like review_score for consistency.
"review/score": rev.review_score or 0.0,

Comment thread src/business_logic/bfs.py
Comment thread src/presentation/templates/book_details.html Outdated
Comment thread README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RespectMathias RespectMathias merged commit 03eb1bd into main May 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants