Show your current location on a map 🌍.
To run the app in a Docker container on your machine:
- Install Docker
[https://docs.docker.com/desktop/] runs on Linux, Mac, and Windows.
-
Clone the Repository
Clone the repo to your local machine:
git clone https://github.com/groda/locate-me-now.git
-
Change Directory
Navigate into the project directory:
cd locate-me-now
-
Build the image and launch the container
docker compose up --build -d
- **Open http://localhost:3000/ in your browser
The port Dockerfile
, compose.yml
, and in server.js
.
- Stop/restart
Stop the container with:
docker compose down
Start (without re-building image):
docker compose up -d
This guide is for Mac OS. Follow these steps to run the app locally on your machine:
-
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`
-
(Optional) Use Specific Node Version
Not sure if this is required, but if needed:
nvm use 20.17.0
-
Install Express
To install the required dependencies:
npm install express
-
Clone the Repository
Clone the repo to your local machine:
git clone https://github.com/groda/locate-me-now.git
-
Change Directory
Navigate into the project directory:
cd locate-me-now
-
Start the App
Run the app with the following command:
node server.js
-
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! 🌐
Simply click the link below to run the app 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. 💡
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! 🌍📍