- Install Python 3.6++
- Install MySQL/MariaDB/Percona
# Install pipenv
pip install pipenv
# Install Dependencies
pipenv install
- create a folder named "instance" in the root of the project's repository.
- create a file named "config.py" inside that "instance" folder.
The config which include sensitve data like password, secret, etc. should be put in this file.
open config.py inside instance folder and add "DATABASE" variable to the file.
# file: instance/config.py
DATABASE = {
'host': 'localhost',
'database': 'your_database',
'user': 'your_database_user',
'password': 'your_database_user_password',
'charset': 'utf8mb4',
'use_unicode': True
}
# Switch to pipenv enviroment
pipenv shell
# Running development server in osx/linux
export FLASK_APP=server
export FLASK_ENV=development
flask run
# Running development server in windows(CMD)
set FLASK_APP=server
set FLASK_ENV=development
flask run
# Running production server
pipenv run gunicorn -w 4 -b 127.0.0.1:5000 server.wsgi:app
** Go inside frontend folder **
- Install Node.js
- Install yarn
# Install dependencies
yarn install
# Start server
yarn serve
# Compile
yarn build
- Please put all static inside public folder of frontend folder since the production build will automatically put all file to the server when deploy in production mode.
- Use snake_case for function, method and variable name. Ex. foo_bar, ant_cat_dog
- Use PascalCase for class name. Ex. FooBar, AntCatDog
- 4 Tab spaces for every python files.
- Use space instead of tab character for indentation. (Python usually produce parsing error if we mix tabs and spaces).
- Just install editorconfig plugin for your code editor and everything should be okay.
- Please follow rule from "Prettier" code formatter.