Updated: 18.10.2018 by HaoHao
- Install dependencies via:
pip install -r requirements.txt
- Delete
app.db
anddatabase.db
in root folder if there is any. - Delete
migrations/
folder if there is any. - Run the following to initailize databases:
flask db init
flask db migrate
flask db upgrade
- Populate the database with some dummy accounts:
python db_test.py
- Run the main application:
python app.py
- Open
localhost:5000
in your browser to view the login page. And enjoy!
The file db_test.py
creates dummy accounts for login.
You can use either one of the following to login
(Username, Password, Role):
admin_test admin_test Admin
call_operator_test call_operator_test Call Operator
government_agency_test government_agency_test Government Agency
After successful login, you will be redirected to the dashboard route at localhost:5000/dashboard
.
For each subsystem, the file structure is organized as below:
Subsystem-Name
-- templates
-- static (if any)
-- subsystem-logic-controller.py
Only app.py
and its dependencies lie at the root directory.
Minimum code changes are made for docking each subsystem in. Often, the changes are (i) change Flask app into Blueprint and register to main app; (ii) extend dashboard-base.html to each .html template file.
Open doc/index.html to check documentations.