-
Notifications
You must be signed in to change notification settings - Fork 0
For Contributors Simulator QuickStart
-
Python: Version 3.11 (as specified in
Pipfile). - A terminal or command-line interface.
- Pipenv: For dependency management (installed below).
- Assumes the repository (
CS3300-Project) is already cloned.
-
Install Pipenv
pip install --user pipenv
Note: Ensure
~/.local/bin(or equivalent) is in yourPATH. On Windows, usepy -m pip install pipenv. -
Verify Python 3.11
python3 --version
If Python 3.11 is not installed, download it from python.org or use
pyenv.
This method starts both the simulator and the extractor from the root directory.
-
Navigate to Root Directory
cd /path/to/CS3300-Project -
Install Dependencies with Pipenv
pipenv install
This installs dependencies from
Pipfile(e.g.,fastapi,flask,h5py,pytest). -
Activate Virtual Environment
pipenv shell
-
Run the Project Assuming
main.pyin the root directory launches both components:python main.py
Note: The root
main.pylikely runs the extractor (possibly Flask on port 5000) and may launch the simulator separately. If it’s Flask-based (due toflask-socketioinPipfile), try:flask run --host=0.0.0.0 --port=5000
The simulator may need to be started separately (see Method 2). Check
main.pyor project documentation for exact commands. -
Access the Simulator API
- If the simulator runs on port 8000, open
http://localhost:8000/docs/apifor Swagger UI orhttp://localhost:8000/docs/printerfor the welcome page. - Test endpoints:
curl http://localhost:8000/api/v1/printer
- If the extractor runs on port 5000, check
http://localhost:5000for its interface.
- If the simulator runs on port 8000, open
This method starts only the simulator from the backend directory.
-
Navigate to Simulator Backend
cd /path/to/CS3300-Project -
Install Dependencies with Pipenv Use the root
Pipfile(copy it tosimulator/v2/backendif needed):pipenv install
Note: If a separate
Pipfileexists insimulator/v2/backend, use that instead. -
Activate Virtual Environment
pipenv shell
-
Run the Simulator
uvicorn simulator.v2.backend.main:app --host 127.0.0.1 --port 8000 --reload
-
--reload: Enables auto-reload for development. - The simulator runs on
http://127.0.0.1:8000.
-
-
Access the API
- Visit
http://127.0.0.1:8000/docs/apifor Swagger UI. - Go to
http://127.0.0.1:8000/docs/printerfor the welcome page. - Test endpoints:
curl http://127.0.0.1:8000/api/v1/printer
- Visit
To verify the simulator:
cd /path/to/CS3300-Project/simulator/v2/backend
pipenv run pytest tests/