src/app/search, with a page.tsx file under each directory to fit the app-router format.SearchBar or SearchSideBar, is broken up into its own components within src/modules/search/components. This keeps the design clean and readable, allows for edits without breaking the code, and provides the ability to reuse components in other locations with different inputs, without repetitive code.src/app/page.tsx within the SearchInterface object, which contains the homepage as well as the SearchBar.BASEURL/search?q=..., where ... represents the query entered in the search bar. This routes to src/app/search/page.tsx for handling search results.FilterPopup and MainSearchResults components, which hold the filters and the main search results part of this page, respectively.MainSearchResults component includes the SearchBar component so the SearchBar is always at the top of the screen and can be used whenever the user wishes. The SearchSideBar is also included, similar to the homepage. The key difference on this page is the SearchResults component, which is a list of IndividualResult components. Each result is mapped to data fetched from backend APIs using src/modules/search/utils/resultsFetcher.ts and src/modules/search/utils/jsonParser.ts to first fetch the results and then map them into object form, making them readable as JSON objects.src/modules/search/components/IndividualResult/IndividualResult.tsx is where each result is separately handled. Each result has its own features, such as buttons for citation, DOI, and PDF links, as well as like and dislike options. Clicking on an individual result—on the title or anywhere on the card not reserved for other buttons—will open a modal popup. This popup was requested by the partner and displays a more detailed view of the result in a clean and efficient design.src/modules/search/components/IndividualResult/IndividualResult.module.css and is modeled after the clean design requested by the partner.The files are structured following Knowlecy's conventions to facilitate integration and reduce development costs. Each module is organized into:
.module.css file for styling and an index.ts file for exporting. These components perform meaningful functions in the program and are reusable across different modules.This organization promotes modularity, reusability, and maintainability, ensuring that the project remains scalable.
Deployment is handled through GitHub Actions and Docker:
Dockerfile is used to containerize the application. The Docker image is published to the GitHub Container Registry, enabling consistent environments across development and production.The testing strategy ensures quality and reliability:
Dockerfile defines how the project is containerized and deployed to the GitHub Container Registry.By incorporating Postman for API testing and adhering to these workflows, the frontend ensures efficiency, reliability, and scalability.