{"id":16174968,"url":"https://github.com/app-generator/sample-flask-blueprints","last_synced_at":"2025-04-07T10:57:01.622Z","repository":{"id":100503240,"uuid":"358196919","full_name":"app-generator/sample-flask-blueprints","owner":"app-generator","description":"Flask Sample - Define a new Blueprint | AppSeed","archived":false,"fork":false,"pushed_at":"2024-01-05T07:41:25.000Z","size":12009,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T18:13:35.718Z","etag":null,"topics":["appseed-sample","blueprints","flask-blueprint","flask-blueprint-tutorial","flask-blueprints","flask-sample"],"latest_commit_sha":null,"homepage":"https://appseed.us/product/atlantis-dark/flask/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/app-generator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-04-15T09:11:22.000Z","updated_at":"2024-10-03T13:11:20.000Z","dependencies_parsed_at":"2023-05-15T11:15:33.135Z","dependency_job_id":null,"html_url":"https://github.com/app-generator/sample-flask-blueprints","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"app-generator/flask-atlantis-dark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-blueprints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-blueprints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-blueprints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-blueprints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/app-generator","download_url":"https://codeload.github.com/app-generator/sample-flask-blueprints/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640512,"owners_count":20971555,"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":["appseed-sample","blueprints","flask-blueprint","flask-blueprint-tutorial","flask-blueprints","flask-sample"],"created_at":"2024-10-10T04:43:52.147Z","updated_at":"2025-04-07T10:57:01.598Z","avatar_url":"https://github.com/app-generator.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Atlantis Lite Flask](https://appseed.us/product/atlantis-dark/flask/)\n\nOpen-source dashboard generated by AppSeed in **Flask** Framework. **[Atlantis Lite](https://appseed.us/product/atlantis-dark/flask/)** (Dark Design) is a free bootstrap 4 admin dashboard that is beautifully and elegantly designed to display various metrics, numbers or data visualization. \n\n- 👉 [Atlantis Dark Flask](https://appseed.us/product/atlantis-dark/flask/) - Product page\n- 👉 [Atlantis Dark Flask](https://flask-atlantis-dark.appseed-srv1.com/) - LIVE Demo\n\n\u003cbr /\u003e\n\n## Adding a new Blueprint\n\nThis sample shows how to define a new **blueprint** and use it on top of an [existing starter](https://appseed.us/admin-dashboards/flask-dashboard-atlantis-dark). Steps: \n\n- Create a new [directory](https://github.com/app-generator/sample-flask-blueprints/tree/master/app/files) for the **blueprint** with files:\n    - **__init__.py** - declare the Blueprint\n    - **routes.py** - the routing rules handled by the new **Blueprint**\n- The route **/list-html** will serve a simple HTML\n    - [list-html](https://github.com/app-generator/flask-atlantis-bp/blob/master/app/home/templates/list-index.html)\n\n```html\n\u003c!-- File Contents: \u003cROOT\u003e / app / home / templates / list-index.html --\u003e\n...\n\u003cdiv\u003e\n\t\u003ch2 class=\"text-white pb-2 fw-bold\"\u003eDashboard - LIST HTML\u003c/h2\u003e\n\t\u003ch5 class=\"text-white op-7 mb-2\"\u003e\n\t\t\u003ca href=\"{{ url_for('files_blueprint.list') }}\" \u003e ACCESS BP Link \u003c/a\u003e\n\t\u003c/h5\u003e\n\u003c/div\u003e\n...\n```\n\n\u003cbr /\u003e\n\n![Flask Dashboard Atlantis - Template project provided by AppSeed.](https://raw.githubusercontent.com/app-generator/flask-dashboard-atlantis-dark/master/media/flask-dashboard-atlantis-dark-screen.png)\n\n\u003cbr /\u003e\n\n## Manual Build\n\n```bash\n$ # Get the code\n$ git clone https://github.com/app-generator/sample-flask-blueprints.git\n$ cd sample-flask-blueprints\n$\n$ # Virtualenv modules installation (Unix based systems)\n$ virtualenv env\n$ source env/bin/activate\n$\n$ # Virtualenv modules installation (Windows based systems)\n$ # virtualenv env\n$ # .\\env\\Scripts\\activate\n$\n$ # Install modules - SQLite Database\n$ pip3 install -r requirements.txt\n$\n$ # OR with PostgreSQL connector\n$ # pip install -r requirements-pgsql.txt\n$\n$ # Set the FLASK_APP environment variable\n$ (Unix/Mac) export FLASK_APP=run.py\n$ (Windows) set FLASK_APP=run.py\n$ (Powershell) $env:FLASK_APP = \".\\run.py\"\n$\n$ # Set up the DEBUG environment\n$ # (Unix/Mac) export FLASK_ENV=development\n$ # (Windows) set FLASK_ENV=development\n$ # (Powershell) $env:FLASK_ENV = \"development\"\n$\n$ # Start the application (development mode)\n$ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)\n$ # --port=5000    - specify the app port (default 5000)  \n$ flask run --host=0.0.0.0 --port=5000\n$\n$ # Access the dashboard in browser: http://127.0.0.1:5000/\n```\n\n\u003e Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.\n\n\u003cbr /\u003e\n\n## Codebase Structure\n\nThe project is coded using blueprints, app factory pattern, dual configuration profile (development and production) and an intuitive structure presented bellow:\n\n\u003e Simplified version\n\n```bash\n\u003c PROJECT ROOT \u003e\n   |\n   |-- app/                      # Implements app logic\n   |    |-- base/                # Base Blueprint - handles the authentication\n   |    |-- home/                # Home Blueprint - serve UI Kit pages\n   |    |\n   |   __init__.py               # Initialize the app\n   |\n   |-- requirements.txt          # Development modules - SQLite storage\n   |-- requirements-mysql.txt    # Production modules  - Mysql DMBS\n   |-- requirements-pqsql.txt    # Production modules  - PostgreSql DMBS\n   |\n   |-- .env                      # Inject Configuration via Environment\n   |-- config.py                 # Set up the app\n   |-- run.py                    # Start the app - WSGI gateway\n   |\n   |-- ************************************************************************\n```\n\n\u003cbr /\u003e\n\n\u003e The bootstrap flow\n\n- `run.py` loads the `.env` file\n- Initialize the app using the specified profile: *Debug* or *Production*\n  - If env.DEBUG is set to *True* the SQLite storage is used\n  - If env.DEBUG is set to *False* the specified DB driver is used (MySql, PostgreSQL)\n- Call the app factory method `create_app` defined in app/__init__.py\n- Redirect the guest users to Login page\n- Unlock the pages served by *home* blueprint for authenticated users\n\n\u003cbr /\u003e\n\n\u003e App / Base Blueprint\n\nThe *Base* blueprint handles the authentication (routes and forms) and assets management. The structure is presented below:\n\n```bash\n\u003c PROJECT ROOT \u003e\n   |\n   |-- app/\n   |    |-- home/                                # Home Blueprint - serve app pages (private area)\n   |    |-- base/                                # Base Blueprint - handles the authentication\n   |         |-- static/\n   |         |    |-- \u003ccss, JS, images\u003e          # CSS files, Javascripts files\n   |         |\n   |         |-- templates/                      # Templates used to render pages\n   |              |\n   |              |-- includes/                  #\n   |              |    |-- navigation.html       # Top menu component\n   |              |    |-- sidebar.html          # Sidebar component\n   |              |    |-- footer.html           # App Footer\n   |              |    |-- scripts.html          # Scripts common to all pages\n   |              |\n   |              |-- layouts/                   # Master pages\n   |              |    |-- base-fullscreen.html  # Used by Authentication pages\n   |              |    |-- base.html             # Used by common pages\n   |              |\n   |              |-- accounts/                  # Authentication pages\n   |                   |-- login.html            # Login page\n   |                   |-- register.html         # Registration page\n   |\n   |-- requirements.txt                          # Development modules - SQLite storage\n   |-- requirements-mysql.txt                    # Production modules  - Mysql DMBS\n   |-- requirements-pqsql.txt                    # Production modules  - PostgreSql DMBS\n   |\n   |-- .env                                      # Inject Configuration via Environment\n   |-- config.py                                 # Set up the app\n   |-- run.py                                    # Start the app - WSGI gateway\n   |\n   |-- ************************************************************************\n```\n\n\u003cbr /\u003e\n\n\u003e App / Home Blueprint\n\nThe *Home* blueprint handles UI Kit pages for authenticated users. This is the private zone of the app - the structure is presented below:\n\n```bash\n\u003c PROJECT ROOT \u003e\n   |\n   |-- app/\n   |    |-- base/                     # Base Blueprint - handles the authentication\n   |    |-- home/                     # Home Blueprint - serve app pages (private area)\n   |         |\n   |         |-- templates/           # UI Kit Pages\n   |              |\n   |              |-- index.html      # Default page\n   |              |-- page-404.html   # Error 404 - mandatory page\n   |              |-- page-500.html   # Error 500 - mandatory page\n   |              |-- page-403.html   # Error 403 - mandatory page\n   |              |-- *.html          # All other HTML pages\n   |\n   |-- requirements.txt               # Development modules - SQLite storage\n   |-- requirements-mysql.txt         # Production modules  - Mysql DMBS\n   |-- requirements-pqsql.txt         # Production modules  - PostgreSql DMBS\n   |\n   |-- .env                           # Inject Configuration via Environment\n   |-- config.py                      # Set up the app\n   |-- run.py                         # Start the app - WSGI gateway\n   |\n   |-- ************************************************************************\n```\n\n\u003cbr /\u003e\n\n## Credits \u0026 Links\n\n- [Flask Framework](https://www.palletsprojects.com/p/flask/) - The offcial website\n- [Boilerplate Code](https://appseed.us/boilerplate-code) - Index provided by **AppSeed**\n- [Boilerplate Code](https://github.com/app-generator/boilerplate-code) - Index published on Github\n\n\u003cbr /\u003e\n\n---\n[Atlantis Lite Flask](https://appseed.us/product/atlantis-dark/flask/) - Provided by **[AppSeed](https://appseed.us)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fsample-flask-blueprints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapp-generator%2Fsample-flask-blueprints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fsample-flask-blueprints/lists"}