You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Condition Repository is an online application designed to extract, store, and present environmental assessment conditions from PDF documents.
6
5
7
-
`cd EPIC.conditions`
8
-
6
+
### Key Benefits
7
+
-**Conditions Repository**: A single repository providing access to all conditions across multiple projects
8
+
-**Consolidated Conditions View**: Enables viewing of all conditions for a project, including amendments to the original condition documents, in a unified format
9
9
10
-
2. Set up a virtual environment:
11
-
12
-
`python -m venv venv`
10
+
## Condition Repository Setup Instructions
13
11
14
-
3. Activate the virtual environment:
15
-
- On Windows:
16
-
17
-
`venv\Scripts\activate`
18
-
- On Linux/MacOS:
19
-
20
-
`source venv/bin/activate`
12
+
This document outlines the setup instructions for both the backend and front-end components of the project. Ensure you follow the steps in sequence for a smooth setup.
21
13
22
-
4. Install the required packages:
23
-
24
-
`pip install -r requirements.txt`
14
+
## Backend Setup
15
+
See [API Application Readme](condition-api/README.md)
16
+
17
+
## Front End Setup
18
+
See [Web Application Readme](condition-web/README.md)
25
19
26
-
5. Create a file named `.env` in the root directory of the project and add your OpenAI API key:
27
-
```text
28
-
OPENAI_API_KEY=openai_api_key_here
29
-
```
30
20
31
21
## Usage
32
22
33
23
### Individual PDFs:
34
24
35
-
Follow the [condition-parser README](./condition-parser) to extract info and get a JSON.
36
-
37
-
Follow the [condition-lib README](./condition-lib) to add the extracted JSON to the PostgreSQL database.
25
+
### Extracting conditions and related details from PDF documents
26
+
See [Data Extractor Readme](condition-parser/README.md)
38
27
39
-
*Note: gradio_ui.py in this directory is depreciated.*
28
+
### Importing extracted conditions into the database
29
+
See [Data Loader Readme](condition-loader/README.md)
40
30
41
31
### Multiple PDFs (Batch Processing):
42
-
43
-
See [batch processing README](./batch_api_calling).
32
+
See [Batch Processing README](./batch_api_calling).
44
33
45
34
For verifying the output of a batch, see [manual verification README](./batch_api_calling/manual_verification/).
46
35
36
+
*Note: gradio_ui.py in this directory is depreciated.*
37
+
38
+
## Directory Structure
39
+
40
+
.github/ - PR, CI action workflows and Issue templates
41
+
/docs - Miscellaneous documentations
42
+
condition-web/ - Condition Web application root
43
+
└── src/ - React.js application
44
+
condition-api/ - Condition API Application Root
45
+
├── src/ - Python flask application
46
+
│ └── met_api/ - Models, Resources and Services
47
+
└── migrations - Database migration scripts
48
+
└── tests/ - API application tests
49
+
└── unit/ - Python unit tests
50
+
condition-loader/ - Module for loading extracted conditions into the database
51
+
├── condition_jsons/ - Collection of extracted condition JSON files
52
+
└── loadConditions - Script for importing the extracted conditions into the database
53
+
condition-parser/ - Module for extracting conditions and related details from PDF documents.
54
+
openshift/ - OpenShift templates and documentation
@@ -57,3 +66,19 @@ For verifying the output of a batch, see [manual verification README](./batch_ap
57
66
-[OpenAI function calling documentation](https://platform.openai.com/docs/guides/function-calling)
58
67
-[OpenAI API reference](https://platform.openai.com/docs/api-reference/chat)[.](https://github.com/user-attachments/assets/cac337de-097d-4bfb-b946-56b98a2f1e1d)
- Run `make setup` in the root of the project (condition-api)
14
-
* Start the databases
15
-
- Run `docker-compose up` in the root of the project (condition-api)
7
+
## Backend Setup in WSL
16
8
17
-
## Environment Variables
9
+
## Step 1. Install Python 3.12.4
10
+
Ensure Python 3.12.4 is installed in your WSL environment. Download it from the [official Python website](https://www.python.org/downloads/release/python-3124/).
18
11
19
-
The development scripts for this application allow customization via an environment file in the root directory called `.env`. See an example of the environment variables that can be overridden in `sample.env`.
12
+
## Step 2. Set Up PYTHONPATH
13
+
Add the following line to your `.bashrc` or `.zshrc` file to set the `PYTHONPATH` environment variable:
Create a `.env` file in your condition-api with the necessary configurations. Reference sample.env to see what variables you need to configure
22
18
23
-
### Development
19
+
## Step 4. Start Docker Compose
20
+
In a separate terminal, launch Docker Compose to set up your containers:
21
+
docker-compose up
24
22
25
-
The following commands support various development scenarios and needs.
26
-
Before running the following commands run `. venv/bin/activate` to enter into the virtual env.
23
+
## Step 5. Run Setup
24
+
Navigate to your project directory and run the setup command to prepare your development environment:
25
+
make setup
27
26
27
+
## Step 6. Run Server
28
+
Once the setup is completed use make run to start the server:
29
+
make run
28
30
29
-
> `make run`
30
-
>
31
-
> Runs the python application and runs database migrations.
31
+
32
+
## Backend Setup on Windows
33
+
34
+
## Step 1: Download the Latest Python Version
35
+
36
+
1. Visit the official Python website: [Python Downloads](https://www.python.org/downloads/)
37
+
2. Download and install the latest version of Python for your operating system.
38
+
39
+
40
+
## Step 2: Set Environment Variables
41
+
42
+
1. Set the `FLASK_APP` and `FLASK_ENV` environment variables:
43
+
- set FLASK_APP=app.py
44
+
- set FLASK_ENV=development
45
+
46
+
2. Configure `PYTHONPATH` to your project's folder location up to `condition-api/src`:
47
+
- set PYTHONPATH=path\to\condition-api\src && PYTHONPATH=path\to\condition-api
48
+
49
+
## Step 3: Start Docker
50
+
51
+
1. Open a terminal.
52
+
2. Navigate to the `condition-api` directory:
53
+
cd condition-api
54
+
55
+
3. Run the following command to start the services using Docker Compose:
56
+
docker-compose up
57
+
58
+
## Step 4: Set Up `condition-api`
59
+
60
+
1. Open a separate terminal.
61
+
62
+
2. Navigate to the `` directory:
63
+
cd condition-api
64
+
65
+
3. Create a virtual environment. Refer to the official Python documentation on how to create a virtual environment: [Python venv](https://docs.python.org/3/library/venv.html).
66
+
- python -m venv venv
67
+
68
+
4. Activate the virtual environment:
69
+
- venv\Scripts\activate
70
+
71
+
5. Install the required Python packages from both `dev.txt` and `prod.txt` requirements files:
Runs the python application and runs database migrations.
32
80
Open [http://localhost:5000/api](http://localhost:5000/api) to view it in the browser.<br/>
33
-
> The page will reload if you make edits.<br/>
34
-
> You will also see any lint errors in the console.
35
81
36
82
> `make test`
37
83
>
@@ -45,6 +91,4 @@ Open [http://localhost:5000/api](http://localhost:5000/api) to view it in the br
45
91
46
92
### Visual Studio Code
47
93
48
-
Ensure the latest version of [VS Code](https://code.visualstudio.com) is installed.
49
-
50
-
The [`launch.json`](.vscode/launch.json) is already configured with a launch task (CONDITION-API Launch) that allows you to launch chrome in a debugging capacity and debug through code within the editor.
94
+
Ensure the latest version of [VS Code](https://code.visualstudio.com) is installed.
0 commit comments