{"id":26045099,"url":"https://github.com/panjidwisatrio/flask-clean-architecture","last_synced_at":"2026-04-20T03:36:55.045Z","repository":{"id":280313196,"uuid":"941566544","full_name":"panjidwisatrio/flask-clean-architecture","owner":"panjidwisatrio","description":"A modern Flask application template implementing clean architecture principles. This project provides a well-structured foundation for building web applications with clear separation of concerns and maintainable code.","archived":false,"fork":false,"pushed_at":"2025-03-02T16:54:07.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T08:53:35.825Z","etag":null,"topics":["clean-architecture","flask","html-css-javascript","python"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/panjidwisatrio.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,"zenodo":null}},"created_at":"2025-03-02T15:46:40.000Z","updated_at":"2025-03-02T16:56:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"9362fab9-e495-47bf-a99a-fdd9730438f6","html_url":"https://github.com/panjidwisatrio/flask-clean-architecture","commit_stats":null,"previous_names":["panjidwisatrio/flask-clean-architecture"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/panjidwisatrio/flask-clean-architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panjidwisatrio%2Fflask-clean-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panjidwisatrio%2Fflask-clean-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panjidwisatrio%2Fflask-clean-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panjidwisatrio%2Fflask-clean-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panjidwisatrio","download_url":"https://codeload.github.com/panjidwisatrio/flask-clean-architecture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panjidwisatrio%2Fflask-clean-architecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["clean-architecture","flask","html-css-javascript","python"],"created_at":"2025-03-07T19:31:28.289Z","updated_at":"2026-04-20T03:36:55.037Z","avatar_url":"https://github.com/panjidwisatrio.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧪 Flask Clean Architecture\n\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA modern Flask application template implementing clean architecture principles. This project provides a well-structured foundation for building web applications with clear separation of concerns and maintainable code.\n\n\u003e 💡 **Key Feature**: JavaScript-driven frontend with Flask handling template rendering\n\n---\n\n## 📑 Table of Contents\n\n- [Architecture Overview](#architecture-overview)\n- [Project Structure](#project-structure)\n- [Data Flow](#data-flow)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Running the Application](#running-the-application)\n- [Testing](#testing)\n- [License](#license)\n\n---\n\n## 🏗️ Architecture Overview\n\nThis project follows Clean Architecture principles with a JavaScript-heavy frontend approach:\n- Flask serves as a lightweight backend primarily for template rendering\n- JavaScript handles all API interactions and dynamic functionality\n- Clear separation between presentation and business logic\n\n### 📁 Project Structure\n\n```\n/app\n    /routes              # Simple Flask routes for template rendering\n    /static              # Static assets (CSS, JavaScript, images)\n       /css              # Stylesheet files\n       /js               # JavaScript files\n           /helpers      # Helper JavaScript utilities\n               api.js    # Handles API requests and responses\n               dom.js    # DOM manipulation utilities\n               utils.js  # General utility functions\n           /services     # Business logic services\n               userService.js # User-related functionality\n           config.js     # Frontend configuration\n           main.js       # Main JavaScript entry point\n    /templates           # Jinja2 HTML templates\n        /admin           # Templates for admin panel\n        /auth            # Authentication-related templates\n        /components      # Reusable template components\n        /general-users   # Templates for regular users\n        /profiles        # User profile templates\n        base.html        # Base template layout\n        overview.html    # Overview web page template\n    /tests               # Test suite\nmain.py                  # Application entry point\n```\n\n## 🔄 Data Flow\n\nThis application follows a JavaScript-centric approach with Flask providing the initial rendering:\n\n1. **Initial Request**: Flask routes (`/app/routes/route.py`) handle the initial request and render Jinja templates\n2. **Frontend Initialization**: JavaScript loads and initializes the client-side application\n3. **API Interaction**: \n   - JavaScript modules in `/app/static/js/helpers/api.js` handle all API calls\n   - `/app/static/js/services/` contain business logic for different domains\n4. **DOM Updates**: JavaScript updates the UI based on API responses\n5. **State Management**: JavaScript manages application state on the client side\n\n\u003e This approach minimizes server-side processing and creates a responsive, dynamic user experience while leveraging Flask's excellent templating capabilities.\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Python 3.8 or higher\n- pip (Python package manager)\n- Virtual environment tool (recommended: venv)\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/flask-clean-architecture.git\n   cd flask-clean-architecture\n   ```\n\n2. Create and activate a virtual environment:\n   ```bash\n   python -m venv venv\n   \n   # On Windows\n   venv\\Scripts\\activate\n   \n   # On macOS/Linux\n   source venv/bin/activate\n   ```\n\n3. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Edit the config file with your configuration values in `/app/static/js/config.js`\n\n---\n\n## ▶️ Running the Application\n\n1. Make sure your virtual environment is activated\n2. Run the application:\n   ```bash\n   flask --app \"your-directory\\main.py\" run\n   ```\n   \n   For development mode with auto-reload:\n   ```bash\n   flask --app \"your-directory\\main.py\" --debug run\n   ```\n3. Access the application in your browser at `http://localhost:5000`\n4. The Flask server will handle initial page renders, then JavaScript takes over for all API interactions\n\n---\n\n## 🧪 Testing **(In-development)**\n\nRun tests using pytest:\n```bash\npytest\n```\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eBuilt with ❤️ by panjidwisatrio\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanjidwisatrio%2Fflask-clean-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanjidwisatrio%2Fflask-clean-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanjidwisatrio%2Fflask-clean-architecture/lists"}