This project was bootstrapped with Create React App.
All frontend files are in folder "city-graph". Make sure you had already installed needed dependencies (by running: yarn install). Also make sure you had started the backend server to receive requests from frontend. To run the project you need to run a command below:
After you would have to generate some number of nodes upon which algorithms would do their stuff (step 1 in a picture below) and after press the button "Сгенерировать на карте"(step 2) for the actual generation to take place.
Then run any algorithm on these generated nodes by pressing the corresponding buttons below
In the project directory, you can run:
Installs all necessary dependencies
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
All backend files are in folder "city-graph-backend". Make sure you had already installed all necessary packages (by running: pip install -r requirements.txt). To run the backend server you would need to run the command:
Install necessary dependencies with pip:
app = Flask(__name__)
app.config['DEBUG'] = True
app = Flask(__name__ )
app.config.from_pyfile('config.Development.cfg')
$ python webapp/run.py
In flask, Default port is 5000
Swagger document page: http://127.0.0.1:5000/api
** Run with gunicorn **
In webapp/
$ gunicorn -w 4 -b 127.0.0.1:5000 run:app
- -w : number of worker
- -b : Socket to bind
$ docker build -t flask-example .
$ docker run -p 5000:5000 --name flask-example flask-example
In image building, the webapp folder will also add into the image
$ nosetests webapp/ --with-cov --cover-html --cover-package=app
- --with-cov : test with coverage
- --cover-html: coverage report in html format
Offical Website
Tutorial