Skip to content

feat: search-by-topic#644

Open
shreyagpj wants to merge 6 commits into
komalharshita:mainfrom
shreyagpj:feat/search-by-topic
Open

feat: search-by-topic#644
shreyagpj wants to merge 6 commits into
komalharshita:mainfrom
shreyagpj:feat/search-by-topic

Conversation

@shreyagpj
Copy link
Copy Markdown

Summary [required]

Added a keyword-based project search feature to the navbar.
Users can now search projects using keywords matched against project titles, descriptions, interests, skills, tech stack, and features. The update includes frontend integration, backend search filtering, search UI styling, and automated test coverage for the new API endpoint.

AI assistance was used during development for implementation support and debugging.

Related Issue [required]

Closes #60

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
routes/main_routes.py Added /api/search endpoint to filter projects based on keyword query
static/script.js Connected navbar search form to backend search API and handled response rendering
static/style.css Added styling for navbar search input and submit button integration
templates/index.html Added navbar search form with input and submit button
tests/test_basic.py Added test case to validate search API functionality

How to Test This PR [required]

  1. Clone this branch: git checkout your-branch-name
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000 and...
  5. Run the tests: python tests/test_basic.py

Expected test output:

33 passed, 0 failed out of 33 tests

Test Results [required]

  PASS  test_projects_json_loads
  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_score_single_project_full_match
  PASS  test_score_single_project_no_match
  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_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_recommend_api_valid
  PASS  test_recommend_api_missing_field
  PASS  test_recommend_api_empty_body
  PASS  test_project_detail_found
  PASS  test_project_detail_not_found
  PASS  test_internal_server_error_page
  PASS  test_view_code_found
  PASS  test_download_code_found
  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_search_api_no_match

33 passed, 0 failed out of 33 tests

Screenshots (if UI change)

Before
image
After
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 33 tests pass
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

None

shreyagpj added 6 commits May 27, 2026 09:27
Added navbar search form with search input and submit button
Added automated test case for keyword/topic search API functionality
Added `/api/search` endpoint for keyword-based project filtering
Added styling for navbar search input and search button layout
Removed duplicated conditional blocks and corrected empty-state rendering flow for project results
Added search form submission handler and integrated frontend search requests with the backend API
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@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.

@shreyagpj shreyagpj changed the title Feat/search by topic feat: search-by-topic May 27, 2026
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 Search by Topic Functionality

1 participant