A web application that helps find the optimal path to collect treasures with minimum fuel consumption.
Before running the application locally, you need to install:
-
.NET 8.0 SDK
- Download from: https://dotnet.microsoft.com/download/dotnet/8.0
- After installation, verify by running:
dotnet --version
-
Node.js (v18 or later)
- Download from: https://nodejs.org/
- After installation, verify by running:
node --version
-
SQL Server
- Download SQL Server Express from: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
- Or SQL Server Developer Edition if you prefer
- Remember the connection string details you set during installation
-
Navigate to the API project directory:
cd TreasureHunt.API -
Make sure you have installed EF Core CLI:
dotnet tool install --global dotnet-ef
-
Create and update the database:
dotnet ef database update
-
Start the API:
dotnet run
The API will start at: https://localhost:7294
-
Navigate to the frontend project directory:
cd TreasureHunt.Frontend -
Install dependencies:
npm install
-
Start the frontend application:
npm start
The application will open at: http://localhost:3000
If you don't want to install the prerequisites, you can run the application using Docker:
-
Install Docker
- Download and install Docker Desktop from: https://www.docker.com/products/docker-desktop
- Start Docker Desktop
-
Run the Application
- Open a terminal in the project root directory
- Run the following commands:
docker-compose up -d --build
- Wait for the containers to start (this might take a few minutes on first run)
- Open your browser and navigate to: http://localhost
-
Stop the Application
docker-compose down
-
Enter Matrix Dimensions
- Rows (N): Enter the number of rows (maximum 500)
- Columns (M): Enter the number of columns (maximum 500)
- Max Chest Number (P): Enter the maximum chest number (maximum N*M)
-
Fill the Treasure Map Matrix
- Enter numbers from 1 to P in the matrix cells
- Each number represents a chest that must be collected in sequence
-
Solve
- Click the "SOLVE" button to find the optimal path
- The result will show the minimum fuel needed
-
View History
- Previous solutions are saved and displayed below
- Each entry shows the matrix size, number of chests, and result
- If you see a database connection error, ensure SQL Server is running
- If the frontend can't connect to the API, check if both applications are running
- For Docker issues, try:
docker-compose down docker system prune -f docker-compose up -d --build
If you encounter any issues or need help, please create an issue in the repository.
