- Clone this repo and create a virtual environment (
python3 -m venv venv
) for use with this application. - Activate the virtual environment (
source venv/bin/activate
) and runpip install -r requirements.txt
to install package dependencies. - Download the TailwindCSS standalone build tool and place the executable in the project folder.
- In one terminal - run
./tailwindcss -i ./app/static/src/css/tailwind.css -o ./app/static/src/css/index.css --watch
. This will start the Tailwind JIT Watcher and will compile your CSS on the fly. - In the second terminal - setup some ENV variables required to run the Flask application:
- Run
export FLASK_APP=run.py
(useset
instead ofexport
for windows) - Run
export FLASK_ENV=development
- Customise the application configuration in
config.py
as per your requirements - Run
flask db upgrade
to intialise database - Run
flask run
to start the Flask development server
- Run
- You can now add/remove CSS in your jinja templates, it will be auto-compiled by the compiler running in step 4. You will see the Tailwind CSS styles when you refresh your browser (Flask server) window.
- Before deploying to production:
- Stop the flask server and the Tailwind CLI build tool.
- Run
flask assets clean
followed byflask assets compile
to prepare the CSS and JSS assets for production
- Deploy to production. Enjoy!
blackbaba/Flask-Tailwind-SAAS-Starter-Template
SAAS Starter Template using Flask and TailwindCSS
PythonMIT