grid
This repository houses a prototype of the Habitus user interface.
Installation
Implementation consists of two major components. Interaction with the web browser is programmed in JavaScript using React and everything that entails. This code lives in habitus_ui_interface-main/frontend/src. The natural language processing and clustering algorithms are implemented in Python and made accessible with uvicorn. Entrypoints for that code are contained in main2.py which quickly calls out to the backend. Here are some tips on getting all of this installed from a Linux perspective.
git clone https://github.com/Allegra-Cohen/grid
cd grid
sudo apt update
node -v
- Check to see that it is installed and version 14+. If so, the next step is not necessary.sudo apt install nodejs
- If the default version for your operating system is not new enough, additional preparations may be needed.sudo apt install npm
cd habitus_ui_interface-main/frontend
npm install
- This will create thenode_modules
directory.cd ..
python3 --version
- You'll need version 3.9+. If that's already the case, skip the next step.sudo apt install python3.9
- If this is not available, additional preparations will again be necessary.pip3 install uvicorn
pip3 install fastapi
pip3 install gensim
pip3 install pandas
pip3 install nltk
pip3 install sklearn
pip3 install spacy
python3 -m spacy download en_core_web_sm
cd backend
python3 control_panel.py
- Make sure the console version works before continuing with execution of the networked version.cd ..
Execution
Error messages resulting from the commands below probably indicate that prerequisites similar to the ones just described are not pre-installed on your computer. Some variation of the commands above will hopefully clear the errors.
- In the directory
habitus_ui_interface-main
runpython3 -m uvicorn --reload main2:app
. This will use port 8000 by default, so to avoid complaints, free up the port before executing the command. - In the directory
habitus_ui_interface-main/frontend
runnpm start
. This will start a web server on port 3000 and open a browser onhttp://localhost:3000
where you can observe the user interface.