Skip to content

groda/locate-me-now

Repository files navigation

locate-me-now

🚀 Where Am I?

Show your current location on a map 🌍.

🌐 Run in CodeSandbox

Edit my-codesandbox-app

🐳 Run in Docker

To run the app in a Docker container on your machine:

  1. Install Docker

[https://docs.docker.com/desktop/] runs on Linux, Mac, and Windows.

  1. Clone the Repository

    Clone the repo to your local machine:

    git clone https://github.com/groda/locate-me-now.git
  2. Change Directory

    Navigate into the project directory:

    cd locate-me-now
  3. Build the image and launch the container

docker compose up --build -d
  1. **Open http://localhost:3000/ in your browser

The port $3000$ is hard-coded in Dockerfile, compose.yml, and in server.js.

  1. Stop/restart

Stop the container with:

docker compose down

Start (without re-building image):

docker compose up -d

💻 Run on Your Local Machine

This guide is for Mac OS. Follow these steps to run the app locally on your machine:

  1. Download Node.js®

    Get Node.js from here. (For Mac, I recommend v20.17.0 (LTS) / macOS / using nvm for version management.)

    Open your terminal and run the following commands:

    # Install nvm (Node Version Manager)
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
    
    # Download and install Node.js (may require restarting the terminal)
    nvm install 20
    
    # Verify the correct version of Node.js
    node -v # should output `v20.17.0`
    
    # Verify the correct version of npm
    npm -v # should output `10.8.2`
  2. (Optional) Use Specific Node Version

    Not sure if this is required, but if needed:

    nvm use 20.17.0
  3. Install Express

    To install the required dependencies:

    npm install express
  4. Clone the Repository

    Clone the repo to your local machine:

    git clone https://github.com/groda/locate-me-now.git
  5. Change Directory

    Navigate into the project directory:

    cd locate-me-now
  6. Start the App

    Run the app with the following command:

    node server.js
  7. Access the App

    Once the app starts, you should see a message like: Your app is listening on port 3000. Open http://127.0.0.1:3000 in your browser to view the app in action! 🌐

🌐 Run on Glitch

Simply click the link below to run the app on Glitch:

Locate Me Now on Glitch 🚀

Note: The app is hosted on Glitch, which will be shutting down its app hosting infrastructure soon. Please refer to the announcement for more details. In the future, I might need to consider migrating to another hosting platform. 💡

🛰️ How It Works

The app uses the Geolocation API provided by modern browsers to determine your current location. It leverages the getCurrentPosition() function, which you can learn more about in the MDN documentation. This function retrieves the geographic location of your device, allowing the app to display your position on a map! 🌍📍

About

Show your location on a map

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published