Your simple, yet opinionated, boilerplate for Flask projects.
I've been using Flask for a while now, and I've found myself repeating the same steps over and over again when starting a new project. In order to save myself (and you) some time, I decided to create this boilerplate.
- User authentication (login, logout, register)
- 'Sane' defaults for Flask configuration
- A understandable project file structure
- A simple SQLite database (you can, of course, replace this with any other database that SQLAlchemy supports)
- Jinja2 templates with Flowbite (Tailwind) CSS (CDN version)
- A CLI for managing aspects of your project (use
kettle --help
to see the available commands)*
*In order to use kettle
, you will need to install it with pip install --editable cli
from the root directory of the project.
I'm assuming you have Python 3.11+ installed on your machine and that you are comfortable with using the command line on your machine.
- Clone this repository and
cd
into it - Create a virtual environment with
python3 -m venv venv
(orpython -m venv venv
if you're on Windows) and activate it withsource venv/bin/activate
(orvenv\Scripts\activate.bat
if you're on Windows) - Install the dependencies with
pip install -r requirements.txt
- Run the application with
flask run
(orpython -m flask run
if you're on Windows) - you can also append--debug
to enable debug mode - Open your browser and go to
http://localhost:5000
And voilĂ , you're ready to open this project in your favorite editor and start working on your next big thing!
If you have any suggestions or improvements, then feel free to open an issue or a pull request. I'll be happy to take a look at it!
The boiler, gears and download icon (as seen on the front page) are sourced from Icons8.
The CSS and UI is sourced from Flowbite, which is a library of components and layouts for Tailwind CSS.
The user profile avatars are sourced from UI Avatars.
See the requirements.txt
for the full list of libraries that is used.
The boilerplate is not licensed, however, the libraries used are. Please check the respective licenses for each library.
Disclaimer: Flask is a trademark of Pallets, and is not affiliated with this project in any way.