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
feat: replace Flask backend with Node.js/Express (#269)
* feat: migrate Software Discovery Tool from Flask to Node.js/Express
- replace Flask backend with Express + MySQL API implementation
- move distro mapping to a single JSON source of truth
- restrict CORS via ALLOWED_ORIGINS and add backend tests
- add Node.js database build script and update docs
- remove deprecated Flask source tree
Signed-off-by: TusharB-07 <tusharnbiswas07@gmail.com>
* fix: add "type":"module", restore config_build.py, and update Installation.md
---------
Signed-off-by: TusharB-07 <tusharnbiswas07@gmail.com>
|[Software Discovery Tool](https://github.com/openmainframeproject/software-discovery-tool)| The main repository of the Software Discovery Tool contains the core functionalities and codebase of the tool. It enables you to search and discover open source software for `zArchitecture/s390x`. You'll find the source code, documentation, and guidelines for contributing to the project in this repository.|
16
-
|[Software Discovery Tool Data](https://github.com/openmainframeproject/software-discovery-tool-data)| The Software Discovery Tool Data repository holds the necessary data for the software available in the tool. It contains information such as the names and versions of the software that you can discover using the Software Discovery Tool. This data is regularly updated to provide you with the most comprehensive and up-to-date software inventory.|
13
+
| Repository | Description |
14
+
| ---------- | ----------- |
15
+
|[Software Discovery Tool](https://github.com/openmainframeproject/software-discovery-tool)| The main repository of the Software Discovery Tool contains the core functionalities and codebase of the tool. It enables you to search and discover open source software for `zArchitecture/s390x`. You'll find the source code, documentation, and guidelines for contributing to the project in this repository. |
16
+
|[Software Discovery Tool Data](https://github.com/openmainframeproject/software-discovery-tool-data)| The Software Discovery Tool Data repository holds the necessary data for the software available in the tool. It contains information such as the names and versions of the software that you can discover using the Software Discovery Tool. This data is regularly updated to provide you with the most comprehensive and up-to-date software inventory. |
17
17
|[Software Discovery Tool Deploy](https://github.com/openmainframeproject/software-discovery-tool-deploy)| The Software Discovery Tool Deploy repository serves as the deployed version of the main Software Discovery Tool repository. It utilizes the main repository as a submodule and integrates the data repository as a sub-submodule. This deployment repository enables you to quickly set up and run the Software Discovery Tool in your environment. Read more about it [here](https://gist.github.com/rachejazz/de39c09612788635d5d0f491dcf8571a). |
18
18
19
+
## Local Development Setup
20
+
21
+
To run the Software Discovery Tool locally for development:
22
+
23
+
### 1. Prerequisites
24
+
- Node.js (v18+) and npm
25
+
- MariaDB or MySQL server
26
+
- Python 3 (only if you need to run `bin/package_build.py`)
27
+
28
+
### 2. Database Setup
29
+
1. Create a database (e.g., `sdtDB`) and a user with `SELECT` permissions.
30
+
2. Clone the data submodules:
31
+
```bash
32
+
git submodule update --init --recursive
33
+
```
34
+
3. Install root dependencies:
35
+
```bash
36
+
npm install
37
+
```
38
+
4. (Optional) Fetch additional distro data (requires Python):
39
+
```bash
40
+
python3 bin/package_build.py debian
41
+
```
42
+
5. Initialize the database schema and populate data:
43
+
```bash
44
+
node bin/database_build.js
45
+
```
46
+
*Note: Use a privileged database user (like root) when prompted to create tables. This script uses the database configuration from `backend/.env`.*
47
+
48
+
### 3. Backend Setup
49
+
1. Navigate to the `backend` directory:
50
+
```bash
51
+
cd backend
52
+
```
53
+
2. Install dependencies:
54
+
```bash
55
+
npm install
56
+
```
57
+
3. Configure environment:
58
+
Copy `backend/.env.example` to `backend/.env` and fill in your database credentials:
59
+
```bash
60
+
cp .env.example .env
61
+
```
62
+
*Note: Set `ALLOWED_ORIGINS` to your frontend URL (e.g., `http://localhost:3000`) to enable CORS.*
63
+
4. Start the backend:
64
+
```bash
65
+
npm start
66
+
```
67
+
68
+
### 4. Frontend Setup
69
+
1. Navigate to the `react-frontend` directory:
70
+
```bash
71
+
cd react-frontend
72
+
```
73
+
2. Install dependencies:
74
+
```bash
75
+
npm install
76
+
```
77
+
3. Configure environment:
78
+
Copy `react-frontend/.env.example` to `react-frontend/.env`:
79
+
```bash
80
+
cp .env.example .env
81
+
```
82
+
Ensure `REACT_APP_API_URL` points to your backend (default `http://localhost:5000`).
83
+
4. Start the frontend:
84
+
```bash
85
+
npm start
86
+
```
87
+
88
+
The application will be available at `http://localhost:3000`.
89
+
19
90
## Contributing
20
91
21
92
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
0 commit comments