Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

BFHL Graph Processor

Full-stack graph processing system for the SRM Full Stack Engineering Challenge.

Project Structure

FullStack_Bajaj/
├── backend/
│   ├── server.js              # Express entry point
│   ├── package.json
│   ├── routes/
│   │   └── bfhlRoutes.js      # POST /bfhl route
│   ├── controllers/
│   │   └── bfhlController.js  # Request validation & response
│   ├── services/
│   │   └── graphService.js    # Business logic + user metadata
│   └── utils/
│       └── graphProcessor.js  # Core graph engine (zero deps)
├── frontend/
│   ├── index.html
│   ├── css/styles.css
│   └── js/app.js
├── .gitignore
└── README.md

Quick Start

Backend

cd backend
npm install
npm run dev          # starts on http://localhost:3000

Frontend

Open frontend/index.html in a browser, or serve it:

cd frontend
npx -y serve .       # starts on http://localhost:3000 (use another port)

Note: Update API_BASE_URL in frontend/js/app.js if your backend runs on a different URL.

API Reference

GET /

Health check.

Response:

{ "status": "ok", "service": "BFHL Graph Processing API", "timestamp": "..." }

POST /bfhl

Process directed edges.

Request:

{ "data": ["A->B", "A->C", "B->D"] }

Response:

{
  "user_id": "arsh_verma_24042004",
  "email_id": "arsh@example.com",
  "college_roll_number": "RA2211003012345",
  "hierarchies": [
    {
      "root": "A",
      "tree": { "A": { "B": { "D": {} }, "C": {} } },
      "has_cycle": false,
      "depth": 3
    }
  ],
  "invalid_entries": [],
  "duplicate_edges": [],
  "summary": {
    "total_trees": 1,
    "total_cycles": 0,
    "largest_tree_root": "A"
  }
}

About

Full Stack Graph Hierarchy Analyzer built for the SRM BFHL Challenge. Processes node relationships, detects cycles, handles edge cases, and visualizes hierarchical structures using Node.js and React.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages