Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
pull_request:

jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure
run: cmake -S backend -B backend/build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build backend/build --parallel
- name: Test
run: ctest --test-dir backend/build --output-on-failure

frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Audit production dependencies
working-directory: frontend
run: npm audit --omit=dev --audit-level=high
- name: Lint
working-directory: frontend
run: npm run lint
- name: Build
working-directory: frontend
run: npm run build
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Local secrets and environment overrides
.env
.env.*
!.env.example
!**/.env.example

# Frontend dependencies and build output
node_modules/
dist/

# CMake and IDE build output
build/
cmake-build-*/
out/

# IDE and operating-system files
.idea/
.vscode/
.DS_Store
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

2 changes: 0 additions & 2 deletions .idea/CLionProjects.iml

This file was deleted.

588 changes: 0 additions & 588 deletions .idea/editor.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/jsLibraryMappings.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .vscode/c_cpp_properties.json

This file was deleted.

7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

28 changes: 0 additions & 28 deletions .vscode/tasks.json

This file was deleted.

49 changes: 34 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The interactive page is in Chinese.
## Features

### Core Functionality
- Interactive map display of Yingtan and Guixi cities using vue3-leaflet and OpenStreetMap
- Shortest path routing between two points using bidirectional A* algorithm
- Interactive map display of Yingtan and Guixi cities using Leaflet and OpenStreetMap
- Shortest path routing between two points using directed A* search
- Detailed navigation instructions with turn-by-turn guidance
- Path visualization on the map

Expand All @@ -24,7 +24,7 @@ The interactive page is in Chinese.

### Frontend
- Vue.js
- vue3-leaflet for map visualization
- Leaflet for map visualization
- Gaode Maps API for location services

### Backend
Expand All @@ -36,35 +36,54 @@ The interactive page is in Chinese.
- crow
- json
- leaflet
- vue3-leaflet
- Leaflet

## Setup and Installation

### Prerequisites (Recommended)
- Windows 11
- MinGW compiler
- CLion IDE
- Node.js and npm
- A C++17 compiler and CMake 3.16 or newer
- Node.js 20.19+ or 22.12+ and npm

### Backend Setup
1. Clone the repository
2. Open the project in CLion
3. Build the project
4. Run the backend server
2. Configure and build the project:
```bash
cmake -S backend -B backend/build
cmake --build backend/build
```
3. Run the backend from the repository root:
```bash
./backend/build/MapNavigation
```
Pass an OSM file as the first argument or set `MAP_NAVIGATION_OSM_PATH` to
override the default `backend/data/mapofyt.osm`. Deployment can also set
`MAP_NAVIGATION_ALLOWED_ORIGIN` and `MAP_NAVIGATION_BIND_ADDRESS`.

### Frontend Setup
1. Navigate to the frontend directory
2. Run the following command:
2. Copy `.env.example` to `.env.local`, create a Gaode JavaScript API key, and
set `VITE_AMAP_JS_KEY` and `VITE_API_BASE_URL`. Restrict the key to the exact development and
production domains in the Gaode console. For production, set
`VITE_AMAP_SERVICE_HOST` to a reverse proxy that stores the
`securityJsCode` server-side. The plaintext `VITE_AMAP_SECURITY_CODE`
fallback is intended for local development only. Values prefixed with
`VITE_` are embedded in the browser bundle and are not server secrets.
3. Run the following command:
```bash
npm ci
npm run serve
```
3. Access the application at http://localhost:8080/
4. Access the application at http://localhost:8080/

> Security: never commit real keys to this repository. If a key has already
> been committed, revoke or rotate it in the Gaode console; removing it from the
> latest source does not remove it from Git history.

## Technical Details

### Path Planning Algorithm
- Implements bidirectional A* algorithm with a heuristic weight of 1.1
- Uses KD-Tree for efficient node searching
- Implements A* path finding with one-way-road support
- Projects requested coordinates onto the nearest road segment
- Supports various road types with different speed limits
- Includes coordinate transformation between GCJ-02 and WGS-84 systems

Expand Down
1 change: 0 additions & 1 deletion backend/.idea/.name

This file was deleted.

2 changes: 0 additions & 2 deletions backend/.idea/MapNavigation.iml

This file was deleted.

Loading
Loading