This project implements Depth-First Search (DFS) and Breadth-First Search (BFS) algorithms for graph traversal. The backend includes user authentication functionality with a Login and Signup page. The project currently stores user data in local storage.
- 🔑 User Login and Signup system
- 🔍 DFS and BFS graph traversal algorithms
- 💾 Data persistence using LocalStorage
- 🖥️ Frontend built with Angular
- 🔧 Backend using Node.js with Express.js
.vscode/ # Contains workspace settings for VSCode
backend/ # Backend directory (Node.js/Express)
public/ # Public assets like images, logos, etc.
src/ # Angular application source code
.editorconfig # Editor configuration for consistent coding style
.gitignore # Git ignore file to exclude certain files from being committed
CODE_OF_CONDUCT.md # Code of conduct for contributors
README.md # Project documentation file
angular.json # Angular workspace configuration
netlify.toml # Configuration for deploying to Netlify
package-lock.json # Locked versions of installed npm dependencies
package.json # Project metadata and npm dependencies
tsconfig.app.json # TypeScript configuration for the app
tsconfig.json # General TypeScript configuration
tsconfig.spec.json # TypeScript configuration for testing
Make sure you have the following installed before running the project:
- 🟢 Node.js (v14 or above)
- 📦 npm (comes with Node.js)
🅰️ Angular CLI (globally installed)
git clone https://github.com/yourusername/dfs-bfs-graph-traversal.git
cd GRAPH-TRAVERSAL
npm install
cd backend
npm install
From the backend
directory, start the backend:
node server.js
Alternatively, you can use nodemon for automatic restarts:
npm install -g nodemon
nodemon server.js
Go back to the project root (GRAPH-TRAVERSAL
) and run the Angular development server:
ng serve
Your frontend will be running at http://localhost:5000
🌐.
- The Signup Page allows users to register by entering a username and password, which is stored in LocalStorage.
- The Login Page checks credentials against the data stored in LocalStorage.
- 🖱️ Right-click on the Signup page and select Inspect.
- 🧰 Navigate to the Application tab in the developer tools.
- 📂 Under Storage, expand LocalStorage.
- 🔍 You’ll find the stored signup details there.
The backend server, built with Node.js and Express.js, handles:
- 🛡️ User Authentication: A basic registration and login system.
- 🔄 Graph Traversal: Provides APIs for DFS and BFS traversals.
- Input your nodes. Make sure it is in A,B,... format. Comma is necessary
- Input your edges. Make sure it is in the [to]-[from] format. Eg: 0-1
- Click on create custom graph button 🔵
- See how the magic happens
Example:
Output: