<?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 Ahmad Tahani on Medium]]></title>
        <description><![CDATA[Stories by Ahmad Tahani on Medium]]></description>
        <link>https://medium.com/@atahani?source=rss-1deeae9b6e18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kBL70DRCgn4iK0leQRrL9A.jpeg</url>
            <title>Stories by Ahmad Tahani on Medium</title>
            <link>https://medium.com/@atahani?source=rss-1deeae9b6e18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:31:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atahani/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[Technical Spikes on Agile Team]]></title>
            <link>https://medium.com/@atahani/technical-spikes-on-agile-team-7020ac55ce43?source=rss-1deeae9b6e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/7020ac55ce43</guid>
            <category><![CDATA[team-collaboration]]></category>
            <category><![CDATA[technical-analysis]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ahmad Tahani]]></dc:creator>
            <pubDate>Sat, 29 Jan 2022 23:35:52 GMT</pubDate>
            <atom:updated>2022-01-29T23:35:52.596Z</atom:updated>
            <content:encoded><![CDATA[<h3>Spikes on Agile Team</h3><p>When we run into a feature with unclear OKRs, we schedule a few meetings with stakeholders, then we break it down into stories and estimate it.<br>However, how do we analyze the user stories from a technical perspective after they are written?</p><p>Many teams don’t care so much about technical analysis. Instead, they assign the user stories to the most experienced developer, who then breaks them down into tasks.</p><p>This post will explain why Technical Spikes are important, how we can manage this type of spike and what the result can be.</p><h3>Technical Spikes: Why They Matter?</h3><p>We don’t have much detailed implementation around API design, so all the changes come from the developer who starts coding for that feature, Alternatively, two programmers could conduct a brainstorming session before coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TouU3fQYN9wQ4Zt45q4hHg.png" /><figcaption>Much thanks to <a href="https://excalidraw.com/">https://excalidraw.com</a></figcaption></figure><p>In this case, we followed the waterfall method, Frontend developers would block API implementation, and in some cases at the end of the sprint they would find they needed another API field because they were not on the same page at the beginning.</p><p>In order to present the results as soon as possible, developers begin coding before completing a detailed API design or flow diagram. their teammates are usually unaware of the implementation.</p><p>The implementation may lead to technical debt in the future if they don’t consider other developers’ ideas.</p><h3>What are the requirements for technical spikes?</h3><h4><strong>Clear User Stories</strong></h4><p>You should have clear user stories with all stakeholders’ OKRs. Developers can set up meetings with stakeholders during PI planning to find out the actual requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Id1Ym6W4BcL28fSkra_F4A.png" /><figcaption>Let’s show an example of a very simple story</figcaption></figure><h4><strong>Wireframes | Design</strong></h4><p>The design team should be provided mockups alongside stakeholders if the feature has UI, You can visualize the final product more easily with mockups provided by the design team.</p><blockquote>We need to keep in mind the user stories might be canceled after the technical spike, for example, we face a user story related to our big technical debt, we can’t handle it during this sprint, so we have to move or cancel it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*viBf9ZyO3J0SWiuOPEAHYw.png" /><figcaption>the Login page of <a href="https://github.com/atahani/my-emotions">My Emotion project</a></figcaption></figure><h3>Technical Spike Steps</h3><h4>Brainstorming Session - Drafting the Idea</h4><p><strong><em>(Session: max 45 min)</em></strong><br>Arrange a meeting with the most experienced developers on the team who is more knowledgeable about that specific component. Participants should have already read the feature document, user stories. An experienced developer should lead the meeting and document the key aspects of the implementation.</p><blockquote><strong>Goal:</strong> Analyzing the feature technically and breaking down the implementation into the requirements, and if further investigation is required, pointing it out and assigning it to the developer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5eAnSXETnmQeZaIg5yWtQ.png" /><figcaption>In this session, we don’t go so deeply into technical implementation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCy94KZ0B7GwsgD2GHfynw.png" /><figcaption>Assign these tasks to devs who are volunteers</figcaption></figure><h4>Making Proposals Around Implementation</h4><p>You will get the best ideas when you are in focus mode. During this phase, developers will determine the API and data model and flow individually or in collaboration with a teammate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPz5rG1Q_VYeO7v1CppvIA.png" /><figcaption>The proposal should be readable by technical teammates, so don’t try to be perfect</figcaption></figure><h4>Represent and Spike the Proposals</h4><p><strong><em>(Session: max</em> 1 hour)<br></strong>On the whiteboard, developers will present their API design, flow diagrams, and diagrams, other teammates will provide feedback, and the technical implementation will be spiked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*CwiA--ScyqUYX2qqMBGm5g.png" /><figcaption>Finding out what other developers think</figcaption></figure><blockquote><strong>Goal: </strong>Creating the first version of the technical specification.</blockquote><p>Technical specifications can include these items:</p><ul><li>API design (<a href="https://nordicapis.com/a-guide-to-api-first-design/">API-First design is well suited to agile frameworks</a>)</li><li>The data model that represents this feature, DB Schema</li><li>Include flow charts, process/activity diagrams, or any other diagrams that would aid in the implementation of the feature.</li><li>Analyze any breaking changes introduced by this feature in our architecture</li><li>What should be the minimum set of test cases to prove this feature?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*EWDtWpJpjc1O7-_j1X-w9g.png" /><figcaption>Usually, diagrams will clarify your idea much more easily</figcaption></figure><blockquote>The team can agree on a format of specification, for example, they can propose <a href="https://www.postman.com/use-cases/api-first-development/">the API concept on Postman</a> with the mocked server.</blockquote><h4>Individually Review the Technical Specification</h4><p>Posting the technical specification document widely within the company is a good way to discover any breaking changes. In addition, the Frontend developers can think about connecting the APIs to the UI process, and then offer their advice.</p><h4>Breaking It Down Into Tasks</h4><p><strong><em>(Session: max</em> 15 min)<br></strong>By helping the other teammates, the feature lead developer can break down the feature into tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*bQOY0EVtsQnf5wAd36jA5w.png" /><figcaption>the final tasks</figcaption></figure><blockquote>It would be better if the technical spikes were managed before the sprint began.</blockquote><p>If you have any ideas about technical spikes after reading this post, please make a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7020ac55ce43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reactjs SSR Tips and Tricks]]></title>
            <link>https://medium.com/@atahani/reactjs-ssr-tips-and-tricks-be9edff5b7bb?source=rss-1deeae9b6e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/be9edff5b7bb</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Ahmad Tahani]]></dc:creator>
            <pubDate>Fri, 27 Jul 2018 07:59:30 GMT</pubDate>
            <atom:updated>2018-07-27T07:59:30.869Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I developed a Reactjs project base on the SSR technique, I’ve learned a lot. Now I want to consider some of the blind points in Reactjs SSR.</p><blockquote>Maybe you’ve already known. But I think it would be useful to the developers who want to try SSR technique in Reactjs projects.</blockquote><p>At first point, you need to know about what difference between client-side rendering and server-side rendering.</p><h3>CSR vs. SSR</h3><p>On regular SPA applications, we import the JS bundle files to the empty HTML file as script tags.</p><p>We have these steps on initial page load.</p><ol><li>The user types the web page URL and press enter.</li><li>After some DNS manner, the GET request reaches to the server</li><li>The server sends an HTML file as response.</li><li>The browser is parsing the HTML and sees oh some external JS scripts should be downloaded.</li><li>After waiting to download JS files. The browser parses and runs them.</li><li>The root component is mounted it, and the componentDidMount event would be triggered, an async request run to get the data from the API.</li><li>The data get from the server, and that component will be re-rendered to show the new data.</li></ol><p>As you can see the data fetching and binding handle on the client side, We called it <strong><em>CSR</em></strong><em> ( Client Side Rendering )</em>.<br>On the other hands, we have <strong><em>SSR</em></strong><em> ( Server-Side Rendering )</em> with these steps. For better understanding, You can see this sequence diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*mUbTflrfnvHEThXOK95ndA.jpeg" /><figcaption>Server-Side Rendering ( SSR )</figcaption></figure><p>As you can see the user would be able to see the whole web page before the JS bundle files are downloaded.</p><p>We can use <em>defer attribute</em> for JS scripts since we have a completed HTML file with data and we don’t need to execute scripts as soon as possible.</p><pre>// You can find this line on server.js - razzle base project<br>&lt;script src=&quot;${assets<strong>.</strong>client<strong>.</strong>js}&quot; defer&gt;&lt;/script&gt;</pre><h3>Which boilerplate should I use?</h3><p>You could pick either <a href="https://github.com/zeit/next.js/">next.js</a> or <a href="https://github.com/redfin/react-server">react-server</a> or <a href="https://github.com/jaredpalmer/razzle">Razzle</a>. At first, I recommend seeing their documents. I found <a href="https://github.com/jaredpalmer/razzle">Razzle</a> much simpler.<br>Razzle is a tool to abstract all of the complex configurations that needed for SSR into a single dependency. You are not limited to Reactjs; you also can use it with <a href="https://reasonml.github.io/">Reason</a>, <a href="http://elm-lang.org/">Elm</a>, <a href="https://vuejs.org/">Vue</a>, <a href="https://angularjs.org/">Angular</a> as well. <br>At first, you start the project with zero configuration. Later you would be able to customize all of the settings according to your needs. You can even <a href="https://github.com/jaredpalmer/razzle#extending-webpack">extend the Webpack configs easily</a>.</p><h3>How can we reach to initial method on the server side?</h3><p>In Reactjs we are thinking in components. On CSR we always call the initial method on the componentDidMount event. So we need to access the initial method on server-side base on the route. <br>It’s a little complicated. Let ‘s see in action.</p><p>We usually define routes base on path and components like this. We could use the Route component everywhere.</p><pre>const MainApp = () =&gt; (<br> &lt;Switch&gt;<br>    &lt;Route exact path=&quot;/&quot; component={App} /&gt;<br>    &lt;Route path=&quot;/login&quot; component={Authorize} /&gt;<br> &lt;/Switch&gt;<br>);</pre><p>There is a problem on SSR since we want to access to the component base on URL on the server. So we need to define all of the routes in one place in this way.</p><pre>const routes = [<br>  { <br>    path: &quot;/&quot;,<br>    component: App,<br>    initialMethod: () =&gt; getSomeData(),<br>    routes: [<br>      {<br>        path: &quot;/&quot;,<br>        component: Dashboard,<br>        exact: true,<br>        initialMethod: () =&gt; getDashboardData(),<br>      },<br>      {<br>        path: &quot;/notifications&quot;,<br>        component: Notifications,<br>        beAuthorized: true,<br>        initialMethod: () =&gt; getLatestNotifications(),<br>      },<br>      {<br>        path: &quot;/settings&quot;,<br>        component: Settings,<br>        beAuthorized: true<br>        routes: [<br>          {<br>            path: &quot;/settings/profile&quot;,<br>            component: ProfileSettings,<br>            initialMethod: () =&gt; getUserProfile(),<br>          }<br>        ],<br>      }<br>    ]<br>  },<br>  // other root routes like /login<br>];</pre><p>We could define the initialMethod here or inside the Component as a method. You should note this method must be a Promise.</p><p>Now we should render routes base on Route component. At first, we need a Custom Route component to handle custom routes and beAuthorized attributes.</p><pre>import React from &quot;react&quot;;<br>import { Route, Redirect } from &quot;react-router-dom&quot;;</pre><pre>const CustomRoute = ({<br>  component: Component,<br>  cmpProps = {},<br>  routes,<br>  exact = false,<br>  path,<br>  beAuthorized = false<br>}: Props) =&gt; {<br>  // detect is user logged in or not<br>  const isUserLoggedIn = getState().user;<br>  // redirect the guest user on the protected path<br>  if (beAuthorized &amp;&amp; !isUserLoggedIn) {<br>    return &lt;Redirect to=&quot;/login&quot; /&gt;;<br>  }<br>  return (<br>    &lt;Route<br>      path={path}<br>      exact={exact}<br>      render={props =&gt; <br>          &lt;Component <br>              {...props} <br>              {...cmpProps} <br>              routes={routes} <br>          /&gt; }<br>    /&gt;<br>  );<br>};</pre><p>We passed routes attribute to the Component. For example, on Settings components, we could reach to routes via routes props.</p><p>We also define a component to iterate through the routes.</p><pre>import React from &quot;react&quot;;<br>import { Switch } from &quot;react-router-dom&quot;;<br>import CustomRoute from &quot;../CustomRoute&quot;;</pre><pre>const Routes = ({ routes, switchProps = {} }: Props) =&gt; (<br>  &lt;Switch {...switchProps}&gt;<br>    {routes.map((r, i) =&gt; (<br>      &lt;CustomRoute<br>        key={r.key || i}<br>        path={r.path}<br>        component={r.component}<br>        exact={r.exact}<br>        beAuthorized={r.beAuthorized}<br>        routes={r.routes}<br>      /&gt;<br>    ))}<br>  &lt;/Switch&gt;<br>);</pre><p>On the server we could get the initialMethod base on match route. We have a helper function called matchPath, for more information see <a href="https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config">this document</a>.</p><pre>import { matchRoutes } from &#39;react-router-config&#39;</pre><pre>// inside a request /../ <br>// router.get(&quot;/*&quot;,(res, req){ /.../ })</pre><pre>const branch = matchRoutes(routes, location.pathname)</pre><pre>const promises = branch.map(({ route, match }) =&gt; {<br>  return route.initialMethod<br>    ? route.initialMethod(match)<br>    : Promise.resolve(null)<br>})</pre><pre>Promise.all(promises).then(data =&gt; {<br>  // now you can send the rendered view to user<br>})</pre><p>We are using Promise.all() to wait until all of the initialMethod has been resolved.</p><p>For example, if the request URL is / the Dashboard component should be rendered. In this case, we the two initialMethod to perform as Promise, getSomeData() and getDashboardData(). Could be two async API request, so you should notice to the performance issues.</p><p><strong><em>The best way to test server-side fetching is disabling the JavaScript, how we can do that?</em></strong></p><p>1- Go to Chrome Developer Tools</p><p>2- Go to Settings ( Press F1 )</p><p>3- Check the Disable JavaScript from Debugger section</p><p>You can test it on the <a href="https://www.producthunt.com/">Producthunt website</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ye0S20HkVFg9WnD3Tt2y1Q.png" /><figcaption>The user can see the content even when JS is disabled.</figcaption></figure><p>We demonstrate it in a simple use case; In real-world applications, you would use redux-thunk or redux-saga and also you may need to pass some parameters to initialMethod. The <a href="https://www.youtube.com/watch?v=duhudXkHRf4">redux-thunk implementation</a> is much more the same, but the redux-saga is a little different.</p><h3>Where Should I Store Persist Data Like Authentication Token?</h3><p>On regular CSR web apps, you can save persist data on the local storage or IndexedDB. But on SSR we can’t access to these data like the authentication token in this way. So we should change our approach to Cookie.</p><p>For authentication, we have this scenario:</p><ol><li>API on the client side authorizes the user.</li><li>The authentication data like access token has been saved to a cookie (browser cookie, tmp_user_atuh).</li><li>On the server-side, we can access to the cookie, Now we can send requests to the protected endpoints.</li><li>For better security, we save the cookie by the server. ( since the httpOnly option is set, nobody can modify it on the browser, user_auth).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dftASgDbIaifCJO6KEZ-DA.png" /><figcaption>Authentication Flow SSR</figcaption></figure><blockquote>Our single source of truth is <strong>Redux store</strong>. Maybe the access token had been expired before SSR so at first point must refresh the access token then process the other API requests. We should always assume <em>the Redux state as the single source of truth</em> and check it if the cookie is not equal to the current state, we should update the value of the cookie.</blockquote><h3>How can we access preloaded state on the client side?</h3><p>Through the data fetching on server-side, we have some bunch of data that bind to the components. On the client side we need these data as well, for example, our component has been connected to <em>the redux store</em>. So redux store should have these data as <strong>the initial state</strong>. We use window global object to pass redux store to the client side.</p><pre>&lt;script&gt;<br>   window.__INITIAL_STATE__ = ${<strong>serialize</strong>(preloadedState)};<br>&lt;/script&gt;</pre><h3>How can we take apart two environments in data rendering?</h3><p>On server-side we don’t have window object, for example, you may want to get window.location on your application, so you need to take apart two environments from each other. the easy way is you assume a state in the redux store like app.isSSR, on the server side should be set is as true, on the client should be set it as false, with this trick you would be able to pass current location on the server with a state like app.serverPath , So if you want to access current pathname, you could do like this.</p><pre>const mapStateToProps = state  =&gt; ({<br>  pathname: state.app.isSSR ? <br>        state.app.serverPath : <br>        window.location.pathname,<br>});</pre><h3>Caveats</h3><ol><li>SSR is not suitable for any project, for example, SSR is not a good fit for a Dashboard application.</li><li>Always consider performance issues on server-side fetching.</li><li>Don’t involve SSR technique at the beginning of the project since your project becomes complicated you could apply it whenever you need to it.</li><li>While we have server-side fetching, we need to provide more resource on the server, so need to mature server resource before moving to SSR approach.</li><li>You don’t have to follow SSR on entire your application. You could setup SSR just for some particular routes to gain better performance on initial load.</li></ol><blockquote><em>This is my first blog post in English 😅; I hope it would be helpful. I would be thrilled to hear your feedback as well.😄</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be9edff5b7bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>