<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Francesco Passanante on Medium]]></title>
        <description><![CDATA[Stories by Francesco Passanante on Medium]]></description>
        <link>https://medium.com/@francescopassanante?source=rss-da93955d5b42------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rq_SZaiSfzUxWSr5</url>
            <title>Stories by Francesco Passanante on Medium</title>
            <link>https://medium.com/@francescopassanante?source=rss-da93955d5b42------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:37:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@francescopassanante/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Stop Asking “Who Has the Latest .env File?”]]></title>
            <link>https://medium.com/@francescopassanante/stop-asking-who-has-the-latest-env-file-47d8632c3ff2?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/47d8632c3ff2</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Tue, 28 Oct 2025 10:03:13 GMT</pubDate>
            <atom:updated>2025-10-28T10:03:13.103Z</atom:updated>
            <content:encoded><![CDATA[<h3>🧩 Stop Asking “Who Has the Latest .env File?”</h3><h3>How EnvSync Keeps Your Team’s Environment Variables in Perfect Sync</h3><p><em>How a simple CLI tool solved our team’s biggest environment configuration headache — and can solve yours too.</em></p><h3>💥 The Problem Every Developer Knows Too Well</h3><p>Picture this: you’re working on a new feature when suddenly your app crashes with a cryptic error.<br> After hours of debugging, you realize the issue isn’t your code — it’s a missing environment variable that someone added last week.</p><p>Sound familiar?</p><blockquote><em>“Hey, can you send me the latest </em><em>.env file?” 😅</em></blockquote><p>This innocent Slack message happens countless times in dev teams around the world.</p><p>The problem?</p><ul><li>.env files <strong>can’t be versioned</strong> (they contain secrets)</li><li>.env.example files <strong>get forgotten</strong></li><li>Developers end up with <strong>different setups</strong> that cause bugs and wasted hours</li></ul><p><strong>What if there were a better way?</strong></p><h3>🚀 Introducing EnvSync — Your Environment Variables’ Best Friend</h3><p>After experiencing this pain one too many times, I built <a href="https://www.npmjs.com/package/@passasooz/envsync"><strong>EnvSync</strong></a>:<br> an <strong>open-source CLI</strong> that keeps every teammate’s .env files aligned by syncing keys between local env files and their committed examples.</p><p>The magic?<br> ✨ It <strong>only syncs variable names, never values.</strong><br> Your secrets stay secret, but your environment stays consistent — automatically.</p><h3>🎯 What EnvSync Does</h3><ul><li>🔁 <strong>Bidirectional sync:</strong> Keeps .env and .env.example aligned both ways</li><li>🔍 <strong>Smart detection:</strong> Finds and validates all .env* and .example files</li><li>⚡️ <strong>Auto-creation:</strong> Creates or updates examples automatically</li><li>🛑 <strong>Zero leaks:</strong> Never touches sensitive values</li><li>💬 <strong>Preserves structure:</strong> Keeps comments and line order</li><li>🧠 <strong>CI/CD ready:</strong> Exits with error codes for pipeline checks</li><li>🚀 <strong>Post-merge sync:</strong> Updates .env after every git pull</li><li>🧩 <strong>Framework-agnostic:</strong> Works with PHP, Node.js, Python, Laravel, Next.js… you name it.</li></ul><h3>🧪 A Real-World Example — From Chaos to Harmony</h3><p><strong>Before EnvSync 😰</strong></p><pre>DATABASE_URL=postgresql://localhost:5432/myapp<br>API_KEY=super-secret-key<br>DEBUG=true<br>NEW_FEATURE_FLAG=enabled</pre><p>Your .env.example file is outdated:</p><pre>DATABASE_URL=<br>API_KEY=<br>DEBUG=<br># Missing NEW_FEATURE_FLAG!</pre><ol><li>You add NEW_FEATURE_FLAG locally</li><li>Forget to update .env.example</li><li>Push changes</li><li>Your teammate pulls → app breaks</li></ol><p><strong>After EnvSync 🎉</strong></p><ol><li>You add the new variable</li><li>Run envsync before committing</li><li>EnvSync automatically adds NEW_FEATURE_FLAG= to .env.example</li><li>Teammates run envsync --from-example</li><li>Their .env updates automatically</li></ol><p>No more “what’s the new variable called?” messages ever again. 🚀</p><h3>⚙️ Getting Started in 30 Seconds</h3><h3>Installation</h3><pre># Global installation (recommended)<br>npm install -g @passasooz/envsync<br><br># Or locally<br>npm install @passasooz/envsync</pre><h3>Basic Usage</h3><pre># Sync missing keys from .env to .env.example<br>envsync<br><br># Check for differences (for CI/CD)<br>envsync --check<br><br># Update .env from .env.example<br>envsync --from-example<br><br># Work with specific files<br>envsync --env .env.production --example .env.prod.sample</pre><h3>🧠 Advanced Features That Make the Difference</h3><h3>🎣 Git Hooks Integration</h3><p>EnvSync comes with built-in Husky hooks:</p><ul><li><strong>Pre-commit:</strong> Runs envsync --check before every commit and blocks it if .env.example is outdated.</li><li><strong>Post-merge:</strong> Runs envsync --from-example after every git pull, so your local .env files always stay updated.</li></ul><h3>🏗️ Multiple Environment Support</h3><pre>.env                → .env.example  <br>.env.local          → .env.local.example  <br>.env.production     → .env.production.example  <br>.env.test           → .env.test.example</pre><h3>🔍 CI/CD Integration</h3><p>Add this to your GitHub Actions workflow:</p><pre>- name: Check environment sync<br>  run: npx @passasooz/envsync --check</pre><p>If differences are found, the pipeline fails with clear error messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4rB4xf884nLI4sNzRU0tg.png" /></figure><p>EnvSync was built for <strong>simplicity and safety</strong>:</p><ol><li><strong>File discovery:</strong> Scans all .env* files</li><li><strong>Parsing:</strong> Extracts variable names while keeping formatting and comments</li><li><strong>Sync logic:</strong> Merges missing keys intelligently in both directions</li><li><strong>Safety:</strong> Never modifies values — only keys</li><li><strong>Atomic writes:</strong> Prevents corruption or partial writes</li></ol><p>All packed in a <strong>single Node.js file</strong> with zero runtime dependencies.</p><h3>💡 Why Your Team Needs EnvSync Today</h3><h3>🚀 Faster Onboarding</h3><p>New devs get a working .env in seconds — no setup chaos.</p><h3>🐛 Fewer Bugs</h3><p>No more “missing variable” crashes after a merge.</p><h3>🔄 Seamless Collaboration</h3><p>Changes to environment variables propagate automatically.</p><h3>⚡ Zero Friction</h3><p>Once configured, it runs quietly in the background.</p><h3>🔒 Security by Design</h3><p>Syncs structure, <strong>not secrets.</strong></p><h3>💬 Real User Feedback</h3><blockquote><em>“We went from having env-related issues every week to literally zero in two months. It just works.”<br> — </em>Sarah K., Lead Developer</blockquote><blockquote><em>“The post-merge hook is genius. I pull changes and my </em><em>.env is instantly updated. No more Slack pings about missing keys.”<br> — </em>Mike R., Full-Stack Developer</blockquote><h3>🛠️ What’s Next for EnvSync</h3><p>Here’s what’s coming:</p><ul><li>🧩 IDE extensions (VS Code, JetBrains, etc.)</li><li>🧱 Framework-specific plugins (Next.js, Laravel, Django)</li><li>📊 Team dashboards for environment governance</li><li>✅ Variable validation rules (required vs optional)</li></ul><h3>☕ Try EnvSync Today</h3><p>Eliminate environment variable headaches forever:</p><pre>npm install -g @passasooz/envsync<br>cd your-project<br>envsync</pre><p>🔗 <strong>Links</strong></p><ul><li><a href="https://www.npmjs.com/package/@passasooz/envsync">NPM Package</a></li><li><a href="https://github.com/passasooz/envsync">GitHub Repository</a></li><li><a href="https://github.com/passasooz/envsync#readme">Documentation</a></li></ul><h3>❤️ Contributing &amp; Support</h3><p>EnvSync is <strong>open source</strong> and welcomes your ideas, feedback, and PRs!<br> If it made your dev life easier, consider <a href="https://buymeacoffee.com/passasooz">buying me a coffee</a> ☕ — it helps me keep improving the project.</p><p><em>Follow me for more developer tools, open-source projects, and productivity tips. Let’s build software that makes developers’ lives easier — one CLI at a time.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47d8632c3ff2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From FullStack Senior Developer to FullWine Junior Developer]]></title>
            <link>https://medium.com/@francescopassanante/from-fullstack-senior-developer-to-fullwine-junior-developer-eeec854047dd?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeec854047dd</guid>
            <category><![CDATA[developer-relations]]></category>
            <category><![CDATA[developer-stories]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[wine]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Fri, 04 Oct 2024 09:19:34 GMT</pubDate>
            <atom:updated>2024-10-04T09:19:34.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>What the Hell is a Full Wine Developer!?</h3><p>Spoiler: It’s nothing. But honestly, I don’t know what to call myself anymore when people ask, “What do you do?” I could say “entrepreneur,” but that doesn’t really cover the 15 years of experience I’ve got as a software developer.</p><h3>So now, I’m a Full Wine Developer (Junior).</h3><p>This is the story of how I went from coding to cultivating.</p><p>In 2010, I moved from Bergamo to Sicily. The family had land down there — 300 olive trees across 7 hectares — but nobody really cared for it. The deal with the folks managing it? Keep the land clean, and we get a share of the olive oil. Seemed easy enough.</p><h4>Then 2022 rolled around, and we got… nothing. Zero oil. Nada.</h4><p>Seven hectares and no oil? Yeah, no way that happens naturally. We got played.</p><p>Instead of spending my savings on a house or a new car, or even throwing it into crypto, I thought, screw it, I’ll manage the land myself. No experience, no background, but plenty of grit.</p><p>So in 2023, I jumped in. I didn’t go it alone, though. I found a trustworthy farmer (because let’s be real, I don’t even own a tractor), hired an agronomist, and assembled a team of consultants. The land was pretty run-down, so we started with heavy pruning and nursing it back to health.</p><p>Here’s the score from my first year:</p><ul><li>600 liters of olive oil</li><li>16,000 liters of wine</li></ul><p>I didn’t want to just make another run-of-the-mill product. I wanted to build something different — something that stood out from the crowd. That’s how <strong>Terrae.farm</strong> was born.<br>You can check it out here: <a href="https://terrae.farm/">https://terrae.farm</a></p><p>The first year, we poured most of our energy into wine production. Olive oil is a bit easier to handle, plus, let’s be real, we produced way more wine than oil.</p><p>We grow <a href="https://it.wikipedia.org/wiki/Oliva_Nocellara_del_Belice"><em>Nocellara del Belice</em> olives</a> (top-notch quality), and our vineyards produce <em>Catarratto Bianco Lucido</em>, a finer variety of <a href="https://it.wikipedia.org/wiki/Catarratto"><em>Catarratto Bianco</em></a>.</p><p>Our flagship wine?<br>We call it <em>CINCIN </em>(in English “cheers”)<em> </em>— a medium-high-quality “battle wine” for all occasions. We’re already planning a bunch of experiments for next year to add more cool stuff to our e-commerce.</p><p>Diving into the wine world has been a wild ride — way tougher than you’d think. Even though I come from a complex field like software development, this industry brings a whole new set of challenges.</p><p>But thanks to the problem-solving skills I’ve honed as a FullStack Senior Developer, I’m ready to take them on.</p><p>Who knows? Maybe I’ll even hit “Senior” level as a Wine Developer someday!</p><blockquote><strong>Want to grab 20% off all our products? Just drop your info in the </strong><a href="https://forms.gle/JZT9Vn8wBYYas495A"><strong>form below</strong></a><strong>, and we’ll hook you up!</strong></blockquote><p>Here is me and my partner on this fantastic adventure with the first bottle of <em>CINCIN</em></p><figure><img alt="CINCIN by Terrae.farm" src="https://cdn-images-1.medium.com/max/900/1*QECEW9o9o4lutBxwDRrwJg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeec854047dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How send an email notification to new users on Laravel Filament application]]></title>
            <link>https://medium.com/@francescopassanante/how-send-an-email-notification-to-new-users-on-laravel-filament-application-c44eaa67d716?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/c44eaa67d716</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[account-activation]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[laravel-filament]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 15:28:54 GMT</pubDate>
            <atom:updated>2024-03-01T15:28:54.199Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f92ojV4Nad5o3a-nrap-9w.png" /></figure><p>In the past few days I have spent a lot of time between reverse engineering and online research to be able to develop what I needed.</p><p>I created an application with Laravel Filament that serves as a backend for a Mobile App, so my need is to manage everything from the centralized application.</p><p>Users, when they register in the mobile app, need to receive a notification email that allows them to validate precisely their email address.</p><p>The admin can also add users from the admin area and, in addition, must be able to resend the same account activation email if it is needed, so I had a dilemma.</p><p>Online as always there wasn’t much about it, all the guides referred to native Laravel methodologies or custom solutions, however none of the resources were for me and I desired to lean on the framework’s native logic.</p><p>As a first step, I implemented the <strong>MustVerifyEmail</strong> rule in the <strong>User</strong> model like this:</p><pre>&lt;?php<br><br>namespace App\Models;<br><br>use Illuminate\Contracts\Auth\MustVerifyEmail;<br>......<br>......<br>......<br><br>class User extends Authenticatable implements MustVerifyEmail<br>{<br>    .....<br>    .....<br>    .....<br>}</pre><blockquote>In my case I manage different functionalities through a specially created Service called CustomerService implemented with its own Facade, so I can call back when I need the various functionalities bound to the Custmoer.<br>For the dastardly I’ll leave the code here though — let me be clear — it is not necessary to use a dedicated Service to do this!</blockquote><p>Create a CustomerServiceFacade.php file and locate it in app/Filament/Facades/</p><pre>&lt;?php<br><br>namespace App\Filament\Facades;<br><br>use App\Filament\Services\CustomerService;<br>use Illuminate\Support\Facades\Facade;<br><br>class CustomerServiceFacade extends Facade<br>{<br>    protected static function getFacadeAccessor()<br>    {<br>        return CustomerService::class;<br>    }<br>}</pre><p>Create a CustomerService.php file and locate it in app/Filament/Services/</p><pre>&lt;?php<br><br>namespace App\Filament\Services;<br><br>use App\Models\Customer;<br>use App\Models\User;<br>use Filament\Notifications\Notification;<br>use App\Notifications\VerifyEmailNotification;<br>use Illuminate\Support\Facades\Auth;<br>use Illuminate\Http\RedirectResponse;<br><br>class CustomerService<br>{<br><br>    public function createCustomer(array $data): Customer<br>    {<br>        // my logics you don&#39;t need it<br>        $user = User::create([<br>            &#39;name&#39; =&gt; $data[&#39;name&#39;],<br>            &#39;email&#39; =&gt; $data[&#39;email&#39;],<br>            &#39;password&#39; =&gt; $data[&#39;password&#39;],<br>            &#39;is_active&#39; =&gt; true,<br>        ]);<br>        $user-&gt;assignRole(&#39;Customer&#39;);<br>        $user-&gt;givePermissionTo(&#39;customer&#39;);<br><br>        $data[&#39;user_id&#39;] = $user-&gt;id;<br><br>        $customer = Customer::create($data);<br>        // the line below is important<br>        $this-&gt;sendEmailReminder($customer);<br><br>        return $customer;<br>    }<br><br>    public function setValidatedEmail(Request $request): RedirectResponse<br>    {<br>        $user = User::findOrFail($request-&gt;id);<br>        if(is_null($user-&gt;email_verified_at)) {<br>            $user-&gt;email_verified_at = now();<br>            $user-&gt;save();<br>            $user-&gt;customer()-&gt;update([<br>                &#39;state&#39; =&gt; 1<br>            ]);<br>        }<br>        <br>        if(!Auth::loginUsingId($user-&gt;id)) {<br>            abort(403);<br>        }<br><br>        return redirect()-&gt;to(&#39;/admin/login&#39;);<br>    }<br><br>    public function sendEmailReminder(Customer $customer, $toNotify = false): void<br>    {<br>        try {<br>            // this is important!<br>            $customer-&gt;user-&gt;notify(new VerifyEmailNotification());<br>            // my custom logics<br>            if($toNotify) {<br>                Notification::make()<br>                    -&gt;title(&#39;Avviso&#39;)<br>                    -&gt;body(&#39;Email di notifica Attivazione Account inviata&#39;)<br>                    -&gt;success()<br>                    -&gt;send();<br>            }<br>        } catch(\Exception $e) {<br>            Notification::make()<br>                -&gt;title(&#39;Errore durante la richiesta&#39;)<br>                -&gt;body($e-&gt;getMessage())<br>                -&gt;danger()<br>                -&gt;persistent()<br>                -&gt;send();<br>        }<br>    }<br>}</pre><blockquote>Remember to add the Facade aliases on the config/app.php</blockquote><p>so when the <strong>sendEmailReminder()</strong> is called, the customer is notified by email</p><p>To create the <strong>VerifyEmailNotification</strong> you should type this command on CLI</p><pre>php artisan make:notification VerifyEmailNotification</pre><p>After that you can find a <strong>VerifyEmailNotification.php</strong> file at app/Notifications/ path, you just edit it like this:</p><pre>&lt;?php<br><br>namespace App\Notifications;<br><br>use Illuminate\Bus\Queueable;<br>use Illuminate\Contracts\Queue\ShouldQueue;<br>use Illuminate\Notifications\Messages\MailMessage;<br>use Illuminate\Notifications\Notification;<br>use Illuminate\Support\Facades\URL;<br><br>class VerifyEmailNotification extends Notification<br>{<br>    use Queueable;<br><br>    /**<br>     * Create a new notification instance.<br>     */<br>    public function __construct()<br>    {<br>        //<br>    }<br><br>    /**<br>     * Get the notification&#39;s delivery channels.<br>     *<br>     * @return array&lt;int, string&gt;<br>     */<br>    public function via(object $notifiable): array<br>    {<br>        return [&#39;mail&#39;];<br>    }<br><br>    /**<br>     * Get the mail representation of the notification.<br>     */<br>    public function toMail(object $notifiable): MailMessage<br>    {<br>        $url = URL::temporarySignedRoute(<br>            &#39;verification.verify&#39;,<br>            now()-&gt;addMinutes(config(&#39;auth.verification.expire&#39;, 60)),<br>            [<br>                &#39;id&#39; =&gt; $notifiable-&gt;getKey(),<br>                &#39;hash&#39; =&gt; sha1($notifiable-&gt;getEmailForVerification()),<br>            ]<br>        );<br><br>        return (new MailMessage)<br>            -&gt;line(&#39;Please click the button below to verify your email address.&#39;)<br>            -&gt;action(&#39;Verify Email Address&#39;, $url)<br>            -&gt;line(&#39;If you did not create an account, no further action is required.&#39;);<br>    }<br><br>    /**<br>     * Get the array representation of the notification.<br>     *<br>     * @return array&lt;string, mixed&gt;<br>     */<br>    public function toArray(object $notifiable): array<br>    {<br>        return [<br>            //<br>        ];<br>    }<br>}</pre><p>Finally just add the routing on the <strong>routes/web.php</strong> file</p><pre>Route::get(&#39;/email/verify/{id}/{hash}&#39;, function (Request $request, CustomerService $customerService) {<br>    return $customerService-&gt;setValidatedEmail($request);<br>})-&gt;name(&#39;verification.verify&#39;);</pre><p>In this way when the user who is added receives the account activation email they will find a link that will allow them to automatically log in and validate precisely their email address.</p><blockquote>I hope this little guide can be of support to those who, like me, have this specific need :)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c44eaa67d716" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Init a customer’s demo like a boss!]]></title>
            <link>https://medium.com/@francescopassanante/how-did-i-initialize-the-fieroo-demos-d2510e517ada?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2510e517ada</guid>
            <category><![CDATA[cpanel]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[domains]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Thu, 18 Jan 2024 14:56:07 GMT</pubDate>
            <atom:updated>2024-01-26T09:31:40.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*JhLfvzVCxm8Z4WmdGEDSRg.png" /></figure><p>How did I initialize the fieroo demos?<br>Tip: fieroo is a cloud software created to optimize the management and administration of a fair.</p><p>Tech Stack:<br>- Laravel<br>- Linux hosting<br>- Mysql Database</p><p>What do I use to do this task:<br>- Github Actions<br>- UAPI (cPanel API)<br>- Custom command in laravel<br>- Laravel jobs</p><blockquote>First of all, is important to explain the context of fieroo: fieroo is a software Larvel-based deployed with GitHub Actions, each branch of the github repository represents a customer of fieroo (except the master which is the basic project) and the features of fieroo are custom packages on other repos.<br>In this way, if a customer needs some customization of a single feature I will just create a branch on the single package’s repo and attach it to the customer’s fieroo repo. Similarly, if the main fieroo project changes, I will simply align all the customer branches with simple merges.<br>So when a customer istance of fieroo is deployed the bash script that is called during the deployment phase ensures that the updates will be performed on the server folder dedicated to that specific customer.</blockquote><p>I needed to create an automation that allowed my clients to self-generate their demo environment, so when a visitor to the product landing page decides to try the demo, automatically the system, by querying a specific API, will create a demo on the server for that customer.</p><p>Let’s take an example:<br>the client Jhon Doe requests a demo, the system queries an API that it executes:<br>- the database creation on the server with the attached user and all privileges<br>- the clone of the main fieroo repo.<br>- the subdomain creation on the server</p><p>The dirty work then will be done by the API, once all the environment is created the user (requester) will receive an email to access the platform.</p><p>This way the main fieroo.it domain will have a subdomain for each client, and each subdomain has its separate environment (database, repository branch).</p><p>What are the difficulties I encountered in accomplishing this?<br>Communicating with the server (it is a shared hosting on a Linux machine).</p><h3>Let’s go.</h3><p>I created a <strong>MANAGER</strong> project to manage all the various client demos, so within it, I set up a controller called ApiController to manage the API request.</p><p>This is the ApiController.php file:</p><pre>&lt;?php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Validator;<br>use Illuminate\Validation\ValidationException;<br>use App\Models\Customer;<br>use App\Jobs\InitDemoJob;<br>use Mail;<br>use Exception;<br><br>class ApiController extends Controller<br>{<br>    public function extractDomain(string $domain = &#39;&#39;): string|null<br>    {<br>        $parsedUrl = parse_url(https://medium.com/$domain);<br><br>        // Ensure the URL has a host (domain)<br>        if (isset($parsedUrl[&#39;host&#39;])) {<br>            // Extract the host name using explode<br>            $hostParts = explode(&#39;.&#39;, $parsedUrl[&#39;host&#39;]);<br>            <br>            // Remove &#39;www&#39; if it exists as the first part<br>            if ($hostParts[0] === &#39;www&#39;) {<br>                array_shift($hostParts);<br>            }<br><br>            // Return the first part as the host name<br>            return $hostParts[0];<br>        }<br><br>        return null;<br>    }<br><br>    public function initDemo(Request $request)<br>    {<br>        try {<br>            $validator = Validator::make($request-&gt;all(), [<br>                &#39;domain&#39; =&gt; &#39;required|string|max:255|unique:customers&#39;,<br>                &#39;email&#39; =&gt; &#39;required|email&#39;,<br>                &#39;company&#39; =&gt; &#39;required|string|max:255&#39;,<br>            ]);<br><br>            if ($validator-&gt;fails()) {<br>                throw new ValidationException($validator);<br>            }<br><br>            // extract domain name<br>            $domain = self::extractDomain(&#39;https://&#39;.$request-&gt;domain);<br>            if(is_null($domain)) {<br>                throw new Exception(&#39;Invalid domain format&#39;);<br>            }<br><br>            // create the customer<br>            $customer = Customer::create([<br>                &#39;domain&#39; =&gt; $domain, //ciccio nel caso di www.ciccio.com<br>                &#39;fulldomain&#39; =&gt; &#39;https://&#39;.$domain.&#39;.fieroo.it&#39;,<br>                &#39;email&#39; =&gt; $request-&gt;email, //info@boh.com<br>                &#39;company&#39; =&gt; $request-&gt;company, //ciccio srl<br>                &#39;trial&#39; =&gt; true,<br>                &#39;available&#39; =&gt; false,<br>            ]);<br><br>            $customer_job = dispatch(new InitDemoJob($customer));<br><br>            // prepare data for email to customer<br>            $email_to = $request-&gt;email;<br>            $data = [<br>                &#39;domain&#39; =&gt; $domain,<br>                &#39;company&#39; =&gt; $request-&gt;company,<br>                &#39;email&#39; =&gt; $request-&gt;email,<br>            ];<br><br>            // send email to customer<br>            $email_from_address = env(&#39;MAIL_FROM_ADDRESS&#39;);<br>            $email_from_name = env(&#39;MAIL_FROM_NAME&#39;);<br>            Mail::send(&#39;emails.new-demo-request&#39;, [&#39;data&#39; =&gt; $data], function ($m) use ($email_from_address, $email_from_name, $email_to) {<br>                $m-&gt;from($email_from_address, $email_from_name);<br>                $m-&gt;to($email_to)-&gt;subject(&#39;fieroo - nuova demo richiesta&#39;);<br>            });<br><br>            Mail::send(&#39;emails.demo-notify-to-admin&#39;, [&#39;data&#39; =&gt; $data], function($m) use ($email_from_address, $email_from_name) {<br>                $m-&gt;from($email_from_address, $email_from_name);<br>                $m-&gt;to(&#39;adminemail@domain.com&#39;)-&gt;subject(&#39;fieroo - demo richiesta da cliente&#39;);<br>            });<br><br>            return response()-&gt;json([&#39;status&#39; =&gt; true, &#39;message&#39; =&gt; &#39;La tua demo è in fase di preparazione, riceverai una e-mail non appena sarà pronta.&#39;]);<br>        } catch (ValidationException $e) {<br>            return response()-&gt;json([&#39;status&#39; =&gt; false, &#39;errors&#39; =&gt; $e-&gt;validator-&gt;errors()-&gt;toArray(), &#39;message&#39; =&gt; &#39;Errore di validazione dei campi&#39;]);<br>        } catch(Exception $e) {<br>            return response()-&gt;json([&#39;status&#39; =&gt; false, &#39;message&#39; =&gt; $e-&gt;getMessage()]);<br>        }<br>    }<br>}</pre><p>as you can see from the ApiController a Job is dispatched: InitDemoJob<br>First of all you need to run this on your project (on the terminal):</p><pre>php artisan queue:table</pre><blockquote>This command will create a migration for the jobs table on your database.<br>IMPORTANT: you will set your database on queue variable env.</blockquote><p>Now your InitDemoJob.php file should be like this:</p><pre>&lt;?php<br><br>namespace App\Jobs;<br><br>use Illuminate\Bus\Queueable;<br>use Illuminate\Contracts\Queue\ShouldQueue;<br>use Illuminate\Foundation\Bus\Dispatchable;<br>use Illuminate\Queue\InteractsWithQueue;<br>use Illuminate\Queue\SerializesModels;<br>use Illuminate\Support\Facades\DB;<br>use Illuminate\Support\Str;<br>use Exception;<br><br>class InitDemoJob implements ShouldQueue<br>{<br>    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;<br><br>    protected $customer;<br><br>    /**<br>     * Create a new job instance.<br>     */<br>    public function __construct($customer)<br>    {<br>        $this-&gt;customer = $customer;<br>    }<br><br>    private function movePathFiles($path, $sourcePath)<br>    {<br>        // Get all files and subdirectories in the source directory<br>        $items = scandir($sourcePath);<br><br>        // Remove &quot;.&quot; and &quot;..&quot; from the list<br>        $items = array_diff($items, [&#39;.&#39;, &#39;..&#39;]);<br><br>        // Move each item to the destination directory<br>        foreach ($items as $item) {<br>            $sourceItemPath = $sourcePath . &#39;/&#39; . $item;<br>            $destinationItemPath = $path . &#39;/&#39; . $item;<br><br>            // Use rename to move the item<br>            if (rename($sourceItemPath, $destinationItemPath)) {<br>                echo &quot;Moved: $sourceItemPath to $destinationItemPath\n&quot;;<br>            } else {<br>                echo &quot;Failed to move: $sourceItemPath\n&quot;;<br>            }<br>        }<br>        rmdir($path.&#39;/fieroo&#39;);<br>    }<br><br>    private function replaceEnvContent($path, $customer_project_name, $dbname, $dbuser, $usrpsw)<br>    {<br>        $sourceContent = file_get_contents(base_path(&quot;.env.customer&quot;));<br>        $sourceContent = str_replace(&#39;${CUSTOMER_URL}&#39;, $customer_project_name, $sourceContent);<br>        $sourceContent = str_replace(&#39;${DB_HOST}&#39;, env(&#39;DB_HOST&#39;), $sourceContent);<br>        $sourceContent = str_replace(&#39;${DB_PORT}&#39;, env(&#39;DB_PORT&#39;), $sourceContent);<br>        $sourceContent = str_replace(&#39;${DB_DBNAME}&#39;, $dbname, $sourceContent);<br>        $sourceContent = str_replace(&#39;${DB_USR}&#39;, $dbuser, $sourceContent);<br>        $sourceContent = str_replace(&#39;${DB_PSW}&#39;, $usrpsw, $sourceContent);<br>        $sourceContent = str_replace(&#39;${APP_KEY}&#39;, Str::random(32), $sourceContent);<br>        file_put_contents($path.&quot;/.env&quot;, $sourceContent);<br>        echo &#39;replaced content in .env&#39;;<br>    }<br><br>    public function initDB($dbname, $connection = &#39;mysql&#39;)<br>    {<br>        try{<br>            $data = false;<br>            if(env(&#39;APP_ENV&#39;) == &#39;local&#39;) {<br>                $hasDb = DB::connection($connection)-&gt;select(&quot;SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = &quot;.&quot;&#39;&quot;.$dbname.&quot;&#39;&quot;);<br>    <br>                if(empty($hasDb)) {<br>                    DB::connection($connection)-&gt;select(&#39;CREATE DATABASE &#39;. $dbname);<br>                    $this-&gt;info(&quot;Database &#39;$dbname&#39; created for &#39;$connection&#39; connection&quot;);<br>                }<br>                else {<br>                    $this-&gt;info(&quot;Database $dbname already exists for $connection connection&quot;);<br>                    throw new Exception(&quot;Database $dbname already exists for $connection connection&quot;);<br>                }<br>                $data = true;<br>            } else {<br>                $prefix_db = &#39;userprefixname&#39;;<br>                $final_name = $prefix_db.$dbname;<br>                $randomStringWithSymbols = Str::random(12, &#39;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&amp;*()_+{}[];:,.&lt;&gt;?&#39;);<br><br>                $create_db = shell_exec(&#39;uapi Mysql create_database name=&#39;.$final_name);<br>                $create_usrdb = shell_exec(&#39;uapi Mysql create_user name=&#39;.$final_name.&#39; password=&#39;.$randomStringWithSymbols);<br>                $assign_usrdb_db = shell_exec(&#39;uapi Mysql set_privileges_on_database user=&#39;.$final_name.&#39; database=&#39;.$final_name.&#39; privileges=ALL&#39;);<br>                $data = [<br>                    &#39;dbname&#39; =&gt; $final_name,<br>                    &#39;dbuser&#39; =&gt; $final_name,<br>                    &#39;userpsw&#39; =&gt; $randomStringWithSymbols,<br>                ];<br>            }<br>            return $data;<br>        }<br>        catch (Exception $e){<br>            $this-&gt;fail($e-&gt;getMessage());<br>            return [<br>                &#39;error&#39; =&gt; $this-&gt;error($e-&gt;getMessage()),<br>                &#39;status&#39; =&gt; false,<br>            ];<br>        }<br>    }<br><br>    public function initIstance($name, $data = null)<br>    {<br>        try{<br>            $customer_project_name = $name.&#39;.subdomain.it&#39;;<br>            $path = env(&#39;APP_PATH&#39;).$customer_project_name;<br>            mkdir($path, 0755, true);<br>            if(!file_exists($path)) {<br>                throw new Exception(&#39;Path &#39;.$path.&#39; is not exists&#39;);<br>            }<br>            <br>            chdir($path);<br><br>            $clone_output = shell_exec(&quot;git clone &quot;.env(&#39;GIT_SOURCE_REPO&#39;));<br>            echo &#39;clone: &#39;.$clone_output;<br>            if(!file_exists($path.&#39;/sourceprojectcloned&#39;)) {<br>                throw new Exception(&#39;Git Clone was wrong and the &#39;.$path.&#39;/sourceprojectcloned not exists&#39;);<br>            }<br>            chdir($path.&#39;/sourceprojectcloned&#39;);<br>            <br>            $create_branch = shell_exec(&#39;git checkout -b &#39;.$name);<br>            echo &#39;create branch: &#39;.$create_branch;<br><br>            $push_branch = shell_exec(&#39;git push origin &#39;.$name);<br>            echo &#39;push branch: &#39;.$push_branch;<br><br>            $this-&gt;movePathFiles($path, $path.&#39;/sourceprojectcloned&#39;);<br><br>            chdir($path);<br><br>            // set .env<br>            $create_env = shell_exec(&#39;touch .env&#39;);<br>            if(!file_exists($path.&#39;/.env&#39;)) {<br>                throw new Exception(&#39;.env file was not correctly created&#39;);<br>            }<br>            echo &#39;created .env file&#39;;<br>            <br>            $dbname = is_null($data) ? $name : $data[&#39;dbname&#39;];<br>            $dbuser = is_null($data) ? env(&#39;DB_USERNAME&#39;) : $data[&#39;dbuser&#39;];<br>            $userpsw = is_null($data) ? env(&#39;DB_PASSWORD&#39;) : $data[&#39;userpsw&#39;];<br>            $this-&gt;replaceEnvContent($path, $customer_project_name, $dbname, $dbuser, $userpsw);<br><br>            if(env(&#39;APP_ENV&#39;) != &#39;local&#39;) {<br>                // copy composer.phar<br>                shell_exec(&#39;cp ../path/to/folder/composer.phar .&#39;);<br>                shell_exec(&#39;cp -r ../path/to/original/folder/project/vendor .&#39;); // composer not work in prod so copy the vendor from source<br>            }<br><br>            // composer update (not work in prod)<br>            $composer_install = shell_exec(&#39;composer update&#39;);<br>            echo &#39;update composer dependencies&#39;;<br><br>            // composer install (not work in prod)<br>            $composer_install = shell_exec(&#39;composer install&#39;);<br>            echo &#39;install composer dependencies&#39;;<br><br>            if(env(&#39;APP_ENV&#39;) != &#39;local&#39;) {<br>                $create_subdomain = shell_exec(&#39;uapi SubDomain addsubdomain domain=&#39;.$name.&#39; rootdomain=maindomain.it dir=&#39;.$path.&#39;/public&#39;);<br>            }<br><br>            echo &#39;finish!&#39;;<br><br>            return true;<br><br>        }<br>        catch (Exception $e){<br>            $this-&gt;fail($e-&gt;getMessage());<br>            return [<br>                &#39;error&#39; =&gt; $this-&gt;error($e-&gt;getMessage()),<br>                &#39;status&#39; =&gt; false,<br>            ];<br>        }<br>    }<br><br>    /**<br>     * Execute the job.<br>     */<br>    public function handle(): void<br>    {<br>        try{<br>            // create the database for customer istance<br>            $make_db = self::initDB($this-&gt;customer-&gt;domain);<br>            if(isset($make_db[&#39;error&#39;])) {<br>                throw new Exception($make_db[&#39;error&#39;]);<br>            }<br>            $data = isset($make_db[&#39;dbname&#39;]) ? $make_db : null;<br><br>            // create istance for customer<br>            $make_istance = self::initIstance($this-&gt;customer-&gt;domain, $data);<br>            if(isset($make_istance[&#39;error&#39;])) {<br>                throw new Exception($make_istance[&#39;error&#39;]);<br>            }<br>        } catch (Exception $e) {<br>            $this-&gt;fail($e-&gt;getMessage());<br>        }<br>    }<br>}</pre><p>If you notice I imposed a differentiation, if it’s a local environment I could just do everything with Laravel’s DB class, but for the production environment unfortunately this “logic” didn’t work because since everything was on a shared hosting there were several limitations.</p><p>So the first problem I encountered was: <strong>how do I create a Database on the server?</strong></p><p>I discovered the existence of the cPanel API in particular I used the command: <strong>uapi</strong></p><p>So to create the Database via the cPanel API I did:</p><pre>$create_db = shell_exec(&#39;uapi Mysql create_database name=&#39;.$final_name);<br>$create_usrdb = shell_exec(&#39;uapi Mysql create_user name=&#39;.$final_name.&#39; password=&#39;.$randomStringWithSymbols);<br>$assign_usrdb_db = shell_exec(&#39;uapi Mysql set_privileges_on_database user=&#39;.$final_name.&#39; database=&#39;.$final_name.&#39; privileges=ALL&#39;);</pre><p>After creating the Database, I focus on creating the folder in which the fieroo project clone will then run.</p><pre>mkdir($path, 0755, true);<br>if(!file_exists($path)) {<br>    throw new Exception(&#39;Path &#39;.$path.&#39; is not exists&#39;);<br>}<br><br>chdir($path);<br><br>$clone_output = shell_exec(&quot;git clone &quot;.env(&#39;GIT_SOURCE_REPO&#39;);<br>echo &#39;clone: &#39;.$clone_output;<br>if(!file_exists($path.&#39;/sourceprojectcloned&#39;)) {<br>    throw new Exception(&#39;Git Clone was wrong and the &#39;.$path.&#39;/sourceprojectcloned not exists&#39;);<br>}<br>chdir($path.&#39;/sourceprojectcloned&#39;);<br><br>$create_branch = shell_exec(&#39;git checkout -b &#39;.$name);<br>echo &#39;create branch: &#39;.$create_branch;<br><br>$push_branch = shell_exec(&#39;git push origin &#39;.$name);<br>echo &#39;push branch: &#39;.$push_branch;</pre><p>This is just a portion of the code I will show, then there is the whole part of creating the .env (whose information I retrieve from a specially tailored .env.customer file).</p><p>However, after creating and preparing the project path on the server I encounter another unexpected problem: composer.<br>In a nutshell, the <strong>shell_exec(‘composer update’)</strong> command and the <strong>shell_exec(‘composer install’)</strong> command doesn’t work on the machine in production (but locally it does) so to solve this problem I decided to copy the /vendor of the sourceprojectcloned base project (which is aligned to the latest changes thanks to git clone previous command).</p><p>The last tidbit is the creation of the subdomain again via cPanel API with this command (obviously needed only in production since locally you just have to make the folder in the correct document root path).</p><pre>$create_subdomain = shell_exec(&#39;uapi SubDomain addsubdomain domain=&#39;.$name.&#39; rootdomain=maindomain.it dir=&#39;.$path.&#39;/public&#39;);</pre><p>Then add this to App\Console\Kernel.php file:</p><pre>......<br>protected function schedule(Schedule $schedule): void<br>{<br>    $schedule-&gt;command(&#39;queue:work --max-jobs=1 --stop-when-empty&#39;)-&gt;everyMinute();<br>    $schedule-&gt;command(&#39;demo:check&#39;)-&gt;everyMinute();<br>}<br>......</pre><p>The first command is used to execute the queue, while the second is used to perform an additional check that we will go over below:<br>start creating a custom command with artisan</p><pre>php artisan make:command CheckDemo</pre><p>The App\Console\Commands\CheckDemo.php file must become like this:</p><pre>&lt;?php<br><br>namespace App\Console\Commands;<br><br>use Illuminate\Console\Command;<br>use App\Http\Controllers\ApiController;<br>use App\Models\Customer;<br>use Illuminate\Support\Facades\Log;<br>use Mail;<br><br>class CheckDemo extends Command<br>{<br>    /**<br>     * The name and signature of the console command.<br>     *<br>     * @var string<br>     */<br>    protected $signature = &#39;demo:check&#39;;<br><br>    /**<br>     * The console command description.<br>     *<br>     * @var string<br>     */<br>    protected $description = &#39;Check available demo&#39;;<br><br>    /**<br>     * Execute the console command.<br>     */<br>    <br>    private function isDNSPropagated($domain)<br>    {<br>        $dnsRecords = dns_get_record($domain, DNS_A + DNS_AAAA + DNS_CNAME);<br>        return !empty($dnsRecords);<br>    }<br><br>    private function isSSLInstalled($domain)<br>    {<br>        // Specify the SSL context options<br>        $contextOptions = [<br>            &#39;ssl&#39; =&gt; [<br>                &#39;capture_peer_cert&#39; =&gt; true,<br>            ],<br>        ];<br><br>        // Create a stream context with SSL options<br>        $context = stream_context_create($contextOptions);<br><br>        // Attempt to open a connection to the domain with SSL<br>        $stream = stream_socket_client(&#39;ssl://&#39; . $domain . &#39;:443&#39;, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);<br><br>        // Check if the stream is successfully created<br>        if ($stream) {<br>            // Retrieve the peer certificate information<br>            $params = stream_context_get_params($stream);<br><br>            // Check if a certificate is present<br>            if (isset($params[&#39;options&#39;][&#39;ssl&#39;][&#39;peer_certificate&#39;])) {<br>                // SSL is installed<br>                fclose($stream);<br>                return true;<br>            }<br>        }<br><br>        // SSL is not installed<br>        return false;<br>    }<br><br>    private function checkDNSandSSL($domain)<br>    {<br>        return $this-&gt;isDNSPropagated($domain) &amp;&amp; $this-&gt;isSSLInstalled($domain);<br>    }<br><br>    public function handle()<br>    {<br>        try{<br>            $not_available = Customer::where(&#39;available&#39;, false)-&gt;get();<br>            foreach($not_available as $item) {<br>                $clean_prot_domain = str_replace(&#39;https://&#39;, &#39;&#39;, $item-&gt;fulldomain);<br>                if($this-&gt;checkDNSandSSL($clean_prot_domain)) {<br>                    $email_from_address = env(&#39;MAIL_FROM_ADDRESS&#39;);<br>                    $email_from_name = env(&#39;MAIL_FROM_NAME&#39;);<br>                    $email_to = $item-&gt;email;<br>                    $data = [C<br>                        &#39;domain&#39; =&gt; $item-&gt;domain,<br>                        &#39;company&#39; =&gt; $item-&gt;company,<br>                        &#39;email&#39; =&gt; $item-&gt;email,<br>                    ];<br>                    Mail::send(&#39;emails.init-demo&#39;, [&#39;data&#39; =&gt; $data], function ($m) use ($email_from_address, $email_from_name, $email_to) {<br>                        $m-&gt;from($email_from_address, $email_from_name);<br>                        $m-&gt;to($email_to)-&gt;subject(&#39;fieroo - configurazione demo pronta&#39;);<br>                    });<br><br>                    Mail::send(&#39;emails.init-demo-notify-to-admin&#39;, [&#39;data&#39; =&gt; $data], function ($m) use ($email_from_address, $email_from_name) {<br>                        $m-&gt;from($email_from_address, $email_from_name);<br>                        $m-&gt;to(&#39;adminemail@domain.com&#39;)-&gt;subject(&#39;fieroo - nuova configurazione demo pronta&#39;);<br>                    });<br><br>                    $customer = Customer::findOrFail($item-&gt;id);<br>                    $customer-&gt;available = true;<br>                    $customer-&gt;update();<br>                    Log::info(&#39;Customer id &#39;.$item-&gt;id.&#39; aggiornato&#39;);<br>                } else {<br>                    Log::error(&#39;Customer id &#39;.$item-&gt;id.&#39; checkDNSandSSL non funziona&#39;);<br>                }<br>            }<br>            $this-&gt;info(&#39;demo checked&#39;);<br>        }<br>        catch (\Exception $e){<br>            Log::error(&#39;Error: &#39;.$e-&gt;getMessage());<br>            $this-&gt;error($e-&gt;getMessage());<br>        }<br>    }<br>}</pre><p>In this file there are 3 private functions: isDNSPropagated, isSSLInstalled and checkDNSandSSL.</p><p>isDNSPropagated checked if the DNS of the customer domain is correctly propagated.<br>isSSLInstalled checked if the SSL certificate of the customer domain is correctly installed.<br>checkDNSandSSL compare the returns of isDNSPropagated &amp; isSSLInstalled for a final check.<br>If checkDNSandSSL returns true the domain is ready, so the customer can be notified with the right link to access his demo.</p><p>If you remember the App\Console\Kernel.php file has 2 command in the scheduler, the second is:</p><pre>$schedule-&gt;command(&#39;demo:check&#39;)-&gt;everyMinute();</pre><p>So every minute the manager checks for each customer if his domain is ready.</p><p>Why did I use queues to interface with the cPanel API?<br>Since cPanel takes a while to create the database and subdomain, in addition to the git clone execution happening at the same time, I preferred to prevent the server from getting overloaded with requests, this way I am sure that until one process is finished the next one cannot start.</p><p>This delay/latency of subdomain and database processing generated errors and issues, so this way I am sure that this does not happen and also I am sure that when the client is notified with access to his dedicated demo the link will not have any kind of problem on navigation.</p><h3>IMPORTANT <br>don’t forget to set the cron on the server to run the scheduler, I remind you that the Laravel command to run the scheduler is:</h3><pre>php artisan scheduler:run</pre><h3>In the end, why did I have this need?</h3><p>Because I want each customer to have their separate environment, as fieroo is not a SaaS but is an administrative management/marketplace where the company that purchases it can sell additional products to their customers (like rent a stand to participate, rent furniture for stands).<br>By instantiating the demos in this way, if one day a customer wants to purchase the service, all I need to do is activate the payment and nothing more.</p><p>I hope that this guide has been of help to someone and that my R&amp;D can be an inspiration to others to improve services regarding cPanel because I have seen that there is very little material online about it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2510e517ada" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to send a form with Contact Form 7 API in WP Headless and Next.js]]></title>
            <link>https://medium.com/@francescopassanante/how-to-send-a-form-with-contact-form-7-api-in-wp-headless-and-next-js-ad8936f65b9f?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad8936f65b9f</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 19:32:25 GMT</pubDate>
            <atom:updated>2023-01-05T10:33:48.364Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gh3oUqJipJGa5h_4ZL_2w.png" /></figure><p>In this article we will see how to create a simple form in our frontend application (written with Next.js).</p><p>First, of course, we need to install the CF7 plugin on our WordPress.</p><p>After that we simply go to our Next.js application and create our form!</p><p>Since I’m a lazy person, I decided to rely on a beautiful library ready for managing the client-side validation of the various fields of my form, so I suggest you take a tour here: <a href="https://react-hook-form.com/">https://react-hook-form.com/</a></p><h3>Well, let’s go!</h3><p>First of all, you should know the correct Endpoint to submit your CF7 request, so the API is:</p><blockquote>https://yourwordpressheadless/wp-json/contact-form-7/v1/contact-forms/CONTACTFORMID/feedback</blockquote><p>The most important thing of all is one:<br>the API we’re going to query DEMANDS that the data is passed with the form data, and the validation library which we had choiche retrieves the dataset into an object, so be very careful how you set up the call!!</p><p>You can try it on POSTMAN and check the server response.</p><p>This form uses the <a href="https://react.semantic-ui.com/">https://react.semantic-ui.com/</a> library.</p><p>So I created a component called <strong>FormValidation</strong>:</p><pre>import React, { useState } from &#39;react&#39;;<br>import { Form, Button } from &#39;semantic-ui-react&#39;;<br>import { useForm } from &quot;react-hook-form&quot;;<br>import Alert from &#39;.//Alert&#39;;<br><br>export default function FormValidation() {<br>    const { register, handleSubmit, resetField, formState: { errors } } = useForm();<br>    const [ message, setMessage ] = useState(&#39;&#39;)<br>    const [ dangerMessage, setDangerMessage ] = useState(&#39;&#39;)<br>    const [ isSending, setIsSending ] = useState(false)<br><br>    const onSubmit = (data) =&gt; {<br>        setIsSending(true)<br>        setMessage(&#39;&#39;)<br>        setDangerMessage(&#39;&#39;)<br><br>        let form_data = new FormData()<br>        for(let key in data) {<br>            form_data.append(key, data[key])<br>        }<br>        fetch(&quot;wpheadlessdomain.com/wp-json/contact-form-7/v1/contact-forms/CFID/feedback&quot;, {<br>            method: &#39;POST&#39;,<br>            body: form_data<br>        })<br>        .then(response =&gt; response.json())<br>        .then(response =&gt; {<br>            if(response.status == &#39;mail_sent&#39;) {<br>                setMessage(response.message)<br>                resetField(&#39;email&#39;)<br>                resetField(&#39;subject&#39;)<br>                resetField(&#39;message&#39;)<br>            } else {<br>                setDangerMessage(&#39;Something was wrong.&#39;)<br>            }<br>            setIsSending(false)<br>        })<br>        .catch((error) =&gt; {<br>            setIsSending(false)<br>            setDangerMessage(&#39;Error: &#39;+error)<br>        });<br>    }<br>    return (<br>        &lt;&gt;<br>            {dangerMessage &amp;&amp; &lt;Alert type=&quot;danger&quot; heading=&quot;Error&quot; message={dangerMessage} /&gt; }<br>            {message &amp;&amp; &lt;Alert type=&quot;success&quot; heading=&quot;OK&quot; message={message} /&gt;}<br>            &lt;Form onSubmit={handleSubmit(onSubmit)}&gt;<br>                &lt;Form.Field className=&quot;mb-3&quot;&gt;<br>                    &lt;input<br>                        className=&quot;form-control&quot;<br>                        type=&quot;email&quot;<br>                        placeholder=&quot;E-mail&quot;<br>                        {...register(&quot;email&quot;,<br>                            {<br>                                required: true,<br>                                pattern: /^(([^&lt;&gt;()\[\]\\.,;:\s@&quot;]+(\.[^&lt;&gt;()\[\]\\.,;:\s@&quot;]+)*)|(&quot;.+&quot;))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/<br>                            })}<br>                    /&gt;<br>                    {errors.email &amp;&amp; &lt;p className=&quot;text-danger mt-1&quot;&gt;&lt;small&gt;Your e-mail address is wrong&lt;/small&gt;&lt;/p&gt;}<br>                &lt;/Form.Field&gt;<br><br>                &lt;Form.Field className=&quot;mb-3&quot;&gt;<br>                    &lt;input<br>                        className=&quot;form-control&quot;<br>                        type=&quot;text&quot;<br>                        placeholder=&quot;Subject&quot;<br>                        {...register(&quot;subject&quot;, { required: true, maxLength: 80 })}<br>                    /&gt;<br>                    {errors.subject &amp;&amp; &lt;p className=&quot;text-danger mt-1&quot;&gt;&lt;small&gt;Your subject is wrong (max 80 chars)&lt;/small&gt;&lt;/p&gt;}<br>                &lt;/Form.Field&gt;<br><br>                &lt;Form.Field className=&quot;mb-3&quot;&gt;<br>                    &lt;textarea<br>                        className=&quot;form-control&quot;<br>                        rows=&quot;5&quot;<br>                        placeholder=&quot;Message&quot;<br>                        {...register(&quot;message&quot;, {<br>                            required: true,<br>                            maxlength: 1000<br>                        })}<br>                    &gt;&lt;/textarea&gt;<br>                    {errors.message &amp;&amp; &lt;p className=&quot;text-danger mt-1&quot;&gt;&lt;small&gt;Your message is wrong (max 1000 chars)&lt;/small&gt;&lt;/p&gt;}<br>                &lt;/Form.Field&gt;<br>                &lt;Button type=&#39;submit&#39; className=&quot;mt-3 btn btn-success w-100&quot; disabled={isSending}&gt;{isSending &amp;&amp; &lt;span class=&quot;spinner-border spinner-border-sm&quot; role=&quot;status&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;} Submit&lt;/Button&gt;<br>            &lt;/Form&gt;<br>        &lt;/&gt;<br>    )<br>}</pre><p>And another component, <strong>Alert</strong>, shows response messages:</p><pre>export default function Alert({type, heading, message}) {<br>    return (<br>        &lt;&gt;<br>            &lt;div className={&quot;alert alert-&quot;+type} role=&quot;alert&quot;&gt;<br>                &lt;h4 className=&quot;alert-heading&quot;&gt;{heading}&lt;/h4&gt;<br>                &lt;p&gt;{message}&lt;/p&gt;<br>            &lt;/div&gt;<br>        &lt;/&gt;<br>    )<br>}</pre><blockquote>Yes, that’s all :)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad8936f65b9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create Custom Meta Box in WordPress Headless with a REST API response to Frontend…]]></title>
            <link>https://medium.com/@francescopassanante/how-to-create-mb-in-wordpress-headless-with-a-rest-api-response-to-nextjs-frontend-application-e6c7fccf05e3?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6c7fccf05e3</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Mon, 14 Nov 2022 21:20:52 GMT</pubDate>
            <atom:updated>2023-01-02T18:50:41.930Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to create Custom Meta Box in WordPress Headless with a REST API response to Frontend Application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7TbMpoILwc9qf6Ux" /><figcaption>Photo by <a href="https://unsplash.com/@rswebsols?utm_source=medium&amp;utm_medium=referral">Souvik Banerjee</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Sometimes your WordPress Application needs to implement adding custom fields but you won’t install <a href="https://www.advancedcustomfields.com/">ACF Plugin</a>, so you can create a <strong>Custom Meta Box</strong> using a native WordPress function: <a href="https://developer.wordpress.org/reference/functions/add_meta_box/">add_meta_box()</a>.</p><p><strong>First of all</strong>: if your WordPress Application uses <strong>Gutenberg</strong> you should know that there are two different methods to proceed:</p><ul><li>without Gutenberg</li><li>with Gutenberg</li></ul><h3>Without Gutenberg (personally I don’t like the Gutenberg plugin)</h3><p>Simply deactivate Gutenberg from <strong>functions.php</strong> file of the <a href="https://gretathemes.com/what-is-child-theme/#what-is-child-theme">child theme</a>.<br>To do it just put in the following code:</p><pre>add_filter(&#39;use_block_editor_for_post&#39;, &#39;__return_false&#39;);</pre><h3>With Gutenberg (good luck)</h3><p>I didn’t use this method however googling I’ve discovered that you need to install a Node Package to do it, so you can see at the following link <a href="https://shellcreeper.com/custom-field-meta-box-in-gutenberg-editor/">https://shellcreeper.com/custom-field-meta-box-in-gutenberg-editor/</a></p><blockquote>Now your WordPress is finnally ready to implement your <strong>Custom Meta Box!</strong></blockquote><h3>How create a Custom Meta Box</h3><p>In <strong>functions.php</strong> file of the <a href="https://gretathemes.com/what-is-child-theme/#what-is-child-theme">child theme</a> write:</p><pre>add_action(&#39;add_meta_boxes&#39;, &#39;price_article_box&#39;);<br><br>function price_article_box() {<br>    add_meta_box(<br>        &#39;price_article_box&#39;,<br>        &#39;Price Area&#39;,<br>        &#39;price_article_box_content&#39;,<br>        &#39;post&#39;,<br>        &#39;normal&#39;,<br>        &#39;high&#39;<br>    );<br>}<br><br>function price_article_box_content($post) {<br>    wp_nonce_field(&#39;save_price_article&#39;, &#39;price_article&#39;);<br>    $value = esc_attr(get_post_meta( $post-&gt;ID, &#39;price_article&#39;, true ));<br>    echo &#39;&lt;label for=&quot;price_article&quot;&gt;Price: &lt;/label&gt;&#39;;<br>    if(!is_null($value) &amp;&amp; strlen($value) &gt; 0) {<br>        echo &#39;&lt;input type=&quot;text&quot; id=&quot;price_article&quot; name=&quot;price_article&quot; placeholder=&quot;250000&quot; value=&quot;&#39;.$value.&#39;&quot;&gt;&#39;;<br>    } else {<br>        echo &#39;&lt;input type=&quot;text&quot; id=&quot;price_article&quot; name=&quot;price_article&quot; placeholder=&quot;250000&quot;&gt;&#39;;<br>    }<br>}<br><br>add_action(&#39;save_post&#39;, &#39;price_article_box_save&#39;);<br><br>function price_article_box_save($post_id) {<br>    if(!isset($_POST[&#39;price_article&#39;]) || !current_user_can(&#39;edit_post&#39;,  $post_id)) return $post_id;<br>    <br>    $price_article = esc_attr($_POST[&#39;price_article&#39;]);<br>    update_post_meta($post_id, &#39;price_article&#39;, $price_article);<br>}</pre><p>This above code tell to WordPress to creating a new Area called “Price Area” (<em>ref. function price_article_box()</em>), for all post, containing a label and its relative input text which provide the correct compiling about your “custom field” — in this case it is a field about the price of the article (<em>ref. function price_article_box_content($post)</em>).<br>When you save the post (create or update) the code checking the relative field and inject it to <a href="https://developer.wordpress.org/reference/functions/update_post_meta/">update_post_meta()</a> function (<em>ref. function price_article_box_save($post_id)</em>).</p><blockquote>Okay! I’m done you must be thinking..<br>NOPE! Now you should retrieve the field’s value into your Frontend Application ;)</blockquote><h3>How add your custom meta box to WordPress REST API</h3><p>In <strong>functions.php</strong> file of the <a href="https://gretathemes.com/what-is-child-theme/#what-is-child-theme">child theme</a> write:</p><pre>add_action(&#39;rest_api_init&#39;, function() {<br>    register_rest_field(&#39;post&#39;, &#39;price_article&#39;, array(<br>        &#39;get_callback&#39; =&gt; function($post) {<br>            return get_post_meta($post[&#39;id&#39;], &#39;price_article&#39;, true);<br>        },<br>        &#39;schema&#39; =&gt; array(<br>            &#39;description&#39; =&gt; __(&#39;Price Artcile&#39;),<br>            &#39;type&#39;        =&gt; &#39;string&#39;<br>        ),<br>    ));<br>});</pre><p>This code inject a function to getting and registering (<em>ref. function </em><a href="https://developer.wordpress.org/reference/functions/register_rest_field/"><em>register_rest_field()</em></a>) the new value in <a href="https://developer.wordpress.org/reference/hooks/rest_api_init/">rest_api_init</a> WordPress hook.</p><p>Now you can check <strong>https://yourwordpressdomain.com/wp-json/wp/v2/posts</strong> endpoint and for each post you should have a new value under “price_article” which return the correct value inserted in the post’s backoffice.</p><blockquote>Yes, that’s all :)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6c7fccf05e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Italians Developers Values — POV]]></title>
            <link>https://medium.com/@francescopassanante/italians-developers-values-pov-4b182b540f96?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b182b540f96</guid>
            <category><![CDATA[market]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[industry]]></category>
            <category><![CDATA[italian]]></category>
            <category><![CDATA[mind]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Sat, 21 Aug 2021 12:18:47 GMT</pubDate>
            <atom:updated>2021-08-21T12:18:47.205Z</atom:updated>
            <content:encoded><![CDATA[<h3>Italians Developers Values — POV</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ogNUg1KbGDWry3Fkk-lgg.jpeg" /></figure><p>Hey folks!<br>Today I’ll want to speak about a hot topic here in Italy: the value of Developers.</p><p>In Italy, unfortunately, Developers are like Nerds (and this term is not under positive vibrations) or “a boy with a passion” and companies doesn’t understand the great value of these job position.<br>This is a big bug in the mind of people, there are few companies that invest in Research and Development and there are few managers that understand that development is more important than design.</p><p>Italy is the Nation of appearance where the form and design are more important than the functions and backend of a project.</p><p>In these last 10 years, during my career like IT Consultant and Web Developer for many difference Italian’s companies, I saw that a lot of them doesn’t give the correct value about dev’s themes.</p><p>What do I mean?<br>Simply doesn’t invest in technologies or doesn’t know if a certain newest technology is better than another technology that is already known about its internal team.<br>In more of cases managers respond about this topic with: “there is no available time” or “no money to pivot technologies” or “see it later, not now”.</p><p>So this generated a big problem and we can touch this problem in little and big companies, for example a lot of Public services are obsoleted and not work very well, a lot of data aren’t digitalized, and when a Public Administration service undergoes a digital transformation, various problems arise around public services aimed at facilitating citizens’ requests.</p><p>In the last 2 years, thanks to Covid-19 pandemic, finally in Italy people being to know the value of technology like a thing that people needs and like a thing that helps people to improve their lives, but the problem remain the developers.</p><p>Italy counts &gt; 300k developers (source <a href="https://www.daxx.com/blog/development-trends/number-software-developers-world">https://www.daxx.com/blog/development-trends/number-software-developers-world</a>), much more than Spain or other European countries.</p><p>In Italy, developers are not supported/protected from a dedicated national worker’s contract but this work category is like a metalworker (in most cases).<br>So contracts and salaries are wrongs and generated bad humor around developers, their rights and needs are different than metalworkers.<br>In other way, the annual salary medium of an Italian developer start from 25k and end at 60k but if you are a Freelance the life is more difficult because Italy has a hight tax system (40% of your billing); but this is another topic…</p><p>Recap: we have developers underpaid and not protected, managed by company&#39;s owners who don’t know the right value of developers or technologies.</p><p>In this way the final client, and the request of the market, doesn’t understand the right value of his needs and at the end we are full of bad projects and bad services.</p><p>Although most of us, professionals in the software development sector, are aware that finding a culprit of this situation is quite difficult and even somewhat useless, I think that the real breakthrough can only come with the real recognition by the Ministry of Education of the high importance of programming also as a subject of education from the first years of compulsory school.</p><p>Those who have studied programming, and by this I do not mean a mere language or know how to create a website, but I mean those who know the programming paradigms, the pillars and the foundations that unite most of the programming languages, has a totally different approach even in the problems of everyday life.<br>Thanks to the study of programming the mindset can be changed and problem-solving skills are developed in line with modern times, they provide the right basis for the continuous evolution of the technology itself and also allow a better point of view on aspects of daily life.</p><p>Most Italian companies are still retreating from the technological point of view, and this is because the perceived value of the developer figure is still very far away compared to competitors from other nations.<br>Unfortunately, the market is not expecting anyone, and if we do not prepare to make a value change starting from taking care of our developers and their background, we will very soon be left behind and we would no longer be attractive.</p><p>Probably mine is a drastic vision, but when the English Consulting Company calls you to buy your services and resell them to the Italian market, you understand that something is wrong.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b182b540f96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Un Bergamasco in Sicilia — grazie al Remote Working]]></title>
            <link>https://medium.com/@francescopassanante/un-bergamasco-in-sicilia-grazie-al-remote-working-5ced4698cb00?source=rss-da93955d5b42------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ced4698cb00</guid>
            <category><![CDATA[italy]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[sicily]]></category>
            <category><![CDATA[travel]]></category>
            <dc:creator><![CDATA[Francesco Passanante]]></dc:creator>
            <pubDate>Mon, 02 Aug 2021 13:10:04 GMT</pubDate>
            <atom:updated>2021-08-02T13:38:48.047Z</atom:updated>
            <content:encoded><![CDATA[<p>Un Bergamasco in Sicilia — grazie al Remote Working</p><p>Avete letto bene, da Bergamo mi sono trasferito in Sicilia.</p><p>Lo so è strano, è controcorrente, è l’opposto di ciò a cui siamo abituati, ultimamente però mi rendo conto di non essere più l’unico (per fortuna oserei aggiungere) ma inizialmente ero visto come un alieno, specialmente qui in Sicilia.</p><p>Ho scelto di trasferirmi a Campobello di Mazara, in provincia di Trapani, un piccolo paese a pochi km dalla costa sud-occidentale, contornato da campagne e da alberi di ulivo, non a caso la forza motrice di tutta la zona è proprio l’olio d’oliva.<br>Ricordo ancora come fosse ieri il giorno in cui andai all’anagrafe per registrare il cambio di residenza: gli operatori erano sbigottiti a fronte della mia scelta, come qualsiasi altra persona che tutt’ora incontro/conosco abituati appunto a tutt’altra “storia”.<br>Ognuno di essi sostiene la medesima tesi: qui non c’è nulla, perchè hai deciso di venire in Sicilia?<br>Personalmente ho vissuto un parallelismo tra Bergamo città e Sicilia sin dalla nascita, e posso sostenere che, nonostante le apparenze, in Sicilia si vive gran bene!</p><p>Sicuramente la mia posizione lavorativa di Freelancer e di Imprenditore full remote facilita la mia scelta, e sono consapevole che non tutti decidono di intraprendere questo percorso, però ad oggi, dopo 2 anni, posso dire che non tornerei indietro tanto facilmente (mai dire mai — sono molto scaramantico).</p><p>In Sicilia si respira un’aria pulita, si percepisce un’aria più tranquilla, dei ritmi rilassanti e tutto ciò incide in maniera decisiva sulla qualità della vita.<br>Quando cammini per strada, anche nella caotica Palermo, ti accorgi di quanto siano rilassate le persone, godi di colori vivi e ben definiti 365 giorni l’anno, dimentichi il grigio, il freddo, la nebbia, lo smog, e sostituisci il tutto con un cielo azzurro e la flora incontaminata dai colori nitidi accostati dal mare.</p><p>Autostrade sempre sgombre, innumerevoli siti e luoghi da visitare, cibo e pietanze di ogni tipologia facilmente reperibili ad ogni ora ed in ogni dove, spiagge e scorci incantevoli, montagne e colline e paesaggi da favola, questo e molto altro reperibile sempre, facilmente.</p><p>Giusto per fare qualche esempio: a Bergamo sotto casa mia c’era un bar che frequentavo per la colazione e un caffè più una brioche (qui in Sicilia la chiamano “cornetto”) superava facilmente i 2,00 € e spesso la qualità lasciava un pò a desiderare. Qui nel mio paesino di campagna con 2,00 € ho cornetto e caffè macchiato più tante chiacchiere socievoli e tanti sorrisi che sicuramente incidono sull’umore generale.<br>E se la mattina non volessi il classico cornetto e caffè?<br>Ampia scelta e vasta gamma di “pezzi di tavola calda” appena sfornati, parliamo di Calzoni fritti, Arancine, Sfogliate, Bocconcini, e molto altro ancora (prezzo medio a pezzo ≤ 2,00€).</p><p>Ma non è tutto oro quel che luccica, la maggior parte delle persone non percepisce il valore lavorativo e nemmeno dunque le esigenze di chi come me lavora da remoto.<br>Nonostante ciò la qualità della connessione internet non ha nulla da invidiare rispetto ad altre aree italiane (tengo sempre il confronto con l’area della bergamasca), io ad esempio a casa ho Fastweb in fibra, nella casa di mare (quella estiva) invece ho un’antenna di un fornitore di rete locale che mi permette di avere una connessione wi-fi decente anche laddove non prende la linea telefonica.<br>Insomma per chi lavora da casa come me internet non è un problema.</p><p>Veniamo ai lati positivi: le pause bagno :)</p><p>Avete capito bene, io tra un task e l’altro, tra una call e l’altra mi faccio una pausa al mare, un tuffo per rigenerarmi, il clima è favorevole e permette passeggiate all’aperto piacevoli oltre che rilassanti bagni al mare da Maggio a Ottobre inoltrato.<br>D’inverno la temperatura scende difficilmente sotto i 10°C nelle aree pianeggianti, se invece si sale di quota si ritrovano temperature come quelle di Bergamo.<br>L’isola si presta perfettamente per gli amanti degli sport d’acqua quali kitesurf, windsurf e surf quasi tutto l’anno, è piena di natura e quindi ideale per chi ama fare passeggiate o escursioni.</p><p>La Sicilia è grande, quasi sconfinata, non che la Lombardia sia da meno, assolutamente, quindi consiglio a chi volesse vivere la Sicilia per più di un paio di settimane l’anno di munirsi di automobile per poterla scoprire nella sua interezza.</p><p>Di seguito una gigantografia di me che lavoro dalla mia casa estiva fronte mare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rtSUSnjw17ZGwLc8w4Xgog.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ced4698cb00" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>