A web-based implementation of A* search algorithm using Next.js, MongoDB, and Vercel.
This application implements a digital version of the A* pathfinding algorithm, featuring QR code-based navigation and user group management. The system is deployed using Vercel and uses MongoDB for data persistence.
- MongoDB Atlas account with a valid URI
- Node.js and Yarn package manager
- Python 3.x (for QR code generation)
Note: This step is only necessary if you're running the application locally. Skip if using the production COMP140 ASTAR URL.
-
Create a
.env.local
file in the root directory:MONGODBURI=your_mongodb_atlas_uri
-
Install dependencies and start the development server:
yarn install yarn dev
The development server will start at localhost:3000
or 0.0.0.0:3000
, connected to your MongoDB instance.
- Create and activate a Python virtual environment
- Install required dependencies:
pip3 install -r requirements.txt
-
Initialize the system by either:
- Scanning the
init.png
QR code, or - Navigating to
.../astarsearch:/initialize
orlocalhost:3000/initialize
(if running locally)
- Scanning the
-
Create an account and note your assigned color
-
Generate node QR codes using your group number based on this color mapping:
Yellow: 1 Red: 2 Green: 3 Blue: 4
Example: If assigned blue, use endpoint:
/check-route?node=A&number=4
-
Run the Python script to generate QR codes and begin scanning!
Each user is assigned to a color group upon initialization:
- Yellow (Group 1)
- Red (Group 2)
- Green (Group 3)
- Blue (Group 4)
- URL parameter encryption to enforce physical QR code scanning
- Help endpoint providing:
- Group color information
- Completed nodes
- Progress percentage
- Additional user assistance data
- Frontend: Next.js
- Database: MongoDB
- Deployment: Vercel
- QR Generation: Python
Feel free to submit issues and enhancement requests!