First you should clone this repo, and then do the following steps to run the backend and front end
- Enter the directory of backend(./backend)
- Install ghostscript, mysql and flask. If you are using ubuntu, you can run:
sudo apt install ghostscript mysql-server python3-flask
- Install the python package required by running:
pip3 install -r requirements.txt
- Setup mysql and create a database for this project
- Create
temp
folderstorage
folder in the root directory of backend - Create
instance/config.py
, and config following this template
DEBUG = False
SECRET_KEY = 'dev' # Just as an example, not the value we actually use
SALT = 'dev' # Just as an example, not the value we actually use
ACCESS_TOKEN_EXPIRES_IN = 1800
REFRESH_TOKEN_EXPIRES_IN = 86400
DATABASE = {
'host': 'localhost',
'port': 3306,
'user': 'root',
'passwd': 'my_pass_word_for_mysql',
'db': 'the_database_to_use'
}
TEMP_PATH = r'/.../temp' # must be a absolute path
STORAGE_PATH = r'/.../storage' # must be a absolute path
- Run
flask init-db
to create tables - Run
flask run
- Enter the directory of frontend(./frontend)
- Install npm. If you are using ubuntu, you can install it by the following instruction:
sudo apt install npm
- Setup frontend by the following instructions:
npm install
npm install axios
- Begin to serve by the following command:
npm run serve
If you are just testing it on your local computer, you can ignore the follow steps, and access localhost:8080
to use EasyFile
.
If you want to deploy this system on a server, you should do the follow things:
- Find all
localhost:5000
in the code of file*.vue
of frontend and replace them withip:port
(the ip address must can be access by the clients) - Run the backend by
flask run -p port -h 0.0.0.0
rather than above - Build the frontend by:
npm run build
- Setup a nginx server
(If you are not so sensitive to loading speed, you can ingore 3. and 4. and run front end by
npm run serve
)