{"id":23050752,"url":"https://github.com/taka-rl/flask_webapp","last_synced_at":"2026-05-06T03:34:33.356Z","repository":{"id":257625709,"uuid":"857847066","full_name":"taka-rl/flask_webapp","owner":"taka-rl","description":"Simple flask web app","archived":false,"fork":false,"pushed_at":"2024-11-12T13:51:05.000Z","size":56048,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T13:41:49.276Z","etag":null,"topics":["api","bootstrap-flask","flask","flask-blueprint","flask-login","flask-wtforms","github-actions","pytest","pytest-flask","python","sqlalchemy","wtforms"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/taka-rl.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-15T18:56:27.000Z","updated_at":"2025-01-23T09:02:27.000Z","dependencies_parsed_at":"2024-09-17T20:40:13.210Z","dependency_job_id":"e2379ff3-eb88-40b1-8b6d-3c9b3f583478","html_url":"https://github.com/taka-rl/flask_webapp","commit_stats":null,"previous_names":["taka-rl/flask_webapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taka-rl/flask_webapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taka-rl%2Fflask_webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taka-rl%2Fflask_webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taka-rl%2Fflask_webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taka-rl%2Fflask_webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taka-rl","download_url":"https://codeload.github.com/taka-rl/flask_webapp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taka-rl%2Fflask_webapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002034,"owners_count":26083286,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","bootstrap-flask","flask","flask-blueprint","flask-login","flask-wtforms","github-actions","pytest","pytest-flask","python","sqlalchemy","wtforms"],"created_at":"2024-12-15T23:37:00.743Z","updated_at":"2025-10-09T22:02:58.806Z","avatar_url":"https://github.com/taka-rl.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nThis is a Flask web app example where I have been utilizing gained skills and knowledge in Flask, sqlalchemy, RESTful API and Python while learning them by myself.\n\n## Stacked tech\n- Python\n- Flask\n- HTML/CSS/Bootstrap\n- Flask-WTF/WTForm\n- sqlalchemy\n- PosgreSQL (for deploy)\n- Flask-Login\n- Jinja\n\n\n## Preparation to use\n1. Make sure the config_name as an argument of create_app function in main.py  \n      ```app = create_app(config_name='development')```  \n   Since it is still under development, 'production' has not been supported yet.\n\n2. Run the following command for the libraries:  \n   On Windows type:\n   ```python -m pip install -r requirements.txt```  \n   On MacOS type:\n   ```pip3 install -r requirements.txt```\n\n3. Create API Keys if you would like to use \"Useful Information function\" in the useful_info.html.  \n   OpenWeather API: https://openweathermap.org/api  \n   ExchangeRate API: https://www.exchangerate-api.com/\n\n4. Get an App password on Google if you would like to use email sender function in contact.html  \n   How to create App password → https://knowledge.workspace.google.com/kb/how-to-create-app-passwords-000009237?hl=ja\n\n5. Create .env file including the following variables:\n   ```\n   SECRET_KEY=Type Your Secret Key  # Flask Secret Key\n   WEATHER_API_KEY = 'Replace Your API Key set at 2'  # OpenWeather API\n   ExchangeRate_API_KEY = 'Replace Your API Key set at 2'  # ExchangeRate API\n   MYEMAIL = 'Your Email Address set at 3'  \n   EMAIL_PASSWORD = 'App Password set at 3'\n   SUPER_ADMIN = 'admin@email.com'  # The SUPER_ADMIN is the one that can change user's role such as admin and user and delete users.\n   ```\n6. Run main.py\n7. Use one of the accounts written as below to Login\n   - Super admin user:  \n      email: admin@email.com  \n      password: admin  \n   - user:     \n      email:test@email.com  \n      password: test@email.com\n8. Register a new user\n\n9. Change user's role and delete registered users on ('/admin-dashboard') route.\n\n## Design\n### Directory structure\n    ├── .github                 # GitHub actions\n    ├── instance                # database file\n    ├── static                  # static files\n    │   ├── assets              # img files\n    │   ├── css                 # css file related to bootstrap\n    │   ├── js                  # js file related to bootstrap\n    │   └── translations        # language json files\n    ├── templates               # route html files\n    ├── tests                   # tests\n    │   ├── conftest.py         # set up for testing\n    │   ├── parameters.py       # parameters for test\n    │   ├── test_about.py       # test for about route\n    │   ├── test_admin.py       # test for admin route\n    │   ├── test_auth.py        # test for auth route\n    │   ├── test_blog.py        # test for blog route\n    │   ├── test_collection.py  # test for collection route\n    │   ├── test_contact.py     # test for contact route\n    │   ├── test_error.py       # test for error route\n    │   └── test_useful_info.py # test for useful_info route\n    ├── flask_app               \n    │   ├── __init__.py         # Initialize Flask app and extensions\n    │   ├── forms.py            # Forms\n    │   ├── models.py           # Database models\n    │   ├── utils.py            # Utility functions such as decorators, email sender\n    │   └── route               \n    │       ├── about.py        # About-related routes\n    │       ├── auth.py         # Auth-related routes\n    │       ├── blog.py         # Blog-related routes\n    │       ├── collection.py   # Collection-related routes\n    │       ├── contact.py      # Contact-related routes\n    │       ├── others.py       # Other (language switcher)\n    │       ├── admin.py        # Admin routes\n    │       └── useful_info.py  # Useful_info-related routes\n    ├── main.py                 # Run the app\n    ├── .gitignore\n    ├── Procfile                 \n    ├── requirements.txt\n    └── README.md\n\n### Database\nThe ERD is as follows:  \n![image](https://github.com/user-attachments/assets/9d89c929-c464-4739-babe-ab8b95710c22)\n\n\n### User Role\nThere are three roles:  \nSuper admin:\n- It is the one set the email on .env file as \"SUPER_ADMIN\".\n- It can switch user's role such as admin and user and delete users on ('/admin-dashboard') route.\n- It also contains admin features.  \n\nAdmin:\n- It can post a new post/place, edit a post/place and delete a post/place.\n- It can comment on posts.\n\nUser: \n- When you register, the user role is user.\n- It can see the web page\n- It can comment on posts.\n\n\n## Finished development:  \n- Store my favorite cafes in the database(SQLAlchemy)\n- Show you the weather information through OpenWeather API\n- Get the currency exchange rate between JPY and HUF through ExchangeRate API\n- Add pages such as Blog posts, hobby, contact, about, register/login/logout\n- Show some posts/create a post\n- Add register/login/logout function\n- Design database considering Place, BlogPost, User and Comment\n- Add user authentication function for adding/editing/deleting places (only admin can)\n- Add a send_email function in the contact.html\n- Add a language switcher\n- Organize main.py (See Directory structure)\n- Add Error handling\n- Add functions to change user role and delete users by admin\n \n## Current development\n- Testing\n- Documentation\n- Add github actions, which is python-app.yml to execute pytest\n\n## Future development:\n- Improve the web page design\n- CI/CD pipelines\n- Introduce a chatbot\n- Deploy the web page\n\n\n## Testing\npytest-flask is used for testing. All the test files are stored in the tests folder.  \nTesting is connect to GitHub actions and tests are executed when commit or pull request happen.  \nGitHub actions is still under development because of some errors. \n\n### How to run testing on your local environment\n1. run this command in the terminal: ```python -m pytest```  \n   If you would like to see more details on the tests: ```python -m pytest -v```  \n\nHere is the executed result of ```python -m pytest``` .\n```\nPS C:\\folder path\\flask_webapp\u003e python -m pytest\n========================================================================================================= test session starts =========================================================================================================\nplatform win32 -- Python 3.10.11, pytest-8.3.3, pluggy-1.5.0\nrootdir: C:\\folder path\\flask_webapp\nplugins: anyio-4.6.0, flask-1.3.0\ncollected 24 items                                                                                                                                                                                                                     \n\ntests\\test_about.py .                                                                                                                                                                                                            [  4%]\ntests\\test_admin.py ....                                                                                                                                                                                                         [ 20%]\ntests\\test_auth.py ......                                                                                                                                                                                                        [ 45%]\ntests\\test_blog.py ....                                                                                                                                                                                                          [ 62%]\ntests\\test_collection.py ....                                                                                                                                                                                                    [ 79%]\ntests\\test_contact.py .                                                                                                                                                                                                          [ 83%]\ntests\\test_useful_info.py .                                                                                                                                                                                                      [100%] \n''''\n========================================================================================================== warnings summary =========================================================================================================== \n\n=================================================================================================== 24 passed, 2 warnings in 6.34s ==================================================================================================== \n```\n\n\nHere is the executed result of ```python -m pytest -v``` .\n```\n========================================================================================================= test session starts =========================================================================================================\nplatform win32 -- Python 3.10.11, pytest-8.3.3, pluggy-1.5.0 -- C:-----\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\python.exe\ncachedir: .pytest_cache\nrootdir: C:\\folder path\\flask_webapp\nplugins: anyio-4.6.0, flask-1.3.0\ncollected 24 items                                                                                                                                                                                                                     \n\ntests/test_about.py::test_about_access PASSED                                                                                                                                                                                    [  4%]\ntests/test_admin.py::test_check_super_admin_exist PASSED                                                                                                                                                                         [  8%]\ntests/test_admin.py::test_admin_dashboard_access PASSED                                                                                                                                                                          [ 12%]\ntests/test_admin.py::test_change_user_role PASSED                                                                                                                                                                                [ 16%]\ntests/test_admin.py::test_delete_user PASSED                                                                                                                                                                                     [ 20%]\ntests/test_auth.py::test_register_page PASSED                                                                                                                                                                                    [ 25%]\ntests/test_auth.py::test_register_form PASSED                                                                                                                                                                                    [ 29%]\ntests/test_auth.py::test_duplicated_email_register PASSED                                                                                                                                                                        [ 33%]\ntests/test_auth.py::test_login_page PASSED                                                                                                                                                                                       [ 37%]\ntests/test_auth.py::test_login_form PASSED                                                                                                                                                                                       [ 41%]\ntests/test_auth.py::test_logout PASSED                                                                                                                                                                                           [ 45%]\ntests/test_blog.py::test_create_new_post PASSED                                                                                                                                                                                  [ 50%]\ntests/test_blog.py::test_edit_post PASSED                                                                                                                                                                                        [ 54%]\ntests/test_blog.py::test_delete_post PASSED                                                                                                                                                                                      [ 58%]\ntests/test_blog.py::test_add_comment PASSED                                                                                                                                                                                      [ 62%]\ntests/test_collection.py::test_access_collection_page PASSED                                                                                                                                                                     [ 66%]\ntests/test_collection.py::test_add_place PASSED                                                                                                                                                                                  [ 70%]\ntests/test_collection.py::test_edit_place PASSED                                                                                                                                                                                 [ 75%]\ntests/test_collection.py::test_delete_place PASSED                                                                                                                                                                               [ 79%]\ntests/test_contact.py::test_access_contact_page PASSED                                                                                                                                                                           [ 83%]\ntests/test_error.py::test_500_page PASSED                                                                                                                                                                                        [ 87%]\ntests/test_error.py::test_404_page PASSED                                                                                                                                                                                        [ 91%]\ntests/test_useful_info.py::test_access_useful_info_page PASSED                                                                                                                                                                   [100%] \n\n========================================================================================================== warnings summary =========================================================================================================== \n\n=================================================================================================== 24 passed, 2 warnings in 6.46s ==================================================================================================== \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaka-rl%2Fflask_webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaka-rl%2Fflask_webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaka-rl%2Fflask_webapp/lists"}