Code Monkey home page Code Monkey logo

easyfile's Introduction

EasyFile

First you should clone this repo, and then do the following steps to run the backend and front end

Backend

  1. Enter the directory of backend(./backend)
  2. Install ghostscript, mysql and flask. If you are using ubuntu, you can run:
sudo apt install ghostscript mysql-server python3-flask
  1. Install the python package required by running:
pip3 install -r requirements.txt
  1. Setup mysql and create a database for this project
  2. Create temp folder storage folder in the root directory of backend
  3. 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
  1. Run flask init-db to create tables
  2. Run flask run

Frontend

  1. Enter the directory of frontend(./frontend)
  2. Install npm. If you are using ubuntu, you can install it by the following instruction:
sudo apt install npm
  1. Setup frontend by the following instructions:
npm install
npm install axios
  1. Begin to serve by the following command:
npm run serve

Deployment

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:

  1. Find all localhost:5000 in the code of file *.vue of frontend and replace them with ip:port(the ip address must can be access by the clients)
  2. Run the backend by flask run -p port -h 0.0.0.0 rather than above
  3. Build the frontend by:
npm run build
  1. 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)

easyfile's People

Contributors

rigellee avatar kite99520 avatar yibo-he avatar outerform avatar ber666 avatar tarataro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.