DEV Community

Cover image for Day 3 of Building Secrin
Jenil Savani
Jenil Savani

Posted on

Day 3 of Building Secrin

Today’s focus was on extracting and counting structural elements from code repositories. We built a component that parses Python and JavaScript projects, identifies their key elements, and represents them as nodes and relationships in a graph structure.

The system now tracks:

print(f"Nodes extracted:")
print(f"  Files:       {files}")
print(f"  Classes:     {classes}")
print(f"  Functions:   {functions}")
print(f"  Variables:   {variables}")
print(f"  Packages:    {packages}")
print(f"  Docs:        {docs}")
print(f"  Total:       {len(graph_data.nodes)}")
print(f"\nRelationships: {len(graph_data.relationships)}")
Enter fullscreen mode Exit fullscreen mode

This output summarizes the architecture that Secrin now understands. Every file, class, and function becomes a node. Dependencies and references between them become edges. The result is a knowledge graph that represents the structure and logic of a codebase in a connected form.

This graph-based view lays the foundation for everything that follows. With it, we can:

  • Visualize how code components depend on each other.
  • Query relationships between files and functions.
  • Build higher-level understanding of repositories for documentation, onboarding, and AI-based code reasoning.

The Grand Line of Open Source continues. ⚓️


Follow the project:

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.