Skip to content

Feat/auth progress tracking#1258

Open
shreyagpj wants to merge 20 commits into
komalharshita:mainfrom
shreyagpj:feat/auth-progress-tracking
Open

Feat/auth progress tracking#1258
shreyagpj wants to merge 20 commits into
komalharshita:mainfrom
shreyagpj:feat/auth-progress-tracking

Conversation

@shreyagpj

Copy link
Copy Markdown
Contributor

Summary [required]

This PR introduces authentication-based progress tracking, allowing users to create accounts, securely save their learning progress to the server, and access it across sessions and devices. It also adds a user dashboard for viewing progress, fixes a couple of pre-existing bugs uncovered during the implementation, and AI assistance was used during development.

Related Issue [required]

Closes #61

Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed [required]

File Change made
src/utils/auth.py Added a new SQLite-backed authentication module with user registration, login, logout, session management, and user lookup helpers.
src/utils/learning_progress.py Updated progress storage to persist authenticated user progress in the database and support server-side progress retrieval and updates.
src/routes/main_routes.py Added authentication API endpoints (register, login, logout, me) and updated learning progress routes to use authenticated server-side progress storage.
src/static/auth.js Implemented the sign in/sign up flow, dashboard UI, server-side progress syncing, authentication gating for progress features, and logout state reset.
src/static/script.js Exposed window.clearSkills() so the authentication module can reset skill chips on logout.
src/templates/index.html Added authentication UI elements, restored the desktop navigation structure, and updated the progress section markup.
src/static/style.css Added styling for the authentication modal and dashboard, fixed navigation button styles, improved mobile navigation and dark mode styling, and updated input/suggestions styling.
tests/test_basic.py Fixed the manual test runner to correctly handle tests requiring a pytest.MonkeyPatch fixture.
tests/test_auth.py Added authentication tests covering registration, login, logout, session validation, and authenticated API flows.
CHANGELOG.md Documented the new authentication feature, progress tracking changes, and related bug fixes.
src/errors/handlers.py Fixed Accept-header handling to ensure consistent HTML error responses across Werkzeug versions.
src/utils/url_validator.py Fixed a variable name typo that caused URL validation to raise a NameError.

How to Test This PR

  1. Clone this branch:

    git checkout feat/auth-progress-tracking
  2. Install dependencies:

    py -m pip install -r requirements.txt
  3. Run the application:

    py src/app.py
  4. Open http://127.0.0.1:5000 and verify:

    • Create a new account using Sign Up.
    • Sign in and confirm the Dashboard replaces the Sign In button.
    • Search for a project, open it, and save/bookmark it.
    • Open the Dashboard and verify points, stats, badges, and saved projects update.
    • Log out and confirm the search input, recommendation form, and skill chips are reset.
    • Sign back in and verify your progress is restored.
    • On mobile (≤768px), confirm the Sign In and Dashboard buttons are available from the hamburger menu.
  5. Run the test suite:

py tests/test_basic.py


**Expected result:** All tests pass, authentication works as expected, and progress persists across logins.

Expected test output:

78 passed, 0 failed out of 78 tests

Test Results [required]

PASS test_projects_json_loads
PASS test_duplicate_ids_detected
PASS test_duplicate_titles_detected
PASS test_empty_title_detected
PASS test_missing_required_field_detected
PASS test_each_project_has_required_fields
PASS test_find_project_by_id_found
PASS test_find_project_by_id_missing
PASS test_parse_skills_basic
PASS test_parse_skills_empty_string
PASS test_parse_skills_single_entry
PASS test_parse_skills_valid_json_array
PASS test_parse_skills_malformed_json_handling
PASS test_parse_skills_legacy_fallback
PASS test_parse_skills_containing_commas
PASS test_score_single_project_full_match
PASS test_score_single_project_partial_skill_coverage
PASS test_score_coverage_ratio_exact_values
PASS test_score_no_project_skills_does_not_crash
PASS test_score_three_skills_partial_coverage
PASS test_score_single_project_no_match
PASS test_score_single_project_alias_matching
PASS test_get_recommendations_returns_results
PASS test_get_recommendations_max_three
PASS test_get_recommendations_no_match_returns_empty
PASS test_get_recommendations_result_format
PASS test_case_insensitive_recommendations_identical
PASS test_whitespace_stripped_in_skills
PASS test_validate_all_valid
PASS test_validate_missing_skills
PASS test_validate_missing_level
PASS test_validate_missing_interest
PASS test_validate_missing_time
PASS test_validate_all_missing
PASS test_home_route
PASS test_security_headers_present
PASS test_recommend_api_valid
PASS test_recommend_api_interest_not_available
PASS test_recommend_api_missing_field
PASS test_recommend_api_null_field
PASS test_recommend_api_non_string_field
PASS test_recommend_api_empty_body
PASS test_project_detail_found
[2026-07-03 15:08:23] ERROR devpath.errors status=404 id=a0f8eea9 type=NotFound context='page_not_found'
Traceback (most recent call last):
File "D:\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Downloads\DevPath-feat-auth-progress-tracking(final)\DevPath-feat-auth-progress-tracking\src\routes\main_routes.py", line 209, in project_detail
abort(404)
File "D:\Python312\Lib\site-packages\flask\helpers.py", line 272, in abort
current_app.aborter(code, *args, **kwargs)
File "D:\Python312\Lib\site-packages\werkzeug\exceptions.py", line 887, in call
raise self.mapping[code](*args, **kwargs)
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

PASS test_project_detail_not_found
[2026-07-03 15:08:23] ERROR devpath.errors status=500 id=8fa4ceb9 type=Exception context='internal_server_error'
Exception: Test error

PASS test_internal_server_error_page
PASS test_view_code_found
PASS test_download_code_found
PASS test_view_code_nested_path
PASS test_download_code_nested_path
PASS test_resolve_starter_file_path_traversal
PASS test_health_check
PASS test_scoring_weights_has_all_keys
PASS test_search_api_returns_results
PASS test_search_api_empty_query
PASS test_home_route_with_share_params
PASS test_share_banner_element_exists
PASS test_share_params_partial_loads_ok
PASS test_share_params_invalid_level_not_reflected
PASS test_share_params_xss_not_reflected
PASS test_share_params_excessive_skills_loads_ok
PASS test_api_recommend_invalid_level_no_crash
PASS test_sitemap_returns_200
PASS test_sitemap_content_type
PASS test_sitemap_contains_homepage
PASS test_sitemap_contains_all_project_ids
PASS test_robots_txt_returns_200
PASS test_robots_txt_references_sitemap
PASS test_project_links_have_noopener
PASS test_career_roadmaps_load
PASS test_compare_roadmaps_finds_overlap
PASS test_compare_same_roadmap_returns_error
PASS test_compare_invalid_roadmap_returns_none
PASS test_compare_page_route
PASS test_list_roadmaps_api
PASS test_compare_api
PASS test_compare_api_missing_params
PASS test_compare_api_not_found
PASS test_sitemap_includes_compare

78 passed, 0 failed out of 78 tests

paste output here

Screenshots (if UI change)

Before
image

After
image

image image

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 78 tests pass
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)

Notes for Reviewer

None

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@shreyagpj is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Project Progress Tracking

1 participant