Skip to content

Commit

Permalink
Merge pull request #444 from kavicastelo/docs
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
kavicastelo authored Apr 29, 2024
2 parents 254fddb + dfe530b commit ff01bb0
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ target/
*.iml
*.ipr

### Environments ###
.env

### NetBeans ###
/nbproject/private/
/nbbuild/
Expand Down
1 change: 1 addition & 0 deletions .idea/codestream.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 40 additions & 2 deletions Docs/Config Guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Instructions:
*Note:* Default configurations are setup for running the project on server.
# Instructions to set up project to local:
*Note:* Default configurations are set up for running the project on server.

## Clone the repository:
```markdown
https://github.com/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform.git
```

## Pre requests
- 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)

## Frontend
- Move to the frontend branch
```markdown
git switch frontend
```
- Move to the `client` directory
```markdown
cd 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 --force` command
> [!IMPORTANT]
> Use --force for install deprecated packages. don't use --legacy-peers
- Run `ng serve` command to start the development server
- Project starts to run on `localhost:4200/` port

## Backend
Move to the `backend` branch
```markdown
git switch backend
```

You have to change few files to run the project locally.
1. AIModel.java (*./src/main/java/com/api/air_quality/model/ai_models/AIModel.java*)
Expand Down Expand Up @@ -28,3 +63,6 @@ Add Environment for Python Models.
- 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
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,84 @@
# Urban Air Quality Monitoring and Prediction System

![commit activity](https://img.shields.io/github/commit-activity/y/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform/main)
![GitHub language count](https://img.shields.io/github/languages/count/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform/ci.yml?branch=main&label=CI%2FCD%20workflow)
![Netlify](https://img.shields.io/netlify/84cd0792-91fd-49b8-9fe9-bc52d7e78a3d)
![Website](https://img.shields.io/website?url=https%3A%2F%2Furban-air-quality-monitor.netlify.app)
![GitHub License](https://img.shields.io/github/license/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform)
![GitHub Release](https://img.shields.io/github/v/release/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform)


## System Config
*Note:* Default configurations are set up for running the project on server.

## Clone the repository:
```markdown
https://github.com/kavicastelo/Ethical-AI-driven-Geographic-Analytics-Platform.git
```

## Pre requests
- 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)

## Frontend
- Move to the frontend branch
```markdown
git switch frontend
```
- Move to the `client` directory
```markdown
cd 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 --force` command
> [!IMPORTANT]
> Use --force for install deprecated packages. don't use --legacy-peers
- Run `ng serve` command to start the development server
- Project starts to run on `localhost:4200/` port

## Backend
Move to the `backend` branch
```markdown
git switch backend
```

You have to change few files to run the project locally.
1. 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**.
2. 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"`
3. 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 `.env` file in the root directory of the project.
- Add `SPRINGBOOT_URL_PYTHON` environment variable in `.env` file. (Optional)
- Add `PYTHON_EXE_PATH` environment variable in `.env` file. (Optional)
- Add `DATABASE` environment variable in `.env` file. (Default `Urban_Air`)
- Add `DATABASE_PORT` environment variable in `.env` file.
- Add `DATABASE_URI` environment variable in `.env` file.
- Add `SERVER_PORT` environment variable in `.env` file. (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

## Data Dictionaries

### 1. Air Quality Data
Expand Down Expand Up @@ -29,7 +108,7 @@
- **location:** Geographic location for which land use information is provided.
- **land_type:** Type of land use (e.g., Residential, Commercial, Industrial, Park).

## Routes
## Open APIs
### Basic CRUD
1. Air Quality
- /api/v1/saveAirQuality
Expand Down

0 comments on commit ff01bb0

Please sign in to comment.