- Add User Roles
- SETUP ADMIN: https://stackoverflow.com/questions/61939800/role-based-authorization-in-flask-login
https://flask.palletsprojects.com/ https://grobid.readthedocs.io/en/latest/Grobid-service/ https://pypi.org/project/grobid-client
https://www.digitalocean.com/community/tutorials/how-to-add-authentication-to-your-app-with-flask-login https://yasoob.me/posts/how-to-setup-and-deploy-jwt-auth-using-react-and-flask/ https://www.digitalocean.com/community/tutorials/how-to-structure-a-large-flask-application-with-flask-blueprints-and-flask-sqlalchemy
https://www.analyticsvidhya.com/blog/2019/06/comprehensive-guide-text-summarization-using-deep-learning-python/ https://arxiv.org/pdf/2008.03156v1.pdf https://en.wikipedia.org/wiki/ROUGE_(metric)#:~:text=ROUGE%2C%20or%20Recall%2DOriented%20Understudy,software%20in%20natural%20language%20processing.
👉 Step 1 - Start Grobid Service in
Docker
$ docker pull grobid/grobid:0.7.2
$ docker run --rm -p 8070:8070 grobid/grobid:0.7.2
👉 Step 2 - Start Redis Service in
Docker
$ docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
👉 Step 3 - Start Celery Service
$ celery --app apps.tasks worker --loglevel=info
👉 Step 4 Monitor Celery Tasks with Flower
$ celery -A apps.tasks flower --loglevel=info
👉 OR - Start the APP in
Docker
$ docker-compose up --build
Visit http://localhost:5085
in your browser. The app should be up & running.
Install modules via
VENV
$ virtualenv env
$ source env/bin/activate
$ pip3 install -r requirements.txt
Set Up Flask Environment
$ export FLASK_APP=run.py
$ export FLASK_ENV=development
Start the app
$ flask run
// OR
$ flask run --cert=adhoc # For HTTPS server
At this point, the app runs at http://127.0.0.1:5000/
.
Install modules via
VENV
(windows)
$ virtualenv env
$ .\env\Scripts\activate
$ pip3 install -r requirements.txt
Set Up Flask Environment
$ # CMD
$ set FLASK_APP=run.py
$ set FLASK_ENV=development
$
$ # Powershell
$ $env:FLASK_APP = ".\run.py"
$ $env:FLASK_ENV = "development"
Start the app
$ flask run
// OR
$ flask run --cert=adhoc # For HTTPS server
At this point, the app runs at http://127.0.0.1:5000/
.
The project is coded using blueprints, app factory pattern, dual configuration profile (development and production) and an intuitive structure presented bellow:
< PROJECT ROOT >
|
|-- apps/
| |
| |-- dashboard/ # A simple app that serve HTML files
| | |-- routes.py # Define app routes
| |
| |-- authentication/ # Handles auth routes (login and register)
| | |-- routes.py # Define authentication routes
| | |-- models.py # Defines models
| | |-- forms.py # Define auth forms (login and register)
| |
| |-- static/
| | |-- <css, JS, images> # CSS files, Javascripts files
| |
| |-- templates/ # Templates used to render pages
| | |-- includes/ # HTML chunks and components
| | | |-- navigation.html # Top menu component
| | | |-- sidebar.html # Sidebar component
| | | |-- footer.html # App Footer
| | | |-- scripts.html # Scripts common to all pages
| | |
| | |-- layouts/ # Master pages
| | | |-- base-fullscreen.html # Used by Authentication pages
| | | |-- base.html # Used by common pages
| | |
| | |-- accounts/ # Authentication pages
| | | |-- login.html # Login page
| | | |-- register.html # Register page
| | |
| | |-- dashboard/ # UI Kit Pages
| | |-- index.html # Index page
| | |-- 404-page.html # 404 page
| | |-- *.html # All other pages
| |
| config.py # Set up the app
| __init__.py # Initialize the app
|
|-- requirements.txt # App Dependencies
|
|-- .env # Inject Configuration via Environment
|-- run.py # Start the app - WSGI gateway
|
|-- ************************************************************************