{"id":13806999,"url":"https://hack4impact.github.io/flask-base/","last_synced_at":"2025-05-13T23:33:57.467Z","repository":{"id":37550390,"uuid":"42793428","full_name":"hack4impact/flask-base","owner":"hack4impact","description":"A simple Flask boilerplate app with SQLAlchemy, Redis, User Authentication, and more.","archived":false,"fork":false,"pushed_at":"2024-03-21T18:09:44.000Z","size":14891,"stargazers_count":3043,"open_issues_count":4,"forks_count":481,"subscribers_count":89,"default_branch":"master","last_synced_at":"2024-11-11T22:40:31.239Z","etag":null,"topics":["authentication","boilerplate","database","flask","python3","redis","sqlalchemy","user-management"],"latest_commit_sha":null,"homepage":"http://hack4impact.github.io/flask-base","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hack4impact.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-19T23:33:33.000Z","updated_at":"2024-11-10T22:37:40.000Z","dependencies_parsed_at":"2024-08-01T16:40:36.680Z","dependency_job_id":"b480ce43-c35b-4cb2-9960-e7ea5428dd75","html_url":"https://github.com/hack4impact/flask-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact%2Fflask-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact%2Fflask-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact%2Fflask-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact%2Fflask-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hack4impact","download_url":"https://codeload.github.com/hack4impact/flask-base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225267435,"owners_count":17447154,"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":["authentication","boilerplate","database","flask","python3","redis","sqlalchemy","user-management"],"created_at":"2024-08-04T01:01:19.179Z","updated_at":"2024-11-18T23:30:35.161Z","avatar_url":"https://github.com/hack4impact.png","language":"Python","readme":"# flask-base\n\n![flask-base](readme_media/logo.png)\n\nA Flask application template with the boilerplate code already done for you.\n\n\n**Documentation available at [http://hack4impact.github.io/flask-base](http://hack4impact.github.io/flask-base).**\n\n## What's included?\n\n* Blueprints\n* User and permissions management\n* Flask-SQLAlchemy for databases\n* Flask-WTF for forms\n* Flask-Assets for asset management and SCSS compilation\n* Flask-Mail for sending emails\n* gzip compression\n* Redis Queue for handling asynchronous tasks\n* ZXCVBN password strength checker\n* CKEditor for editing pages\n\n## Demos\n\nHome Page:\n\n![home](readme_media/home.gif \"home\")\n\nRegistering User:\n\n![registering](readme_media/register.gif \"register\")\n\nAdmin Editing Page:\n\n![edit page](readme_media/editpage.gif \"editpage\")\n\nAdmin Editing Users:\n\n![edit user](readme_media/edituser.gif \"edituser\")\n\n\n## Setting up\n\n##### Create your own repository from this Template\n\nNavigate to the [main project page](https://github.com/hack4impact/flask-base) and click the big, green \"Use this template\" button at the top right of the page. Give your new repository a name and save it.\n\n##### Clone the repository \n\n```\n$ git clone https://github.com/YOUR_USERNAME/REPO_NAME.git\n$ cd REPO_NAME\n```\n\n##### Initialize a virtual environment\n\nWindows:\n```\n$ python3 -m venv venv\n$ venv\\Scripts\\activate.bat\n```\n\nUnix/MacOS:\n```\n$ python3 -m venv venv\n$ source venv/bin/activate\n```\nLearn more in [the documentation](https://docs.python.org/3/library/venv.html#creating-virtual-environments).\n\nNote: if you are using a python before 3.3, it doesn't come with venv. Install [virtualenv](https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv) with pip instead.\n\n##### (If you're on a Mac) Make sure xcode tools are installed\n\n```\n$ xcode-select --install\n```\n\n##### Add Environment Variables\n\nCreate a file called `config.env` that contains environment variables. **Very important: do not include the `config.env` file in any commits. This should remain private.** You will manually maintain this file locally, and keep it in sync on your host.\n\nVariables declared in file have the following format: `ENVIRONMENT_VARIABLE=value`. You may also wrap values in double quotes like `ENVIRONMENT_VARIABLE=\"value with spaces\"`.\n\n1. In order for Flask to run, there must be a `SECRET_KEY` variable declared. Generating one is simple with Python 3:\n\n   ```\n   $ python3 -c \"import secrets; print(secrets.token_hex(16))\"\n   ```\n\n   This will give you a 32-character string. Copy this string and add it to your `config.env`:\n\n   ```\n   SECRET_KEY=Generated_Random_String\n   ```\n\n2. The mailing environment variables can be set as the following.\n   We recommend using [Sendgrid](https://sendgrid.com) for a mailing SMTP server, but anything else will work as well.\n\n   ```\n   MAIL_USERNAME=SendgridUsername\n   MAIL_PASSWORD=SendgridPassword\n   ```\n\nOther useful variables include:\n\n| Variable        | Default   | Discussion  |\n| --------------- |-------------| -----|\n| `ADMIN_EMAIL`   | `flask-base-admin@example.com` | email for your first admin account |\n| `ADMIN_PASSWORD`| `password`                     | password for your first admin account |\n| `DATABASE_URL`  | `data-dev.sqlite`              | Database URL. Can be Postgres, sqlite, etc. |\n| `REDISTOGO_URL` | `http://localhost:6379`        | [Redis To Go](https://redistogo.com) URL or any redis server url |\n| `RAYGUN_APIKEY` | `None`                         | API key for [Raygun](https://raygun.com/raygun-providers/python), a crash and performance monitoring service |\n| `FLASK_CONFIG`  | `default`                      | can be `development`, `production`, `default`, `heroku`, `unix`, or `testing`. Most of the time you will use `development` or `production`. |\n\n\n##### Install the dependencies\n\n```\n$ pip install -r requirements.txt\n```\n\n##### Other dependencies for running locally\n\nYou need [Redis](http://redis.io/), and [Sass](http://sass-lang.com/). Chances are, these commands will work:\n\n\n**Sass:**\n\n```\n$ gem install sass\n```\n\n**Redis:**\n\n_Mac (using [homebrew](http://brew.sh/)):_\n\n```\n$ brew install redis\n```\n\n_Linux:_\n\n```\n$ sudo apt-get install redis-server\n```\n\nYou will also need to install **PostgresQL**\n\n_Mac (using homebrew):_\n\n```\nbrew install postgresql\n```\n\n_Linux (based on this [issue](https://github.com/hack4impact/flask-base/issues/96)):_\n\n```\nsudo apt-get install libpq-dev\n```\n\n\n##### Create the database\n\n```\n$ python manage.py recreate_db\n```\n\n##### Other setup (e.g. creating roles in database)\n\n```\n$ python manage.py setup_dev\n```\n\nNote that this will create an admin user with email and password specified by the `ADMIN_EMAIL` and `ADMIN_PASSWORD` config variables. If not specified, they are both `flask-base-admin@example.com` and `password` respectively.\n\n##### [Optional] Add fake data to the database\n\n```\n$ python manage.py add_fake_data\n```\n\n## Running the app\n\n```\n$ source env/bin/activate\n$ honcho start -e config.env -f Local\n```\n\nFor Windows users having issues with binding to a redis port locally, refer to [this issue](https://github.com/hack4impact/flask-base/issues/132).\n\n## Gettin up and running with Docker and docker-compose:\n\n##### Clone the repository \n```\n$ git clone https://github.com/YOUR_USERNAME/REPO_NAME.git\n$ cd REPO_NAME\n```\n##### Create and run the images:\n\n```\n$ docker-compose up\n```\n\n##### Create database and initial data for development:\n\n```\n$ docker-compose exec server ./init_database.sh\n```\n\nIt will deploy 5 docker images:\n\n- server: Flask app running in [http://localhost:5000](http://localhost:5000).\n- worker: Worker ready to get tasks.\n- postgres: Postgres SQL isolated from the app.\n- adminer: Web client for database management, running in [http://localhost:8080](http://localhost:8080).\n- redis: Redis SQL isolated from the app\n\n\n## Formatting code\n\nBefore you submit changes to flask-base, you may want to autoformat your code with `python manage.py format`.\n\n\n## Contributing\n\nContributions are welcome! Please refer to our [Code of Conduct](./CONDUCT.md) for more information.\n\n## Documentation Changes\n\nTo make changes to the documentation refer to the [Mkdocs documentation](http://www.mkdocs.org/#installation) for setup.\n\nTo create a new documentation page, add a file to the `docs/` directory and edit `mkdocs.yml` to reference the file.\n\nWhen the new files are merged into `master` and pushed to github. Run `mkdocs gh-deploy` to update the online documentation.\n\n## Related\nhttps://medium.freecodecamp.com/how-we-got-a-2-year-old-repo-trending-on-github-in-just-48-hours-12151039d78b#.se9jwnfk5\n\n## License\n[MIT License](LICENSE.md)\n","funding_links":[],"categories":["Projects"],"sub_categories":["Boilerplates"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/hack4impact.github.io%2Fflask-base%2F","html_url":"https://awesome.ecosyste.ms/projects/hack4impact.github.io%2Fflask-base%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/hack4impact.github.io%2Fflask-base%2F/lists"}