This application offers a simplistic way of visualising locations mentioned in text, or to visualice locations based on questions. This is done by creating interaktive pins on a map based on mentioned locations.
Requirements
Install Miniconda: Download and install Miniconda from Miniconda website.
Acqurie a mapbox token
If creating account
Locate the startup.bat
in the \
(root) directory of the project. When you have located the file, you have three options depending on your case.
Options
If using file explorer, click and start the startup.bat
file like any other program.
If using the terminal use the command run startup.bat
This works using the built-in terminal within an IDE as well.
If using Visual Studio Code using an batch runner extension, select the script in the internal file explorer and run the file with the start button in the upper right corner, below - [] x
in the application.
You are now done with the automatic startup, and will see two terminals appear, those are the local servers for front and backend respectively. After a small wait the browser will open two tabs: The website itself & Backend API documentation
[!Note] When the script is running, during first time install:
- The script may exit if you don't have conda pre-installed
- You may be prompted to provide the
Mapbox Default public token
, paste and press enter.- You may be prompted with one
y/n
in the terminal. Typey
and press enter.
This script automates the setup process for your project on Linux and Mac systems. It sets up your environment, installs dependencies, and starts your project.
startup.sh
ScriptYou need to locate the startup.sh
script in the root directory of your project.
Open Terminal: You can find it in the Applications folder or search for it using Spotlight (Command + Space).
Navigate to the directory where your startup.sh
script is located. For example, if it's in your project root directory, you can use the cd
command:
Make sure the script is executable: with chmod +x startup.sh
Run the script using the following command: ./startup.sh
Follow the instructions prompted and it should run.
You will need a .env file with your OPEN_API_KEY in the root of the project, like this: OPENAI_API_KEY=
Also need a .env.local with your NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN in the frontend folder. It should look something like this NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=
You run docker-compose.yml
with docker-compose up --build.
Open localhost and it should be up and running.
Create a Conda Environment:
Please make sure to be in the directory you want to set the project up in!
conda create --name YOUR_ENV_NAME
conda activate YOUR_ENV_NAME
conda install yarn
conda install pip
Set up OpenAI API-key
In Windows, search for Edit the system environment variables. In the new window, go to Environment Variables. Under User variables for User, click New. Fill out the following information:
Variable name: OPENAI_API_KEY
Variable value: *your OPENAI API key*
Create an identical variable name and value under System variables.
If you later get an error that the API key is not found, restart your shell and make sure everything is typed correctly.
To run Backend
cd backend
pip install -r requirements.txt
uvicorn main:app --reload
[!Note] Open a new terminal to progress, remember to acticate the conda conda environment in this terminal as well
Set up Mapbox API key
In directory "frontend", create a file named .env.local
.
Add and modify the following line:
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN='Your Mapbox Default public token'
NEXT_PUBLIC_BACKEND_URL='Your Backend Url. http://localhost:8000 for example'
To Run Frontend
cd frontend
yarn install
yarn dev