https://github.com/alirafay265/comsatsmaps
A fully interactive and intelligent web-based navigation platform for COMSATS Lahore Campus with backend built with C++. It computes the shortest or simplest walking path between campus buildings using advanced graph algorithms: Dijkstra and BFS.
https://github.com/alirafay265/comsatsmaps
api backend cpp express js maps web
Last synced: about 2 months ago
JSON representation
A fully interactive and intelligent web-based navigation platform for COMSATS Lahore Campus with backend built with C++. It computes the shortest or simplest walking path between campus buildings using advanced graph algorithms: Dijkstra and BFS.
- Host: GitHub
- URL: https://github.com/alirafay265/comsatsmaps
- Owner: alirafay265
- License: mit
- Created: 2025-07-04T11:05:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-04T11:39:23.000Z (12 months ago)
- Last Synced: 2025-07-04T12:47:30.501Z (12 months ago)
- Topics: api, backend, cpp, express, js, maps, web
- Language: HTML
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧭 COMSATS Lahore - Smart Campus Navigation System
A fully interactive and intelligent web-based navigation platform for **COMSATS Lahore Campus**. It computes the shortest or simplest walking path between campus buildings using advanced graph algorithms: **Dijkstra** and **BFS**.
---
## 📁 Project Structure
```
COMSATSmaps
├── index.html # Frontend UI (interactive map and controls)
├── navigation.cpp # C++ engine (handles pathfinding logic)
├── server.js # Express backend server
├── Proposal.docx # Word file (project proposal)
├── LICENSE # MIT License
└── README.md # This file
````
---
## 🚀 How to Run This Project
### ✅ Prerequisites
- [Node.js](https://nodejs.org/en/) (v14+ recommended)
- `g++` compiler for C++ (e.g., via MinGW or GCC)
---
### 🔧 Setup Instructions
#### 1️⃣ Compile the C++ Navigation Engine
```bash
g++ -o navigation_engine navigation.cpp
````
This creates `navigation_engine.exe` which is required for the backend to function.
> 💡 If you're on Mac/Linux, you may need to make it executable with `chmod +x navigation_engine` and tweak the server.js file accordingly (ask ChatGPT).
---
#### 2️⃣ Install Node.js Dependencies
```bash
npm install express cors
```
---
#### 3️⃣ Run the Backend Server
```bash
node server.js
```
The server starts at: [http://localhost:3000](http://localhost:3000)
---
#### 4️⃣ Access the Frontend
Open your browser and visit:
```
http://localhost:3000
```
Use the dropdown to select **source** and **destination** along with the **alogrithm**, and click **Find Route**.
---
## 📷 Screenshots



## 🌐 API Overview
| Method | Endpoint | Description |
| ------ | ---------------- | ----------------------------------- |
| `GET` | `/api/health` | Check backend + C++ engine status |
| `GET` | `/api/locations` | Get all campus locations |
| `POST` | `/api/navigate` | Get best path between two buildings |
### 🔄 Example POST Request to `/api/navigate`
```json
{
"source": "N Block",
"destination": "K Block",
"algorithm": "dijkstra"
}
```
---
## ⚙️ Algorithms Supported
* **Dijkstra's Algorithm:** Finds the **shortest distance**
* **BFS (Breadth-First Search):** Finds path with **least number of steps**
---
## 🧠 How It Works
1. User selects source, destination, and algorithm from the frontend.
2. Backend receives the request and invokes the compiled `navigation_engine.exe`.
3. The C++ program calculates the path and returns JSON.
4. The result is rendered on the interactive campus map.
---
## 💡 Fun Fact:
The university actually implemented some of these paths in the campus after we made this project.
## 👥 Contributors
* 👨💻 [alirafay265](https://github.com/alirafay265)
* 👨💻 [iambillx](https://github.com/iambillx)
## 📝 License
This project is for **educational and academic purposes only**.