https://github.com/evolutionary-algorithms-on-click/evolve_backend_python
Backend source code for evolve on click tool.
https://github.com/evolutionary-algorithms-on-click/evolve_backend_python
deap fast-api genetic-algorithm python
Last synced: about 1 year ago
JSON representation
Backend source code for evolve on click tool.
- Host: GitHub
- URL: https://github.com/evolutionary-algorithms-on-click/evolve_backend_python
- Owner: Evolutionary-Algorithms-On-Click
- License: gpl-3.0
- Created: 2024-10-21T05:06:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-28T06:29:07.000Z (about 1 year ago)
- Last Synced: 2025-01-28T10:33:53.702Z (about 1 year ago)
- Topics: deap, fast-api, genetic-algorithm, python
- Language: Python
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# How to setup locally?
1. Clone the repository
```git
git clone https://github.com/Evolutionary-Algorithms-On-Click/evolve-backend-python
```
2. Go to the backend directory
3. Create a virtual environment
```bash
python -m venv venv
```
4. Activate the virtual environment
macOS / Linux
```bash
source venv/bin/activate
```
windows
```bash
.\venv\Scripts\activate
```
> [!NOTE]
> To deactivate the virtual environment run
> ```bash
> deactivate
> ```
5. Install the dependencies
macOS and Linux
```bash
pip install -r requirements.txt
```
Windows
> [!IMPORTANT]
> - `uvloop` library is not needed in Windows, It can be removed from `requirements.txt`.
> - `pygraphviz` has some problems with windows so, [Refer for instructions](https://pygraphviz.github.io/documentation/stable/install.html).
1. Install Visual C/C++ from [here](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
2. Download and install [Graphviz for Windows 10 (64-bit)](https://gitlab.com/graphviz/graphviz/-/package_files/6164164/download).
3. Install PyGraphviz via
```bash
python -m pip install --config-settings="--global-option=build_ext" --config-settings="--global-option=-IC:\Program Files\Graphviz\include" --config-settings="--global-option=-LC:\Program Files\Graphviz\lib" pygraphviz
```
Update the requirements
```
pip freeze > requirements.txt
```
6. Start the FastAPI app
```bash
uvicorn main:app --reload
```
7. To run in production.
In Windows.
```bash
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
```
In Linux.
```bash
gunicorn main:app -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 -w 4
```