|
| 1 | +======================================================================== |
| 2 | +Create file-system tree view for project scans |
| 3 | +======================================================================== |
| 4 | + |
| 5 | +**Organization:** `AboutCode <https://aboutcode.org>`_ |
| 6 | + |
| 7 | +**Projects:** `Scancode.io <https://github.com/aboutcode-org/scancode.io>`_ |
| 8 | + |
| 9 | +**Mentee:** `Aayush Kumar (aayushkdev) <https://github.com/aayushkdev>`_ |
| 10 | + |
| 11 | +**Mentors:** |
| 12 | + |
| 13 | +- `Thomas Druez <https://github.com/tdruez>`_ |
| 14 | +- `Tushar Goel <https://github.com/TG1999>`_ |
| 15 | +- `Omkar Phansopkar <https://github.com/OmkarPh>`_ |
| 16 | +- `Swastik Sharma <https://github.com/swastkk>`_ |
| 17 | + |
| 18 | +Overview |
| 19 | +-------- |
| 20 | +ScanCode.io previously allowed browsing project scans only one directory at a time, |
| 21 | +which made exploring large codebases or container images slow and inefficient. |
| 22 | + |
| 23 | +This project introduced an interactive codebase tree view that lets users |
| 24 | +navigate directories and files hierarchically, similar to a file explorer. |
| 25 | + |
| 26 | +-------------------------------------------------------------------------------- |
| 27 | + |
| 28 | +Implementation |
| 29 | +-------------- |
| 30 | +- **Changes in the CodebaseResource model:** |
| 31 | + - Introduced a new parent_path field to the CodebaseResource model to |
| 32 | + efficiently fetch the children of a directory. |
| 33 | + - Ensured that top-level paths are stored during resource creation, |
| 34 | + which is necessary for rendering root-level nodes in the file tree. |
| 35 | + |
| 36 | +- **Backend View:** |
| 37 | + - Implemented a new `CodebaseResourceTreeView` View to fetch and display |
| 38 | + immediate children of a directory. |
| 39 | + - Added a new `CodebaseResourceTableView` View to display the details of a file |
| 40 | + in tabular format with support for filtering. |
| 41 | + - Used HTMX to update data in place without needing to reload the file for each change. |
| 42 | + |
| 43 | +- **Frontend Codebase Tree:** |
| 44 | + - Introduced a collapsible file tree panel in the left pane of the project resource view. |
| 45 | + - Implemented chevron toggling to expand or collapse a directory’s immediate children: |
| 46 | + - If children were already fetched, they are simply shown or hidden. |
| 47 | + - Directories with no children display without a chevron. |
| 48 | + - Enabled lazy loading to fetch directory contents only when expanded, |
| 49 | + reducing initial load time. |
| 50 | + |
| 51 | + |
| 52 | +- **Testing:** |
| 53 | + |
| 54 | + - Conducted large-scale testing to ensure API and UI can handle thousands of files efficiently. |
| 55 | + - Added unit tests for both backend and frontend to verify that the APIs return correct data, |
| 56 | + the tree view expands and collapses properly, and file/directory details are displayed as |
| 57 | + expected. |
| 58 | + |
| 59 | + |
| 60 | +Linked Pull Requests |
| 61 | +-------------------- |
| 62 | + |
| 63 | +.. list-table:: |
| 64 | + :widths: 10 60 30 10 |
| 65 | + :header-rows: 1 |
| 66 | + |
| 67 | + * - Sr. no |
| 68 | + - Name |
| 69 | + - Link |
| 70 | + - Status |
| 71 | + * - 1 |
| 72 | + - Add support for tracking parent of CodebaseResource |
| 73 | + - `aboutcode.org/scancode.io#1691 |
| 74 | + <https://github.com/aboutcode-org/scancode.io/pull/1691>`_ |
| 75 | + - Merged |
| 76 | + * - 2 |
| 77 | + - Add a resource tree explorer to explore scanned images |
| 78 | + - `aboutcode.org/scancode.io#1704 |
| 79 | + <https://github.com/aboutcode-org/scancode.io/pull/1704>`_ |
| 80 | + - Open |
| 81 | + * - 3 |
| 82 | + - Add filter and search support to the codebase tree |
| 83 | + - `aboutcode.org/scancode.io#1828 |
| 84 | + <https://github.com/aboutcode-org/scancode.io/pull/1828>`_ |
| 85 | + - Open |
| 86 | + |
| 87 | +Related Issues |
| 88 | +-------------- |
| 89 | + |
| 90 | +.. list-table:: |
| 91 | + :widths: 10 60 30 |
| 92 | + :header-rows: 1 |
| 93 | + |
| 94 | + * - Sr. no |
| 95 | + - Name |
| 96 | + - Link |
| 97 | + * - 1 |
| 98 | + - Provide an explorer-style tree in resource view |
| 99 | + - `#697 |
| 100 | + <https://github.com/aboutcode-org/scancode.io/issues/697>`_ |
| 101 | + * - 2 |
| 102 | + - Add support for tracking parent of CodebaseResource entries and ensure top level paths are stored |
| 103 | + - `#1687 |
| 104 | + <https://github.com/aboutcode-org/scancode.io/issues/1687>`_ |
| 105 | + * - 3 |
| 106 | + - Add a resource tree explorer to explore scanned images |
| 107 | + - `#1682 |
| 108 | + <https://github.com/aboutcode-org/scancode.io/issues/1682>`_ |
| 109 | + |
| 110 | +Pre GSoC Work |
| 111 | +------------- |
| 112 | + |
| 113 | +Here are some of the PR's I submitted before GSoC: |
| 114 | + |
| 115 | +- `Enforced --path as a required parameter for scancode-license-data module |
| 116 | + <https://github.com/aboutcode-org/scancode-workbench/pull/638>`_ |
| 117 | +- `Fixed missing migration for Project.purl field |
| 118 | + <https://github.com/aboutcode-org/scancode.io/pull/1605>`_ |
| 119 | +- `Reorder XLSX output fields in RESOURCES sheet |
| 120 | + <https://github.com/aboutcode-org/scancode.io/pull/1590>`_ |
| 121 | +- `Added the ability to export the current filtered QuerySet of a FilterView to JSON format |
| 122 | + <https://github.com/aboutcode-org/scancode.io/pull/1572>`_ |
| 123 | +- `Added support for “caramel” license |
| 124 | + <https://github.com/aboutcode-org/scancode-toolkit/pull/4159>`_ |
| 125 | +- `Added the is_notice flag to the --classify option |
| 126 | + <https://github.com/aboutcode-org/scancode-toolkit/pull/4142>`_ |
| 127 | + |
| 128 | +Post GSoC |
| 129 | +--------- |
| 130 | + |
| 131 | +I plan to continue contributing by implementing further performance optimizations in my project and |
| 132 | +enhancing the overall user experience by refining and polishing the UI. |
| 133 | + |
| 134 | +Links |
| 135 | +----- |
| 136 | + |
| 137 | +* `Project Idea |
| 138 | + <https://github.com/aboutcode-org/aboutcode/wiki/GSOC-2025-project-ideas#scancodeio-create-file-system-tree-view-for-project-scans>`_ |
| 139 | + |
| 140 | +* `Official GSoC project page |
| 141 | + <https://summerofcode.withgoogle.com/programs/2025/projects/OQ4Mahel>`_ |
| 142 | + |
| 143 | +* `GSoC Proposal |
| 144 | + <https://docs.google.com/document/d/1kcJaizi6eK8FZQZs39sPY6XRCSuDU3bmlllFEs9O31U/edit?usp=sharing>`_ |
| 145 | + |
| 146 | +* `Project Board <https://github.com/orgs/aboutcode-org/projects/30>`_ |
| 147 | + |
| 148 | +Acknowledgements |
| 149 | +---------------- |
| 150 | + |
| 151 | +I would like to thank my mentors: |
| 152 | + |
| 153 | +- `Thomas Druez <https://github.com/tdruez>`_ |
| 154 | +- `Tushar Goel <https://github.com/TG1999>`_ |
| 155 | +- `Omkar Phansopkar <https://github.com/OmkarPh>`_ |
| 156 | +- `Swastik Sharma <https://github.com/swastkk>`_ |
| 157 | + |
| 158 | +The weekly status calls were extremely valuable, as they provided me with guidance |
| 159 | +on how to approach problems, break tasks into manageable steps, and stay on track |
| 160 | +with my progress. These discussions helped me clarify doubts quickly and gave me a |
| 161 | +clear direction on how to get things done efficiently. |
0 commit comments