I have made a simple hierarchical list of our world with the following flow:
continents -> regions -> countries -> cities
This app keeps track of the user search order so that we could go back. Once the user selects the country, the user can add, delete and edit the city like city name, district and population. If there is an action done on the city, a notification will pop up indicating the changes persisted on the database. In order to keep performance in line, the results are paginated starting with regions.
Importing world database
- Ensure postgres software is installed on windows/linux.
- Create a new postgres database with the desired database name.
- Run
cd PATH-TO-POSTGRES-BIN-FOLDER
. - Run
psql -U USERNAME --file=PATH-TO\database\world.sql DESIRED_DATABASE_NAME
.
Backend
- Change database parameters inside
backend/app.py
if needed.
python -m venv python-backend
python-backend\Scripts\activate
cd backend
pip install -r requirements.txt
python app.py
Frontend:
- Change server url if needed in
frontend/src/parameters/parameters.js
cd frontend
npm install
npm start