diff --git a/README.md b/README.md index 1982f9e..f3cdc16 100644 --- a/README.md +++ b/README.md @@ -20,20 +20,21 @@ A **lower Price/Review Score** indicates that the place is **not expensive**, ye ## How to Use the Web App ### Step 1: Set Up the Web App -1. **Install Docker Desktop** - - [Click here](https://www.docker.com/products/docker-desktop) to download Docker Desktop. +1. Install Docker Desktop + - [Click here](https://www.docker.com/products/docker-desktop) to download **Docker Desktop**. - Follow the instructions on the website to install it on your computer. -2. Download Web App Assets - - Click here to [Click here](https://github.com/sakan811/Find-the-Best-Place-to-Stay-with-Price-per-Review/releases/download/v8.0.3/find-place-web-app.zip) to download the web-app assets. - - Extract the ZIP file. +2. Download Docker Compose File + - Download the [docker-compose.yml](docker-compose.yml) file from this repository. + - Place the file in the directory of your choice. ### Step 2: Find Your User Agent 1. **Find Your User Agent** - Open your web browser and go to [What Is My Browser](https://www.whatismybrowser.com/detect/what-is-my-user-agent/). - - You will see a message that shows your User Agent. **Copy this text.** + - You will see a message that shows your User Agent. + - Copy the User Agent. 2. **Edit the Configuration File** - - Open the `docker-compose.yml` file you extracted from the ZIP file in a text editor (like Notepad). + - Open the `docker-compose.yml` file in a text editor (like Notepad). - Look for the line that says `USER_AGENT`. Replace `your_user_agent` text with the User Agent you copied. - Save the file and close the text editor. @@ -41,20 +42,23 @@ A **lower Price/Review Score** indicates that the place is **not expensive**, ye 1. **Start the Web App** - Make sure that the Docker Desktop is running. - If not, start the Docker Desktop. - - Double-click the executable file: - - **Windows:** Double-click `app-windows.exe` - - **macOS:** Double-click `app-mac` - - **Linux:** Double-click `app-linux` -2. **Check the Terminal**: - - A terminal window will open, indicating that the web app is starting. - You should see messages in the terminal that confirm the app is launching. - -3. **Access the Web App** + - Open the terminal + - Use the `cd` command to go to the folder where you saved the `docker-compose.yml` file. + Example: + ```bash + cd /path/to/directory + ``` + - Run `docker-compose up` to start the web app. + +2. **Access the Web App** - Open your web browser and go to: [http://localhost:5000/](http://localhost:5000/) -### Step 4: Exit the Web App -- Press `Enter` as prompted in the terminal. - - Alternatively, you can open Docker Desktop and stop the container from the **Containers** section. +### Step 4: Stop the Web App +1. **Open Docker Desktop** + - Go to the **Containers** section. + +2. **Stop the Container** + - Find the running container for the web app and click **Stop**. ## Disclaimer @@ -65,4 +69,4 @@ A **lower Price/Review Score** indicates that the place is **not expensive**, ye - If you leave this box unticked, the scraper will retrieve information on all types of places available through Booking.com in the specified city. - When entering the **country** in the form, please provide the **full name** of the country. - - **Do not** use abbreviations. + - **Do not** use abbreviations. \ No newline at end of file diff --git a/exe/docker-compose.yml b/docker-compose.yml similarity index 100% rename from exe/docker-compose.yml rename to docker-compose.yml diff --git a/exe/exe.go b/exe/exe.go deleted file mode 100644 index f3eca17..0000000 --- a/exe/exe.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "fmt" - "os" - "os/exec" - "path/filepath" -) - -// checkDockerRunning checks if Docker is running -func checkDockerRunning() bool { - cmd := exec.Command("docker", "info") - err := cmd.Run() - return err == nil // Return true if no error, meaning Docker is running -} - -func waitForUser() { - fmt.Println("Press 'Enter' to exit...") - fmt.Scanln() // Wait for user input -} - -func main() { - // Check if Docker is running - if !checkDockerRunning() { - fmt.Println("Error: Docker is not running. Please start Docker Desktop.") - waitForUser() // Keeps the terminal open - os.Exit(1) - } - - // Get the directory of the executable - exePath, err := os.Executable() - if err != nil { - fmt.Printf("Error getting executable path: %v\n", err) - waitForUser() - os.Exit(1) - } - exeDir := filepath.Dir(exePath) - - // Change to the directory of the executable - err = os.Chdir(exeDir) - if err != nil { - fmt.Printf("Error changing to executable directory: %v\n", err) - waitForUser() - os.Exit(1) - } - - // Run docker-compose in detached mode (-d flag) - cmd := exec.Command("docker", "compose", "up", "-d") - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - err = cmd.Run() - if err != nil { - fmt.Printf("Error running Docker Compose: %v\n", err) - waitForUser() - os.Exit(1) - } - - fmt.Println("Please navigate to \033[34mhttp://localhost:5000/\033[0m to access the web-app.") - fmt.Println("Docker containers are running in detached mode.") - waitForUser() // Wait for the user before closing the terminal -} diff --git a/exe/go.mod b/exe/go.mod deleted file mode 100644 index 082ae9a..0000000 --- a/exe/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module find-place-web-app - -go 1.23.1 diff --git a/frontend/package.json b/frontend/package.json index 64763e4..332bd97 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,7 +17,7 @@ "dependencies": { "@types/axios": "^0.14.0", "@vitest/expect": "^2.0.5", - "axios": "^1.7.2", + "axios": "1.7.4", "globals": "^15.9.0", "react": "^18.3.1", "react-bootstrap": "^2.10.4", @@ -42,7 +42,7 @@ "style-loader": "^4.0.0", "typescript": "^5.5.4", "typescript-eslint": "^8.6.0", - "vite": "^5.4.0", + "vite": "5.4.6", "vitest": "^2.1.1" }, "description": ""