{"id":14065470,"url":"https://github.com/mcescalante/flask-base","last_synced_at":"2025-07-29T20:32:49.727Z","repository":{"id":50205009,"uuid":"78227185","full_name":"mcescalante/flask-base","owner":"mcescalante","description":"Flask boilerplate / base / starter project for any type of Flask application","archived":false,"fork":false,"pushed_at":"2022-12-08T00:44:59.000Z","size":205,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-14T07:08:55.372Z","etag":null,"topics":["flask","flask-boilerplate","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcescalante.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-06T18:01:24.000Z","updated_at":"2024-05-25T21:58:29.000Z","dependencies_parsed_at":"2023-01-25T01:31:34.239Z","dependency_job_id":null,"html_url":"https://github.com/mcescalante/flask-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcescalante%2Fflask-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcescalante%2Fflask-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcescalante%2Fflask-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcescalante%2Fflask-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcescalante","download_url":"https://codeload.github.com/mcescalante/flask-base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228046153,"owners_count":17861101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-boilerplate","python"],"created_at":"2024-08-13T07:04:30.573Z","updated_at":"2024-12-04T04:31:11.019Z","avatar_url":"https://github.com/mcescalante.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Flask Base\n\nThis is a strong Flask base/boilerplate focusing on simplicity, while still having modern tooling and following best web practices.\n\n![screenshot](https://mcescalante.com/flask-base.jpg)\n\n### Table of Contents\n\n- [Features](#features)\n    - [Libraries](#libraries)\n- [Quick Setup](#quick-setup)\n- [Running](#running)\n- Optional features\n    - [Alternate Database](#database-configuration)\n    - [Mail](#setting-up-mail)\n- [Deploying](#deploying)\n\n\n### Features\n\n- Always updated, production ready, modern tooling\n- Python 2 \u0026 3 both supported and tested\n- Basic User model with Login \u0026 Registration ready\n- Blueprint ready (see `app/account` for sample)\n\n#### Libraries\n\n- **Flask:** Flask-SQLAlchemy, Flask-WTF, Flask-Login, Alembic/Flask-Migrate\n- **JS \u0026 Frontend:** Bootstrap 4, Gulp, Livereload, and Webpack\n\n### Quick Setup\n\n```shell\n# Python\nvirtualenv venv\nsource venv/bin/activate\npip install -r requirements/base.txt\n\n# Database\npython manage.py db init\npython manage.py db migrate\npython manage.py db upgrade\n\n# Javascript \u0026 Frontend\nnpm i -g gulp webpack\nnpm install # or yarn\n\n# Create js bundle with webpack\nnpm run buildjs # non-minified\nnpm run buildprod # minified, prod-ready\n```\n\n### Running\n\n```shell\n# Python, serve the web app on localhost:5000\nsource venv/bin/activate\npython run.py\n\n# Livereload and SASS\ngulp\n\n# To recompile bundle.js (if you change app.js), run one the following:\nnpm run buildjs # dev, unminified\nnpm run buildprod # prod, minified\n# You can also run any actual webpack commands itself if you prefer or need to:\nwebpack app/static/js/app.js app/static/js/bundle.js\n\n# If you change your database models, you have to migrate and upgrade again:\npython manage.py db migrate\npython manage.py db upgrade\n```\n\n### Database configuration\n*Optional*\n\nThis boilerplate is ready for MySQL and Postgres, but uses sqlite by default. If you want to use something other than sqlite, you need to make a few small tweaks:\n\n1. Create your database\n2. In `app/config.py` you should comment the sqlite config line (11) and uncomment either mysql (19-20) or postgres (23-24). Make sure that you change the database name and add passwords or anything else you need to the connect string!\n3. Execute either `pip install -r requirements.txt/mysql.txt` or `pip install -r requirements.txt/postgres.txt` (while inside virtual environment) to install the libraries needed for each respective database.\n\n### Setting up mail\n*Optional*\n\nA lot of applications tend to use Flask-Mail and suggest to create a gmail address to send email with. While this works fine for small things, it isn't production-ready and Gmail doesn't exist to send transactional email (forgot password, confirm email, etc.). For this reason, my mail setup uses Sparkpost which has 100,000 emails per month for free. I am not sponsored or compensated in any way by Sparkpost. I have never exceeded this monthly limit, and the platform is rich and simple to use. It has reporting and other features that are great for real world applications.\n\n1. Create an account on sparkpost.com\n2. In your local environment, set the `SPARKPOST_API_KEY`:\n    `export SPARKPOST_API_KEY='yourkeyhere'`\n3. Update mail config variables in config.py \n4. All set!\n\nIf you use another transactional platform like Mandrill, it should be very simple to drop in here. Feel free to submit a PR with a new branch for any alternative email setups.\n\n### Deploying\n\nIn order to deploy, you need to move your entire application \u0026 database to a server or service (such as Heroku or Python Anywhere) and start it there.\n\nBasic instructions for a VPS can be found in [a gist here](https://gist.github.com/mcescalante/5db616b9a826605f1df35f79b09cf6f6) but automated scripting \u0026 more will be coming soon.\n\nMore coming soon!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcescalante%2Fflask-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcescalante%2Fflask-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcescalante%2Fflask-base/lists"}