A comprehensive indoor navigation application designed to help users navigate through building floors with accessibility features and intelligent pathfinding.
This repository uses a multi-branch structure for organized development:
main: Main branch containing project overview and documentationdevelop-frontend: Frontend React Native application code and designsdevelop-backend: Backend FastAPI application code and designs
Note: The frontend and backend source code, designs, and implementation details are located in their respective development branches (
develop-frontendanddevelop-backend).
- Grid-Based Pathfinding: Efficient navigation using Dijkstra and A* algorithms
- Accessibility Support: Routes that avoid stairs and prefer ramps for wheelchair users
- Real-Time Navigation: Step-by-step instructions with distance and time estimates
- Multi-Building Support: Navigate across different buildings and floors
- Admin Dashboard: Manage nodes, edges, and building data
- Search Functionality: Find locations quickly with search
- Bookmark System: Save favorite locations for quick access
- Framework: FastAPI (Python)
- Database: MongoDB
- Pathfinding: Grid-based Dijkstra and A* algorithms
- API: RESTful endpoints for navigation, search, and admin operations
- Framework: React Native with Expo
- Map Library: Leaflet
- Navigation: React Navigation
- State Management: React Context API
- Framework: React with TypeScript
- Build Tool: Vite
- Python 3.8+
- Node.js 16+
- MongoDB (local or cloud instance)
- Expo CLI (for mobile development)
- Navigate to the backend directory:
cd backend_pirates_way_finder- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
# Create a .env file with your MongoDB connection string
MONGODB_URI=your_mongodb_connection_string- Run the backend server:
python main.py
# Or
uvicorn main:app --reloadThe backend will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend_pirates_way_finder- Install dependencies:
npm install- Configure API URL in
api/mapApi.js:
const BASE_URL = "http://your-backend-ip:8000";- Start the Expo development server:
npm start- Navigate to the admin directory:
cd pirates-admin- Install dependencies:
npm install- Start the development server:
npm run devThe application uses grid-based pathfinding with two algorithm options:
- Type: Uninformed search algorithm
- Guarantee: Finds the shortest path
- Use Case: General pathfinding when optimal path is required
- Time Complexity: O(V log V + E) where V is vertices and E is edges
- Type: Informed search algorithm with heuristic
- Heuristic: Manhattan distance
- Guarantee: Finds the shortest path (admissible heuristic)
- Advantage: Faster than Dijkstra by exploring toward the goal
- Time Complexity: O(V log V + E) with better average case performance
The pathfinding operates on a grid-based system:
- Cell Size: Configurable pixel-to-grid conversion
- Walkable Cells: Predefined walkable areas loaded from JSON
- Wall Detection: Automatic wall detection for path optimization
- Accessibility Mapping: Special handling for ramps and stairs
When accessibility mode is enabled:
- Stair Avoidance: Paths automatically avoid stair cells
- Ramp Preference: Paths prefer ramp cells when available
- Cost Adjustment: Ramp cells have reduced cost (0.6 vs 1.0) to encourage their use
- Blocked Areas: Stair cells are marked as non-walkable
The algorithm includes several optimizations:
- Wall Penalty: Adds cost to cells near walls to keep paths centered in corridors
- Aesthetic Paths: Prefers paths that stay away from walls for better visual appearance
- Smoothing: Path reconstruction ensures smooth navigation
pirateswayfinder/
├── backend_pirates_way_finder/ # FastAPI backend
│ ├── app/
│ │ ├── core/ # Core functionality
│ │ ├── models/ # Database models
│ │ ├── routers/ # API routes
│ │ ├── services/ # Business logic (pathfinding)
│ │ └── static/ # Grid data and maps
│ └── main.py # Application entry point
├── frontend_pirates_way_finder/ # React Native mobile app
│ ├── app/ # Expo router pages
│ ├── components/ # React components
│ ├── api/ # API client
│ └── utils/ # Utility functions
└── pirates-admin/ # Admin dashboard
└── src/ # React components
POST /path/shortest- Calculate shortest path between two pointsGET /path/walkable-grid- Get all walkable grid cells
GET /map/nodes- Get all navigation nodesGET /map/edges- Get all navigation edges
GET /search?q={query}- Search for locations
POST /admin/nodes- Create/update nodesPOST /admin/edges- Create/update edgesGET /admin/audit-logs- View audit logs
cd backend_pirates_way_finder
python -m pytest app/test/cd frontend_pirates_way_finder
npm testThe grid system is configured in backend_pirates_way_finder/app/static/grid.json:
- Grid dimensions (width, height)
- Cell size in pixels
- Walkable cells
- Accessibility markers (ramps, stairs)
Update the API base URL in frontend_pirates_way_finder/api/mapApi.js:
const BASE_URL = "http://your-backend-ip:8000";
