<?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 Lamrini Asmae on Medium]]></title>
        <description><![CDATA[Stories by Lamrini Asmae on Medium]]></description>
        <link>https://medium.com/@lamrini.asmae01?source=rss-b65eea909304------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XgEEXwECOMc0vumPQxZLVg.png</url>
            <title>Stories by Lamrini Asmae on Medium</title>
            <link>https://medium.com/@lamrini.asmae01?source=rss-b65eea909304------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 14:21:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lamrini.asmae01/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[Docker Simplifié : Comprendre et Utiliser en Quelques Étapes Faciles]]></title>
            <link>https://medium.com/@lamrini.asmae01/docker-simplifi%C3%A9-comprendre-et-utiliser-en-quelques-%C3%A9tapes-faciles-840137f5f2a7?source=rss-b65eea909304------2</link>
            <guid isPermaLink="false">https://medium.com/p/840137f5f2a7</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Lamrini Asmae]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 00:01:01 GMT</pubDate>
            <atom:updated>2026-02-09T00:01:01.702Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Docker Simplifié : Comprendre et Utiliser en Quelques Étapes Faciles</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVlYcKUjNQsDlJf0GPIaQg.png" /></figure><h4><em>Docker, Ce N’est Pas Si Difficile !</em></h4><p>Docker peut sembler complexe au début avec des termes comme <em>conteneurs</em>, <em>images</em>, ou <em>registres</em>. Pourtant, c’est un outil puissant qui simplifie et accélère le déploiement d’applications. Cet article a pour objectif de démystifier Docker en expliquant les concepts de façon claire et en partageant des commandes de base pour commencer facilement.</p><h4>1. Qu’est-ce que Docker ?</h4><p><strong>Docker</strong> est un outil qui vous permet de créer des applications qui fonctionnent partout de la même manière, que ce soit sur votre ordinateur, sur un serveur distant ou dans le cloud. Il le fait en isolant l’application dans un conteneur.</p><p><strong>Exemple :</strong></p><p><em>Imaginez que vous avez une application Node.js. En l’exécutant dans un conteneur Docker, vous êtes sûr qu’elle tournera de la même manière sur votre ordinateur, chez un collègue, ou même sur un serveur distant.</em></p><p><strong>2. Docker Hub : Le Magasin des Conteneurs</strong></p><p>Le Docker Hub est une sorte de “magasin” où vous pouvez trouver des conteneurs prêts à l’emploi, appelés <em>images Docker</em>. Par exemple, si vous voulez utiliser une base de données MySQL, vous pouvez télécharger une image Docker de MySQL et l’utiliser immédiatement sans avoir à tout configurer manuellement.</p><h4>Quelques Commandes Docker Hub :</h4><p>Se connecter à Docker Hub :</p><pre>docker login </pre><p>Télécharger une image depuis Docker Hub :</p><pre>docker pull ubuntu</pre><p>Vérifier les images que vous avez téléchargées :</p><pre>docker images</pre><h4>3. Qu’est-ce qu’une Image Docker ?</h4><p>Une image Docker est un modèle prêt à l’emploi qui contient tout le nécessaire pour exécuter une application : le code, les dépendances, et les configurations. C’est l’élément de base à partir duquel on crée des conteneurs.</p><h4>Exemple simple d’Image Docker (Node.js) :</h4><p>Vous voulez créer une image pour votre application Node.js. Voici ce que vous feriez avec un Dockerfile (fichier de configuration Docker) :</p><pre>FROM node:14<br>WORKDIR /app<br>COPY . .<br>RUN npm install<br>EXPOSE 3000<br>CMD [&quot;node&quot;, &quot;app.js&quot;]</pre><p>Ce fichier définit comment construire une image avec Node.js. Une fois le Dockerfile écrit, vous pouvez créer l’image avec la commande :</p><pre>docker build -t mon-app .</pre><h4>4. Qu’est-ce qu’un Conteneur Docker ?</h4><p>Un conteneur Docker est une instance en cours d’exécution d’une image. Il contient tout ce dont une application a besoin pour fonctionner, comme le code, les bibliothèques, et les configurations. Contrairement à une machine virtuelle, un conteneur est léger, rapide à démarrer et fonctionne de manière isolée, sans interférer avec les autres applications.</p><h4>Exemple :</h4><p><em>Lancez une image et créez un conteneur pour votre application :</em></p><pre>docker run -d -p 8080:80 --name mon-conteneur mon-app</pre><ul><li>-d : Lancer le conteneur en arrière-plan (détaché).</li><li>-p 8080:80 : Mappe le port 8080 de machine au port 80 du conteneur.</li><li>--name : Donne un nom à votre conteneur.</li></ul><p>Voir les conteneurs en cours d’exécution :</p><pre>docker ps</pre><h4>5. Quelques Commandes Essentielles pour Démarrer</h4><ul><li>Voir les conteneurs en cours d’exécution :</li></ul><pre>docker ps</pre><ul><li>Arrêter un conteneur :</li></ul><pre>docker stop mon-conteneur</pre><ul><li>Supprimer un conteneur :</li></ul><pre>docker rm mon-conteneur</pre><ul><li>Supprimer une image Docker :</li></ul><pre>docker rmi mon-app</pre><h3>6. Pourquoi Docker Rend Tout Plus Simple</h3><p><strong>Portabilité :</strong> Votre application fonctionne partout ! Vous n’avez plus à vous soucier des différences entre les environnements de développement et de production.</p><p><strong>Isolation :</strong> Chaque application vit dans son propre conteneur, ce qui signifie qu’elles ne se gênent pas les unes les autres.</p><p><strong>Rapidité :</strong> Vous pouvez lancer des conteneurs très rapidement. C’est beaucoup plus rapide que d’utiliser des machines virtuelles traditionnelles.</p><p><em>Docker rend le développement et le déploiement d’applications beaucoup plus simples, en offrant une solution efficace pour isoler, déployer et exécuter vos applications où que vous soyez</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=840137f5f2a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up React Router v7 and Build a Basic Navigation System in React.]]></title>
            <link>https://medium.com/@lamrini.asmae01/how-to-set-up-react-router-v7-and-build-a-basic-navigation-system-in-react-ad2a3fa2b1fe?source=rss-b65eea909304------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad2a3fa2b1fe</guid>
            <category><![CDATA[react-navigation]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[react-router-v7]]></category>
            <dc:creator><![CDATA[Lamrini Asmae]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 17:07:15 GMT</pubDate>
            <atom:updated>2025-08-24T17:07:15.311Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-lXFnnQ6XT8arqyo9f1MNQ.png" /></figure><p><em>“To set a strong foundation for your project, it’s essential to start with a clear initial structure and a well-organized routing system.”</em></p><p><strong>React Router</strong> is one of the most popular routing libraries in React applications, enabling easy navigation between pages without reloading the entire app. In this article, we’ll walk through how to get started with React Router v7 and add a basic navigation system to kick off your project.</p><h3>Step 1: Install React Router v7</h3><pre>npx create-react-app@latest my-project<br>cd my-project<br>npm run dev</pre><h3>Step 2: Organize Your Project Structure</h3><p>In React Router v7, routes are defined in separate files under a “routes” folder inside the app directory.</p><p>home.tsx:</p><pre>export default function Home() {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Welcome to the Home Page!&lt;/h1&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Step 3: Set Up Routes in routes.ts</h3><p><em>React Router v7 uses a simpler API with route configuration.</em></p><pre>import { type RouteConfig, index , route, prefix } from &quot;@react-router/dev/routes&quot;;<br><br>export default [<br>  // This creates an index route for the Home page<br>  index(&quot;routes/home.tsx&quot;), <br>  // This creates a route for the About page<br>  route(&quot;about&quot;, &quot;routes/about.tsx&quot;),<br><br>  // Example of nested routes with a prefix<br>  ...prefix(&quot;products&quot;, [<br>    index(&quot;routes/products.tsx&quot;), <br>    route(&quot;:productName&quot;, &quot;routes/product.tsx&quot;), //for country pages<br>  ]),<br>] satisfies RouteConfig;</pre><h3>Step 4: Update the rout.tsx Component</h3><p>In app/rout.tsx, modify the code as follows:</p><pre>import { Outlet } from &quot;react-router-dom&quot;;<br>import NavBar from &quot;./components/NavBar&quot;;<br><br>export default function App() {<br>  return (<br>    &lt;div className=&quot;min-h-screen flex flex-col&quot;&gt;<br>      &lt;NavBar /&gt;<br>      &lt;main className=&quot;flex-1 p-4&quot;&gt;<br>        &lt;Outlet /&gt; {/* This renders the matched route */}<br>      &lt;/main&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Step 5: Create a Navigation Bar Component</h3><p>A navigation bar helps users easily switch between pages. In React Router v7, you can use the NavLink component to highlight the active link.</p><p>Create a file app/components/NavBar.tsx and add the following code:</p><pre>import { NavLink } from &quot;react-router-dom&quot;;<br><br>export default function NavBar() {<br>  return (<br>    &lt;nav className=&quot;bg-blue-500 p-4&quot;&gt;<br>      &lt;ul className=&quot;flex space-x-6&quot;&gt;<br>        &lt;li&gt;<br>          &lt;NavLink to=&quot;/&quot; className=&quot;text-white font-bold&quot;&gt;<br>            Home<br>          &lt;/NavLink&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;<br>          &lt;NavLink to=&quot;/about&quot; className=&quot;text-white font-bold&quot;&gt;<br>            About<br>          &lt;/NavLink&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;<br>          &lt;NavLink to=&quot;/products&quot; className=&quot;text-white font-bold&quot;&gt;<br>            Products<br>          &lt;/NavLink&gt;<br>        &lt;/li&gt;<br>      &lt;/ul&gt;<br>    &lt;/nav&gt;<br>  );<br>}</pre><h3>Conclusion</h3><p>React Router v7 simplifies routing and navigation, making it easy to scale your app with nested routes and dynamic parameters. With just a few steps, we’ve set up a basic React Router system with navigation, a layout, and flexible routing for dynamic content. You can now expand this system by adding more components, pages, and complex route structures as needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad2a3fa2b1fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentification API avec Laravel 12 + Sanctum (token-based)]]></title>
            <link>https://medium.com/@lamrini.asmae01/authentification-api-avec-laravel-12-sanctum-token-based-8e2a383bb8fd?source=rss-b65eea909304------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e2a383bb8fd</guid>
            <category><![CDATA[laravel-sanctum]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Lamrini Asmae]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 21:57:36 GMT</pubDate>
            <atom:updated>2025-07-22T22:20:22.794Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bC5vgLPFf48nWNwsuy4Yig.png" /></figure><h3>Introduction</h3><p>Hello développeur·se Laravel 👨‍💻👩‍💻<br>Tu construis une API pour un frontend React, Vue ou une app mobile, et tu veux mettre en place une <strong>authentification sécurisée et simple à maintenir</strong> ? Tu es au bon endroit !</p><p>Dans cet article, on va voir pas à pas comment utiliser Sanctum avec Laravel 12 pour gérer : l’inscription utilisateur, la connexion via token, la déconnexion propre, et la récupération du profil utilisateur.</p><p>Le tout basé sur la <strong>documentation officielle</strong>, avec un exemple concret, prêt à être testé via Postman ou ton interface frontend.</p><p>🔗 <a href="https://laravel.com/docs/12.x/sanctum">Documentation officielle Sanctum — Laravel 12</a></p><p>🔹 1. Initialiser l’environnement API:</p><p><em>Cette commande configure rapidement ton projet Laravel pour qu’il fonctionne </em><strong><em>uniquement en mode API</em></strong><em>, en supprimant les éléments inutiles pour une application backend dédiée.</em></p><pre>php artisan install:api</pre><p>🔹 2. Installer Sanctum</p><pre>composer require laravel/sanctum</pre><p>🔹 3. Publier la configuration</p><pre>php artisan vendor:publish --tag=sanctum-config</pre><p>🔹 4. Migrer la table des tokens</p><pre>php artisan migrate</pre><p>🔹 5. Ajouter le trait HasApiTokens au modèle User.php</p><pre>use Laravel\Sanctum\HasApiTokens;</pre><pre>class User extends Authenticatable<br>{<br>    use HasApiTokens, HasFactory, Notifiable;<br>}</pre><p>🔹 6. Définir les routes API:</p><blockquote>Ici, on utilise <strong>auth:sanctum</strong> pour protéger les routes. On <strong>n’utilise pas </strong>l’authentification via cookie (<em>EnsureFrontendRequestsAreStateful</em>) car ce n’est <strong>pas nécessaire</strong> en API token-based.</blockquote><pre>use App\Http\Controllers\AuthController;</pre><pre>Route::post(&#39;/register&#39;, [AuthController::class, &#39;register&#39;]);<br>Route::post(&#39;/login&#39;, [AuthController::class, &#39;login&#39;]);<br>Route::middleware(&#39;auth:sanctum&#39;)-&gt;group(function () {<br>    Route::post(&#39;/logout&#39;, [AuthController::class, &#39;logout&#39;]);<br>//Cette route permet au frontend de récupérer les infos de l&#39;utilisateur actuellement connecté via son token Sanctum.<br>    Route::get(&#39;/user/me&#39;, function (Request $request) {<br>        return response()-&gt;json($request-&gt;user());<br>    });<br>});</pre><p>🔹 7. Créer le contrôleur d’authentification</p><pre>php artisan make:controller AuthController</pre><pre>namespace App\Http\Controllers;<br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Hash;<br>use Illuminate\Validation\ValidationException;<br>use App\Models\User;<br>class AuthController extends Controller<br>{<br>    public function register(Request $request)<br>    {<br>        $validated = $request-&gt;validate([<br>            &#39;name&#39; =&gt; &#39;required|string|max:255&#39;,<br>            &#39;email&#39; =&gt; &#39;required|email|unique:users,email&#39;,<br>            &#39;password&#39; =&gt; &#39;required|string|min:6|confirmed&#39;,<br>        ]);<br>        $user = User::create([<br>            &#39;name&#39; =&gt; $validated[&#39;name&#39;],<br>            &#39;email&#39; =&gt; $validated[&#39;email&#39;],<br>            &#39;password&#39; =&gt; Hash::make($validated[&#39;password&#39;]),<br>        ]);<br>        $token = $user-&gt;createToken(&#39;auth_token&#39;)-&gt;plainTextToken;<br>        return response()-&gt;json([<br>            &#39;user&#39; =&gt; $user,<br>            &#39;token&#39; =&gt; $token,<br>        ], 201);<br>    }<br>    public function login(Request $request)<br>    {<br>        $credentials = $request-&gt;validate([<br>            &#39;email&#39; =&gt; &#39;required|email&#39;,<br>            &#39;password&#39; =&gt; &#39;required|string&#39;,<br>        ]);<br>        $user = User::where(&#39;email&#39;, $credentials[&#39;email&#39;])-&gt;first();<br>        if (! $user || ! Hash::check($credentials[&#39;password&#39;], $user-&gt;password)) {<br>            throw ValidationException::withMessages([<br>                &#39;email&#39; =&gt; [&#39;Les identifiants sont incorrects.&#39;],<br>            ]);<br>        }<br>        $token = $user-&gt;createToken(&#39;auth_token&#39;)-&gt;plainTextToken;<br>        return response()-&gt;json([<br>            &#39;user&#39; =&gt; $user,<br>            &#39;token&#39; =&gt; $token,<br>        ]);<br>    }<br>    public function logout(Request $request)<br>    {<br>        $request-&gt;user()-&gt;currentAccessToken()-&gt;delete();<br>        return response()-&gt;json([<br>            &#39;message&#39; =&gt; &#39;Déconnexion réussie.&#39;,<br>        ]);<br>    }<br>}</pre><p>🔹 8. Test possible avec Postman ou frontend :</p><p>POST /api/register avec name, email, password,password_confirmation</p><p>POST /api/login avec email, password</p><p>POST /api/logout avec header Authorization: Bearer {token}</p><p>GET /api/user/me avec header Authorization: Bearer {le_token_reçu_au_login}</p><h3>Authentification : prête à 100 %</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e2a383bb8fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Steps to Initialize a Laravel Project]]></title>
            <link>https://medium.com/@lamrini.asmae01/steps-to-initialize-a-laravel-project-b766edb5f63a?source=rss-b65eea909304------2</link>
            <guid isPermaLink="false">https://medium.com/p/b766edb5f63a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[framework]]></category>
            <dc:creator><![CDATA[Lamrini Asmae]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 12:07:00 GMT</pubDate>
            <atom:updated>2025-04-02T12:07:00.869Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*BD01SkrySAbgefX52SVHiw.jpeg" /></figure><p><strong><em>“The right start to a project can spark a real desire to dive deeper and learn more. Seeing your Laravel project up and running with just a few simple commands builds excitement and fuels your curiosity to explore further.”</em></strong></p><p>Laravel is a powerful PHP framework that makes it easy to build modern web applications. Getting started with a Laravel project is straightforward, and you can have a fresh project up and running in just a few steps. Here’s a simple guide to initialize a new Laravel project:</p><h3>1. Install Composer</h3><p>Before anything, make sure you have <strong>Composer</strong> installed on your machine. Composer is a dependency manager for PHP, and Laravel uses it to manage packages and libraries. You can download and install it from <a href="https://getcomposer.org/">getcomposer.org</a></p><p>To check if Composer is installed, run this command in your terminal:</p><pre>composer --version</pre><h3>2. Install Laravel via Composer</h3><p>Once Composer is installed, you can create a new Laravel project with a single command. Open your terminal or command prompt and run:</p><pre>composer create-project --prefer-dist laravel/laravel Myproject</pre><h3>3. Set Up Environment Configuration</h3><p>Laravel uses an .env file to store environment variables such as database settings and application keys. The .env file is already included in your project, but you should check and update certain values, especially for your database connection.</p><pre>DB_CONNECTION=mysql<br>DB_HOST=127.0.0.1<br>DB_PORT=3306<br>DB_DATABASE=database_name<br>DB_USERNAME=database_user<br>DB_PASSWORD=database_password</pre><h3>4. Generate Application Key</h3><p>Laravel requires an application key, which is automatically generated when you create a new project. If you need to regenerate the application key (or if it wasn’t generated), you can do so with the following Artisan command:</p><pre>php artisan key:generate<br># This will generate a random key and update the .env file with the correct value for APP_KEY.</pre><h3>5. Run the Development Server</h3><p>Now that your Laravel project is set up, you can run the built-in development server to see your application in action. Use the following command to start the server:</p><pre>php artisan serve</pre><p>By default, the application will be accessible at http://127.0.0.1:8000 in your browser.</p><p>Now you have a fresh Laravel project up and running! From here, you can begin building out your application by defining routes, creating controllers, working with views, and setting up models to interact with the database.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b766edb5f63a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>