The code for the server is located in the backend
directory.
-
Install Postgres.app and follow the instructions to add it to your path.
-
Set a
virtualenv
(optional) -
Install the OS & pip dependencies.
brew install gdal libgeoip
pip install -r requirements-test.txt
pip install -r requirements.txt
Running on M1 To run successfully on M1, set the following env vars
export GDAL_LIBRARY_PATH=/opt/homebrew/lib/libgdal.dylib
export GEOS_LIBRARY_PATH=/opt/homebrew/lib/libgeos_c.dylib
psql
CREATE DATABASE whereintheworld;
CREATE USER whereintheworld WITH PASSWORD 'whereintheworld';
GRANT ALL PRIVILEGES ON DATABASE whereintheworld TO whereintheworld;
Migrate the database and start the server
python manage.py migrate
python manage.py cities --import=all
python manage.py runserver
The server is now running at http://localhost:8000/
.
The code for the frontend is located in the src
directory. Once you launched the server, you can start it as follows:
yarn
yarn start
The app is now running, navigate to http://localhost:3000/
in your browser to explore its UI.