sumn2u / annotate-lab

Create image annotations. Classify and tag images using polygons, bounding boxes, or circles. 🖼️✏️📑
https://annotate.dwaste.live
Other
76 stars 16 forks source link

[feature request] Add a .bat file to run the client, server and the localhost. Or add to the documentation suggestion. #137

Closed leo-smi closed 1 week ago

leo-smi commented 2 weeks ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

cd client
start cmd /k "npm install & start http://localhost:5174/ & npm start"
cd ../server
start cmd /k "flask run"
pause

image

PS: I can't try a batch file for linux for now...

sumn2u commented 2 weeks ago

@leo-smi I can take care of linux. Can you create a .bat for the windows?

leo-smi commented 2 weeks ago

@leo-smi I can take care of linux. Can you create a .bat for the windows?

sure

sumn2u commented 2 weeks ago

@leo-smi I can take care of linux. Can you create a .bat for the windows?

sure

Thanks. BTW, don't we have to include the python package installation here?

cd client
start cmd /k "npm install & start http://localhost:5174/ & npm start"
cd ../server
start cmd /k "flask run"
pause
leo-smi commented 2 weeks ago

@leo-smi I can take care of linux. Can you create a .bat for the windows?

sure

Thanks. BTW, don't we have to include the python package installation here?

cd client
start cmd /k "npm install & start http://localhost:5174/ & npm start"
cd ../server
start cmd /k "flask run"
pause

yes, I will do some tests for requiremtns.txt.

leo-smi commented 2 weeks ago

lmao I'm a newbie to git

image

BTW here is the code for bat file:

filename: RUN_ON_WINDOWS.bat

cd client
start cmd /k "npm install & start http://localhost:5174/ & npm start"
cd ../server
start cmd /k "pip install -r requirements.txt & flask run"
pause
sumn2u commented 2 weeks ago

Thanks for the code. You have to create a branch and make a commit there.

sumn2u commented 2 weeks ago

@leo-smi Can you check If this code works in windows?

cd client

start cmd /k "npm install && start http://localhost:5174/ && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause
leo-smi commented 2 weeks ago
cd client

start cmd /k "npm install && start http://localhost:5174/ && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause

sure, I will try it.

leo-smi commented 2 weeks ago

@leo-smi Can you check If this code works in windows?

cd client

start cmd /k "npm install && start http://localhost:5174/ && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause

kind worked but I have no idea why the script changed the port to 5173

image

leo-smi commented 2 weeks ago

the env worked fine

image

sumn2u commented 2 weeks ago

@leo-smi Can you check If this code works in windows?

cd client

start cmd /k "npm install && start http://localhost:5174/ && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause

kind worked but I have no idea why the script changed the port to 5173

image

@leo-smi The npm start command starts the application using port 5173 which is defined here. Think we can remove the start http://localhost:5174/.

Can you check one more time with below code?

cd client

start cmd /k "npm install && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause
leo-smi commented 2 weeks ago

@leo-smi The npm start command starts the application using port 5173 which is defined here. Think we can remove the start http://localhost:5174/.

Can we keep like below? the code is to open the browser page. Once the port will not change I think is a gain time.

cd client

start cmd /k "npm install && start http://localhost:5173/ && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause
leo-smi commented 2 weeks ago

The server page keeps loading and don't open. Now the server is running at http://localhost:5174/ . So you can remove the line start http://localhost:5173/ for now. For some reason the port keep changing.

cd client

start cmd /k "npm install && npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

start cmd /k "call venv\Scripts\activate && pip install -r requirements.txt && flask run"

pause

image

leo-smi commented 2 weeks ago

Is there a way to kill the client when closing the prompt? I have two clients running at http://localhost:5175/ and http://localhost:5174/ and I think there's a third running at http://localhost:5173/

image

sumn2u commented 2 weeks ago

This code should do the job.

cd client
npm install

start "Client" cmd /c "npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

call venv\Scripts\activate
pip install -r requirements.txt

start "Server" cmd /c "flask run"

pause

taskkill /FI "WINDOWTITLE eq Client"
taskkill /FI "WINDOWTITLE eq Server"
leo-smi commented 2 weeks ago

This code should do the job.

cd client
npm install

start "Client" cmd /c "npm start"

cd ../server

IF NOT EXIST venv (
    python -m venv venv
)

call venv\Scripts\activate
pip install -r requirements.txt

start "Server" cmd /c "flask run"

pause

taskkill /FI "WINDOWTITLE eq Client"
taskkill /FI "WINDOWTITLE eq Server"

Did not work. The prompts windows just closed all.

leo-smi commented 1 week ago

I tried a lot of codes and nothing is working properly. Once the node task is killed, opening a new client do not load the webpage. Even finding the specific PID of the client port.

I suggest removing the batch files for now and open to the future as a project.

If you want to keep the linux batch is up to you.

Thanks!

sumn2u commented 1 week ago

Thanks for trying. I'm removing both the script for now as it doesn't make sense to have support for one but not for other.