-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration Guide
kavi castelo edited this page Apr 7, 2025
·
2 revisions
Note: Default configurations are set up for running the project on server.
https://github.com/kavicastelo/ai-geospatial-platform.git- Install Angular CLI 15.2.x
- Node version 16.19.0
- Java JDK 17
- Python 3.10
- Different runnable environment supportive IDEA (intellij ultimate is recommended)
- Move to the frontend branch
git switch frontend
- Move to the
clientdirectorycd client
- Navigates to
src\environment\environment.development.ts - Commented out the production base url and uncomment the local (
port 3269 is recommended and default) - Move to the client directory in terminal and run
npm install --forcecommand[!IMPORTANT] Use --force for install deprecated packages. don't use --legacy-peers
- Run
ng servecommand to start the development server - Project starts to run on
localhost:4200/port
Move to the backend branch
git switch backendYou have to change few files to run the project locally.
- AIModel.java (./src/main/java/com/api/air_quality/model/ai_models/AIModel.java)
- Comment out line 143 and 145.
- Uncomment line 142 and 144.
- All Python models except AIModelPython.py (./src/main/java/com/api/air_quality/python/*.py)
- Replace all file paths in
class *ModelPython:classes with actual file paths. - Ex:
"/app/AI_Models/airHumidity_model.pkl"to"./AI_Models/airHumidity_model.pkl"
- Replace all file paths in
- CorsConfig.java (./src/main/java/com/api/air_quality/CorsConfig.java)
- Uncomment line 17 and 29.
- Comment out line 18 and 30.
If you need to use your own localhost database,
- Create
.envfile in the root directory of the project. - Add
SPRINGBOOT_URL_PYTHONenvironment variable in.envfile. (Optional) - Add
PYTHON_EXE_PATHenvironment variable in.envfile. (Optional) - Add
DATABASEenvironment variable in.envfile. (DefaultUrban_Air) - Add
DATABASE_PORTenvironment variable in.envfile. - Add
DATABASE_URIenvironment variable in.envfile. - Add
SERVER_PORTenvironment variable in.envfile. (default 3269)
Add Environment for Python Models.
- <python.exe path to computer drive> -m venv venv
- source venv\bin\activate (Linux or Mac)
- .\venv\Scripts\activate (Windows)
- pip install -r requirements.txt (recommended)
- venv\Scripts\python.exe -m pip install -r requirements.txt (only if not working
pip install -r requirements.txt) - deactivate
Note
If you're facing any idea error, delete the .idea directory and rebuild the project