{"id":18837489,"url":"https://github.com/daluisgarcia/flask-modular-architecture-template","last_synced_at":"2025-06-22T22:06:20.235Z","repository":{"id":188996867,"uuid":"675873938","full_name":"daluisgarcia/flask-modular-architecture-template","owner":"daluisgarcia","description":"A flask modular architecture template that uses strategy pattern to create and subscribe modules to the app. This allows to have a good folder structure in your project","archived":false,"fork":false,"pushed_at":"2023-08-23T00:14:18.000Z","size":29,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T19:42:52.486Z","etag":null,"topics":["flask","flask-application","flask-sqlalchemy","flask-template","folder-structure","modular-architecture","modularization","python","python3","strategy-pattern"],"latest_commit_sha":null,"homepage":"","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/daluisgarcia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-08-07T23:54:56.000Z","updated_at":"2025-05-20T05:06:48.000Z","dependencies_parsed_at":"2024-11-08T02:48:49.204Z","dependency_job_id":null,"html_url":"https://github.com/daluisgarcia/flask-modular-architecture-template","commit_stats":null,"previous_names":["daluisgarcia/flask-modular-architecture-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/daluisgarcia/flask-modular-architecture-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daluisgarcia%2Fflask-modular-architecture-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daluisgarcia%2Fflask-modular-architecture-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daluisgarcia%2Fflask-modular-architecture-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daluisgarcia%2Fflask-modular-architecture-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daluisgarcia","download_url":"https://codeload.github.com/daluisgarcia/flask-modular-architecture-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daluisgarcia%2Fflask-modular-architecture-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261374413,"owners_count":23148977,"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-application","flask-sqlalchemy","flask-template","folder-structure","modular-architecture","modularization","python","python3","strategy-pattern"],"created_at":"2024-11-08T02:35:20.622Z","updated_at":"2025-06-22T22:06:15.223Z","avatar_url":"https://github.com/daluisgarcia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Modular Architecture Template\nThis is a template for a Flask project using a modular architecture. This project facilitates the creation of a Flask \nproject with a modular architecture, allowing the creation of new modules by extending a class and adding it to a set. \nThis template has some flask extension installed, such as: `flask_login`, `flask_principal`, `flask_sqlalchemy` and \n`flask_migrate`; any other extension can be installed by being added to the `core/extensions.py` file, inside the \n`install_extensions` function. \n\n# Project structure\n- `admin/`: An module example for an administration panel. **CAN BE EDITED OR DELETED**\n- `blogs/`: An example module of the blogs tutorial project from the old *Flask Quickstart Guide*. **CAN BE EDITED OR DELETED**\n- `core/`: Core module of the application. This module contains the core code of the project and orchestrates the \nfeatures of the template. This module contains the base templates and the static folder, also the authentication \nand permissions features. **BE CAREFUL WHEN EDITING THE CODE INSIDE THIS FOLDER, THIS ACTION CAN BREAK THE PROJECT**\n- `migrations`: Contains all the migrations of the database. **DO NOT MODIFY** Should be modified using the `flask-migrate` \nextension commands defined later in this file.\n- `web_page/`: An example module for the landing page. This folder contains the minimum code to create a module. \n**CAN BE EDITED OR DELETED**\n- `app.py`: Main file of the application. This file is the one that must be executed to run the application. **DO NOT MODIFY**\n- `modules.py`: File that contains a set with the modules of the application. Only modify to add new modules to the set.\n\n# Project installation\nTo install the project package, run the following command `pip install -r requirements.txt`\n\n# Module creation\nTo create a new module, you only need to create a new folder with a `module.py` file inside it. This file must contain a\nclass extending the `core.AppModule` class and implementing the `__init__` method defining the `self.bluprint` attribute \nwith the blueprint of the module, the `self.permission_names` attribute with at least an empty set and the `self.template_folder` \nwith the path to the module's templates folder. Also, you need to call the super `__init__` method with the module name \nas the parameter (You can see an example in `admin/module.py` file). \n\nTo subscribe the module to the application, you need to import the module class in the `modules.py` file and add it to the\n`APP_MODULES` set in it. This will allow the application to load the module when it starts.\n\n# Project usage\n## Setting environment variables\nBefore running the project, you must create a `.env` file in the root directory of the project as a copy of `.env.example`.\n\n## Creating the database\nThanks to the `flask_migrate` extension, the database can be created and updated automatically. To create the database,\nyou must run the following command: `flask db migrate`. **If you make any change to the models or add a new one** you \nmust run the `flask db migrate` command again and then `flask db upgrade` to update the database.\n\nIf you want to renew the database migrations, you can delete the `migrations` folder and run the `flask db init` command.\nThen you can run the `flask db migrate` command to create the database tables.\n\n## Running the project\nTo run the project you can use either the command `python app.py` or `flask run`\n\n# Contributing\nTo contribute to this project, you can fork the repository and create a pull request with your changes. Also, you can\nopen an issue with your suggestion or bug report. I will be happy to review your contributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaluisgarcia%2Fflask-modular-architecture-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaluisgarcia%2Fflask-modular-architecture-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaluisgarcia%2Fflask-modular-architecture-template/lists"}