Welcome to the OptiMaze! This project consists of a maze-solving game built with Spring Boot for the backend and React for the frontend. Players can navigate through a maze to reach the destination while visualizing their path and the optimal path.
- Java 17
- Spring Boot
- JUnit
- Mockito
- Swagger
There are two main algorithms used:
- The first algorithm is used for maze generating. It is a randomized depth-first search. It goes through all the possible cells in unfilled maze, creating paths in random directions, until it fills every single cell. After that there is an algorithm that creates 'circles', which are actually just for making more possible paths from start to finish.
- The second algorithm is used for maze solving. It is a breadth-first search. It goes through all the cells and all the passages one-by-one, filling cells with distances from current cell to start. It does that until it reaches the finish. After that the algorithm goes from finish to start, choosing the cell with the shortest distance to the start each time. That's how the shortest path is found.
- React.js
- Material UI
- Emotion
- Axios
To run the project locally for development, follow these steps:
git clone https://github.com/saatviknagpal/OptiMaze.git
- Open the backend project located in the
backend
directory using an IDE or code editor. - Run
mvn clean install
to install dependencies. - Run
mvn spring-boot:run
to start the development server.
- Open the frontend project located in the
frontend
directory using an IDE or code editor. - Run
npm install
to install dependencies. - Run
npm start
to start the development server.
Note! Dont forget to change backend url for post requests as you want to test it locally.
We use Swagger to provide detailed documentation for the backend API. Swagger UI allows you to explore and interact with the API endpoints directly from a web interface.
After running the backend Docker container (as explained in the Dockerization section), you can access the Swagger UI at http://localhost:8080/swagger-ui.html
.
Swagger UI provides a user-friendly way to visualize and test the API endpoints. It's a great tool for developers and testers to understand the available routes and their inputs/outputs.
You can access the OptiMaze game through the provided URL. You can interact with the maze, navigate through it using keyboard inputs, and observe your chosen path alongside the optimal path. The game offers a visual representation of the maze-solving process, providing an engaging and educational experience.
If you're interested in contributing to OptiMaze, feel free to submit pull requests or issues on our GitHub repository. We welcome your feedback and contributions to enhance the game.