From 484d3024c14f7a69d9aa63fc4ed9c5cf66763431 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Fri, 12 Jun 2026 11:00:24 +0330 Subject: [PATCH] Refactor code structure for improved readability and maintainability --- .claude/prompt/build-homepage.md | 122 ++++++ .gitignore | 3 +- assets/home/index.js | 1 + assets/home/styles.css | 279 +++++++++++++ src/Shared/Controller/HomeController.php | 16 + templates/public/home.html.twig | 509 +++++++++++++++++++++++ webpack.config.js | 1 + 7 files changed, 930 insertions(+), 1 deletion(-) create mode 100644 .claude/prompt/build-homepage.md create mode 100644 assets/home/index.js create mode 100644 assets/home/styles.css create mode 100644 src/Shared/Controller/HomeController.php create mode 100644 templates/public/home.html.twig diff --git a/.claude/prompt/build-homepage.md b/.claude/prompt/build-homepage.md new file mode 100644 index 00000000..24ac13cb --- /dev/null +++ b/.claude/prompt/build-homepage.md @@ -0,0 +1,122 @@ +# Build the ClinicPro Public Homepage at `/` + +## Goal + +Implement the public landing page designed in `clinicpromain/کلینیک پرو.html` as a Symfony/Twig page served at the `/` route. No React — pure Twig + vanilla JS. + +--- + +## Step 1 — Webpack entry for homepage CSS/JS + +Add a new entry to `webpack.config.js`: + +```js +.addEntry('home', './assets/home/index.js') +``` + +Create `assets/home/index.js`: + +```js +import './styles.css'; +``` + +Create `assets/home/styles.css` — copy the **entire contents** of `clinicpromain/styles.css` verbatim into this file. Do not modify any CSS rule. + +--- + +## Step 2 — Symfony controller + +Create `src/Shared/Controller/HomeController.php`: + +```php +render('public/home.html.twig'); + } +} +``` + +--- + +## Step 3 — Twig template + +Create `templates/public/home.html.twig`. + +The template is a **standalone HTML file** (does not extend base.html.twig). Copy the structure from `clinicpromain/کلینیک پرو.html` and adapt it as follows: + +### Head + +```twig + + + + + +کلینیک پرو — نرم‌افزار مدیریت مطب + + +{{ encore_entry_link_tags('home') }} + + +``` + +### Body (all sections) + +Copy the `` content from `clinicpromain/کلینیک پرو.html` verbatim — all sections in order: + +1. `