<?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 Indranil Majumder on Medium]]></title>
        <description><![CDATA[Stories by Indranil Majumder on Medium]]></description>
        <link>https://medium.com/@indranilmajumder?source=rss-55f9cb968b29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*K-aqk1qpwonyijAZ.</url>
            <title>Stories by Indranil Majumder on Medium</title>
            <link>https://medium.com/@indranilmajumder?source=rss-55f9cb968b29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:04:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@indranilmajumder/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[Software Delivery Transformation in the age of AI - Part 1: Baseline, Target Operating Model, and…]]></title>
            <link>https://indranilmajumder.medium.com/software-delivery-transformation-in-the-age-of-ai-part-1-baseline-target-operating-model-and-c6fb1aaf275e?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6fb1aaf275e</guid>
            <category><![CDATA[operating-models]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[kpi]]></category>
            <category><![CDATA[transformation]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 06:47:22 GMT</pubDate>
            <atom:updated>2026-08-03T06:47:22.498Z</atom:updated>
            <content:encoded><![CDATA[<h3>Software Delivery Transformation in the age of AI - Part 1: Baseline, Target Operating Model, and KPIs</h3><p><em>This is Part 1 of a two-part series. Part 2 will follow once the transformation is complete, with the results, the surprises, and what I’d do differently.</em></p><h3>Why I’m writing this</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HKf7PImz_dZP0J-N" /><figcaption>two-week cadence</figcaption></figure><p>A few months ago, I took on the job of helping few in-house product/project teams move from slow, unpredictable release cycles to a disciplined two-week cadence. The teams spanned PMO, Development, DevOps, QA, and Business Analysis — five functions that had never really operated against a shared definition of “done,” “good,” or “ready.”</p><p>No two teams measured progress the same way. Some had dashboards nobody trusted. Some had no dashboards at all. Everyone <em>felt</em> like they knew how mature their delivery practice was, but nobody could prove it with a number.</p><p>This post is about the first three months of that work: how we built a baseline, how we turned that baseline into a Target Operating Model (TOM), how we connected that TOM to KPIs that actually mean something, and how we built a way to assess live projects against it — sprint by sprint, not just once a year.</p><p>I’ll also talk honestly about where AI genuinely helped and where it didn’t replace judgment at all.</p><h3>The starting point: five functions, zero shared language</h3><p>Before you can transform anything, you need to know where you actually are — not where people <em>think</em> you are. This sounds obvious. It’s the step almost every transformation program tries to skip, because it’s slow and a little uncomfortable.</p><p>We started by pulling together every existing document, sprint report, tooling audit, and status update we could find across the nine teams. Most of what existed was qualitative — phrases like “delivery is generally on time” or “code quality has improved” — rather than actual numbers.</p><p><strong>Guideline #1: If your baseline is made of adjectives instead of numbers, you don’t have a baseline yet. You have an opinion.</strong></p><p>So the first real task was converting adjectives into defensible numbers, and being honest about how confident we were in each one.</p><h3>Step 1 — Establish the current baseline</h3><p>Here’s the process we used, function by function:</p><ol><li><strong>Collect everything qualitative first.</strong> Status reports, retro notes, tooling inventories, past audits — anything that described how a team worked.</li><li><strong>Identify candidate metrics.</strong> For each function, we asked: what would actually tell us if this team is improving? Not what’s easy to measure — what matters.</li><li><strong>Convert descriptions into estimated baselines.</strong> Where hard data existed, we used it. Where it didn’t, we derived a defensible estimate from the qualitative evidence and labeled it clearly as an estimate.</li><li><strong>Flag confidence honestly.</strong> Every baseline number got a confidence rating — High, Medium, or Low — based on how much real instrumentation backed it up.</li><li><strong>Write the “why” down, not just the “what.”</strong> For every number, we kept a short derivation note explaining exactly which source it came from and how we got there.</li></ol><p>That last point turned out to matter more than I expected. Six months into a program, nobody remembers why a number was set the way it was. Writing it down at the time saves you from re-litigating it later — and it protects your credibility when someone senior asks “how did you get this number?”</p><p><strong>Guideline #2: A polished number without a visible confidence level is more dangerous than an honest gap.</strong> Executives can work with “we’re not sure yet, and here’s why.” They can’t work with false precision that falls apart under questioning.</p><p>One thing this process caught early: one of our proposed KPIs was quietly measuring two different things depending on who you asked. On paper it looked like a metric for a customer-facing capability. In reality, every scrap of evidence we had only covered internal developer tooling adoption. Under the loose definition, the baseline looked decent. Under the strict, honest definition, it was close to zero. We chose the honest number. It was an uncomfortable conversation, but it was the right one — a fuzzy metric that flatters you today will embarrass you in six months when someone finally checks it against reality.</p><h3>Step 2 — Build the Target Operating Model (TOM)</h3><p>Once we knew where we stood, we needed to define where “good” actually looks like — in enough detail that two different people assessing the same project would land on the same score.</p><p>We built this as a structured scoring framework rather than a narrative document, because narratives are easy to agree with in a meeting and impossible to apply consistently afterward.</p><p>The TOM ended up with:</p><ul><li><strong>Multiple dimensions</strong> covering the full delivery lifecycle — planning, engineering practice, quality, security, release management, and operational stability.</li><li><strong>Dozens of specific criteria</strong> under each dimension, each one written as something you can actually check, not something you have to interpret.</li><li><strong>Weighted scoring</strong> — not every criterion matters equally. Some are Critical, some High, some Medium, and the weighting reflects that.</li><li><strong>Clear thresholds</strong> — a defined score band for “ready to go,” a band for “conditional go with named risks,” and a band for “not ready.”</li><li><strong>Hard override conditions</strong> — a small number of non-negotiable criteria that force a “not ready” result regardless of the overall score. (You do not want a team scoring 90% overall while shipping with a known critical security gap.)</li></ul><p><strong>Guideline #3: Every criterion in your TOM should trace back to a source.</strong> We cross-referenced every single scoring item back to the specific section of the governing document it came from. This did two things: it made the framework defensible when challenged, and it made it obvious which parts of the model were opinion versus policy.</p><h3>Step 3 — Align KPIs to the TOM, not the other way around</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*Ns25967fqb4pl65k" /><figcaption>DORA</figcaption></figure><p>A common trap in transformation work is picking KPIs because they’re easy to collect, then trying to justify them afterward. We deliberately worked in the opposite direction.</p><p>For each function, we asked: <strong>what does the Target Operating Model actually require us to be good at, and what number would prove we’re getting there?</strong></p><p>That gave us a small set of KPIs per function — deliberately small, because a KPI framework nobody can hold in their head is a KPI framework nobody uses. For the engineering side alone, we landed on five: a standardization index for engineering practice, on-time delivery / sprint velocity, adoption of AI-assisted development tooling, production change failure rate, and production stability.</p><p>For each KPI we then built:</p><ul><li>A <strong>baseline value</strong>, sourced from Step 1.</li><li>A <strong>forward trajectory</strong> — realistic quarter-by-quarter targets, not aspirational ones.</li><li>An explicit <strong>link back to the TOM criteria</strong> it was proving out.</li><li>A <strong>confidence rating</strong>, same as the baseline work.</li></ul><p>One structural lesson worth sharing: when a KPI’s trend history only has one data point, a naive “compare to previous period” formula will silently fall back to comparing against the <em>target</em> instead — which makes a team look artificially close to goal. We caught this by stress-testing the model with edge cases (one quarter of data, no data, text-based dropdown values instead of numbers) before it ever reached a live dashboard. Test your formulas the way you’d test code, not the way you’d proofread a memo.</p><p><strong>Guideline #4: A KPI that isn’t tied to a specific piece of the Target Operating Model is just a metric someone liked. Tie every KPI to the “why.”</strong></p><h3>Step 4 — Build an assessment framework for live, in-flight projects</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vtN9LHTUclorigxc" /><figcaption>running sprints</figcaption></figure><p>A TOM and a KPI framework are only useful if you can apply them to a project that’s already running sprints — not just to a project starting from scratch. So the last piece was an assessment mechanism teams could actually use, sprint after sprint.</p><p>We built this as a reusable scorecard:</p><ol><li>A <strong>master reference checklist</strong> — the full set of TOM criteria, maintained in one place so it never drifts between teams.</li><li>A <strong>reusable project scorecard template</strong> — so every team scores itself against the exact same structure.</li><li><strong>Per-project sheets</strong> for each team currently in scope, populated as they go.</li><li>A <strong>rollup dashboard</strong> giving a single view across all projects — useful for spotting patterns (e.g., every team struggling with the same criterion probably means the criterion, the tooling, or the training needs fixing — not the teams).</li><li>A <strong>sign-off mechanism</strong> with two accountable reviewers per assessment, so a Go/No-Go decision is never resting on one person’s judgment.</li></ol><p><strong>Guideline #5: Build the scorecard once, as a template, not once per project.</strong> Every project-specific version we built from scratch introduced small inconsistencies that made cross-project comparison harder. A shared template with locked structure and open data cells fixed that.</p><h3>Where AI actually helped</h3><p>I want to be specific here rather than just saying “AI helped a lot,” because I think vague claims about AI are part of why some transformation leaders are skeptical of it.</p><ul><li><strong>Turning qualitative baselines into structured estimates.</strong> Feeding in dozens of status reports and retro notes and asking for a structured, sourced summary was dramatically faster than doing it by hand — and less prone to the bias of remembering only the reports I’d read most recently.</li><li><strong>Catching definitional problems.</strong> The KPI that was quietly measuring two different things got caught partly because I asked for a plain-language description of exactly what evidence backed each number, which made the mismatch obvious in a way a spreadsheet cell doesn’t.</li><li><strong>Formula and edge-case testing.</strong> Walking through “what happens if there’s only one data point,” “what happens if the field is empty,” “what happens if the value is text instead of a number” is exactly the kind of exhaustive, patient checking that’s easy to skip under deadline pressure and easy to delegate to a tool that won’t get bored.</li><li><strong>First drafts of governance documents.</strong> Derivation memos, scoring rubrics, and executive summaries all started as AI-generated first drafts that I then corrected, tightened, and fact-checked against source documents. It didn’t replace the judgment calls — definitional precision, what counts as evidence, where the honest number goes even when it’s uncomfortable — but it removed a huge amount of the blank-page and formatting overhead.</li><li><strong>Consistency checking across dozens of documents.</strong> Making sure cross-references stayed accurate across a growing set of interlinked documents is tedious, mechanical work that AI is genuinely well-suited to.</li></ul><p>What it didn’t do: decide what “good” means for our organization, decide which number to report when the honest one is embarrassing, or decide who signs off on a Go/No-Go. Those are still — and I think should always be — human calls.</p><h3>What I’d tell someone starting this today</h3><ul><li>Get your baseline honest before you get it pretty.</li><li>Build your Target Operating Model as something scoreable, not something readable-only.</li><li>Never invent a KPI that doesn’t trace back to a specific piece of your operating model.</li><li>Treat low confidence as useful information, not a failure to hide.</li><li>Use AI as a fast, tireless first-pass collaborator — for drafting, structuring, and stress-testing — and keep the judgment calls with people.</li></ul><p>Part 2 will cover what happened once these frameworks met real projects running real sprints: the Go/No-Go decisions, the instrumentation gaps that showed up, and what changed once actual dashboards replaced the estimates. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6fb1aaf275e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Flask and Docker]]></title>
            <link>https://indranilmajumder.medium.com/getting-started-with-flask-and-docker-14f9e6e625b8?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/14f9e6e625b8</guid>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[getting-started]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Sat, 27 Apr 2024 11:33:36 GMT</pubDate>
            <atom:updated>2024-04-27T11:33:36.237Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pkO_Rx2UAL9D6ire.png" /><figcaption>Flask</figcaption></figure><p>If you are new to python and trying to build a webapp using python - keep reading</p><p>Most modern IDEs have python &amp; flask support like :-</p><ol><li><a href="https://learn.microsoft.com/en-us/visualstudio/ide/quickstart-python">Visual Studio</a></li></ol><p>2. <a href="https://blog.jetbrains.com/pycharm/2022/08/flask-tutorial/">Jet brains PyCharm professional</a></p><p>3. <a href="https://code.visualstudio.com/docs/python/tutorial-flask">Visual Studio Code</a></p><p>I am using VS Code for this setup. Get Latest VS code from <a href="https://code.visualstudio.com/Download">here</a> if you already don’t have one.</p><p>Get latest python 3.x from <a href="https://www.python.org/downloads/">here</a>. Optionally can use <a href="https://github.com/pyenv/pyenv">pyenv</a> if you want to use multiple python versions locally.</p><p>Install few VS Code extensions like:-</p><ol><li><a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Python</a> — Helps you configure python virtual env via VENV or CONDA</li><li><a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker">Docker</a> — Optional if you want to learn how to package the Python Flask webapp into a docker container</li></ol><p>Make sure python|pip is available from command line</p><h3>Create a project env for Flask</h3><ol><li>Create a folder for your project — <em>FlaskSample</em></li><li>Open VS code inside a folder where you want to store the project</li></ol><pre>D:\git\FlaskSample&gt; code .</pre><p>2. Open VS code command palette (<em>Ctrl+Shift+P</em>) then select <em>Python: Create Environment </em>and go though the steps to create a venv environment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2jcr9ciO-VaA7BSO.png" /><figcaption>VS Code Command Palette</figcaption></figure><p>3. Open a terminal (if you have git bash installed you can make it default terminal for VS Code by selecting it from Command Palette <em>Terminal: Select Default Profile</em>) and install flask</p><pre>python -m pip install flask</pre><p>4. Automatically the new terminal will activate the new python virtual env created before in #2 but in case you open a new terminal you can activate the virtual env by running —</p><pre>source .venv/bin/activate</pre><h3>Create and run a flask app</h3><ol><li>When you created the venv environment above in your project folder you should see the .venv folder like this getting created</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*J2c6nTJe9SwSedF2MBCscw.png" /></figure><p>2. From the below image we first get started with creating a folder named <em>app </em>inside the project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*AQTNFBmnxOWeWYs6AGQxJg.png" /></figure><p>3. Inside the app we add 3 python files <em>__inti__.py</em>, <em>views.py</em> and <em>webpage.py, </em>we also keep two folder for html <em>templates</em> and CSS/JSON <em>static</em> files.</p><p>The <em>__inti__.py </em>is to initialize the main app and and also can have other global initializations like I have initialized <em>logging</em>.</p><p>The <em>views.py </em>mainly handles the routing logic</p><p>The <em>webpage.py </em>serves as the web app entry point</p><p>The <em>index.html i</em>n templates folder uses flask<em> render_templates </em>to do some server side scripting</p><p><em>url_for </em>dynamically generated the final static URL for the CSS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hmfe52IiqQHM2r8lqGCUhA.png" /><figcaption>Python files</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5OrmZGlT_VPVR2VcFUOnw.png" /><figcaption>html css json files</figcaption></figure><p>4. From the project root folder try running the app now</p><pre># FLASK expects the default file app.py under the project root folder<br># from where the flask run command is executed. Since our python files are<br># in different location and also has different name hence the below export<br># statememt to tell flask where to look for the entry code<br>export FLASK_APP=app.webapp<br>(.venv)D:/git/FlaskSample:python -m flask run<br>* Environment: production<br>   WARNING: Do not use the development server in a production environment.<br>   Use a production WSGI server instead.<br> * Debug mode: off<br> * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)</pre><p>5. Open <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a>hello/Indra in your browser and check if it works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*uaxmZpbGOLcEZiejhm4DtQ.png" /><figcaption>Browser output</figcaption></figure><p>6. You can add a Debugger by creating the <em>launch.json</em> and selecting <em>Python: Flask</em> from the configuration. You can add breakpoints, watch and inspect variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*eGUyp1ITXQKpqaVV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/0*u1ijzBDJbydMDlNZ.png" /><figcaption>debugger</figcaption></figure><p>7. Add a python <em>requirements.txt</em> file to capture external library dependencies. Useful when dockerising this code.</p><pre>pip freeze &gt; requirements.txt</pre><p>8. Create a <em>Dockerfile </em>using Docker Extension Command (<em>Ctrl+Shift+P</em>) <em>Docker: Add Docker Files to Workspace. </em>More details <a href="https://code.visualstudio.com/docs/containers/quickstart-python">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/0*q2J2x3_9NV89BLWP.png" /><figcaption>Add Docker file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6rqu6gF5ra_TBs5S2tRNQw.png" /><figcaption>Dockerfile</figcaption></figure><p>9. Build and run the app from docker</p><pre>docker image build -t FlaskSample:latest .<br>docker run -it -p 5002:5002 -e &quot;FLASK_APP=app.webapp&quot; FlaskSample:latest</pre><p>10. Again test from browser if <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a>hello/Indra is working.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14f9e6e625b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Drools rules from the database using a template DRL file in a spring boot app]]></title>
            <link>https://indranilmajumder.medium.com/load-drools-rules-from-the-database-using-a-template-drl-file-in-a-spring-boot-app-3b651f90cc53?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b651f90cc53</guid>
            <category><![CDATA[drools]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Tue, 23 May 2023 11:59:15 GMT</pubDate>
            <atom:updated>2023-05-23T11:59:15.778Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently for an application, we were required to use a rule engine in a Spring Boot app. The rules need to be dynamically maintained via a UI. Figuring it out was not straightforward, hence putting some code snippets here in case it helps someone else.</p><p>First, create a Spring Boot 3 application with the following dependencies:-</p><pre>&lt;dependency&gt;<br>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>   &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>   &lt;groupId&gt;org.drools&lt;/groupId&gt;<br>   &lt;artifactId&gt;drools-core&lt;/artifactId&gt;<br>   &lt;version&gt;${drools.version}&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>   &lt;groupId&gt;org.drools&lt;/groupId&gt;<br>   &lt;artifactId&gt;drools-compiler&lt;/artifactId&gt;<br>   &lt;version&gt;${drools.version}&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>   &lt;groupId&gt;org.drools&lt;/groupId&gt;<br>   &lt;artifactId&gt;drools-decisiontables&lt;/artifactId&gt;<br>   &lt;version&gt;${drools.version}&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>   &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>   &lt;groupId&gt;org.postgresql&lt;/groupId&gt;<br>   &lt;artifactId&gt;postgresql&lt;/artifactId&gt;<br>   &lt;scope&gt;runtime&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><p>I am using Postgres as the DB, Java 17, and Drools 7.59.0.Final.</p><p>Next, add a DRL template file in your src/main/resources folder</p><pre>template header<br>id<br>ifcondition<br>thencondition<br><br>template &quot;tmp1&quot;<br><br>rule &quot;@{id}&quot;<br>  dialect &quot;mvel&quot;<br>  when<br>    @{ifcondition};<br>  then<br>    @{thencondition};<br>end<br><br>end template</pre><p>The database table storing rules looks like this:- (Rule.java)</p><pre>package com.springproject.droolEngineProject.model;<br><br>//import javax.persistence.*;<br>import jakarta.persistence.*;<br>import lombok.Getter;<br>import lombok.Setter;<br><br>@Entity<br>@Table(name = &quot;rule_table&quot;)<br>@Getter<br>@Setter<br>public class Rule {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.AUTO)<br>    private Integer id;<br>    @Column(name = &quot;ifcondition&quot;)<br>    private String ifcondition;<br>    @Column(name = &quot;thencondition&quot;)<br>    private String thencondition;<br>    @Column(name = &quot;version&quot;)<br>    private int version;<br><br>    // getters and setters...<br>}</pre><p>Spring boot configuration looks like this:-</p><pre>spring.datasource.url=jdbc:postgresql://localhost:5432/testdb<br>spring.datasource.username=postgres<br>spring.datasource.password=postgres<br>spring.jpa.hibernate.ddl-auto=update<br>spring.jpa.show-sql=true<br>spring.jpa.properties.hibernate.format_sql=true<br>spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect</pre><p>This configuration will take care of auto-creating the rule and other tables in Postgres.</p><p>Then I added a RestController to CRUD Rules:-</p><pre>@RestController<br>public class RulesController {<br><br>    @Autowired<br>    private DroolRulesRepo rulesRepo;<br><br>    @PostMapping(&quot;/rule&quot;)<br>    public void addRule (@RequestBody Rule rule) {<br>        rulesRepo.save(rule);<br>    }<br><br>    @GetMapping(&quot;/rules&quot;)<br>    public List&lt;Rule&gt; getRules () {<br>        List&lt;Rule&gt; rules = new ArrayList&lt;Rule&gt;();<br>        rulesRepo.findAll().forEach(rules::add);<br>        return rules;<br>    }<br>}</pre><p>The Rule engine is to determine discounts for Orders, so here is the OrderService executing all the rules to find the discount:-</p><pre>public Order getDiscountForOrderV2(Order order) throws FileNotFoundException{<br>        List&lt;Rule&gt; ruleAttributes = new ArrayList&lt;&gt;();<br>        rulesRepo.findAll().forEach(ruleAttributes::add);<br><br>        ObjectDataCompiler compiler = new ObjectDataCompiler();<br>        String generatedDRL = compiler.compile(ruleAttributes, Thread.currentThread().getContextClassLoader().getResourceAsStream(DroolConfig.RULES_TEMPLATE_FILE));<br>        KieServices kieServices = KieServices.Factory.get();<br><br>        KieHelper kieHelper = new KieHelper();<br><br>        //multiple such resoures/rules can be added<br>        byte[] b1 = generatedDRL.getBytes();<br>        Resource resource1 = kieServices.getResources().newByteArrayResource(b1);<br>        kieHelper.addResource(resource1, ResourceType.DRL);<br><br>        KieBase kieBase = kieHelper.build();<br><br>        KieSession kieSession = kieBase.newKieSession();<br>        kieSession.insert(order);<br>        int numberOfRulesFired = kieSession.fireAllRules();<br>        kieSession.dispose();<br><br>        return order;<br>    }</pre><p>To add a rule using Postman:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*A5GJmzOb5EH-fHfr6Oj3YQ.png" /></figure><p>Now run an Order to get the discount:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*uoh_JpKXkBXAa0snSnzliw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*1TXJgIspEwcESSyvHFBXPw.png" /></figure><p>The full project can be found <a href="https://github.com/indranil32/spring-drool-project.git">here</a>.</p><p>#drools #springboot #ruleengine</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b651f90cc53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The new QA in town: chatGPT]]></title>
            <link>https://indranilmajumder.medium.com/the-new-qa-in-town-chatgpt-873137bf1293?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/873137bf1293</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[selenium]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Sat, 14 Jan 2023 17:42:59 GMT</pubDate>
            <atom:updated>2023-01-19T11:55:22.885Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZE1KIW2gXi7RjJsrI0huA.jpeg" /><figcaption>chatGPT</figcaption></figure><p>You must be living under a rock if you have not yet heard about <a href="https://openai.com/blog/chatgpt/">chatGPT</a>. Amazing things are being told about it everyday, amazing prompts are being posted on Social Media. And as no good deed goes unpunished, scary things like <a href="https://www.theregister.com/2023/01/11/scientists_chatgpt_papers/">bogus PhD. Thesis</a>, <a href="https://www.theguardian.com/technology/2022/dec/04/ai-bot-chatgpt-stuns-academics-with-essay-writing-skills-and-usability">plagiarism at academics</a> are getting reported too.</p><p>As usual a section of the (tech) influencers have already envisioned the dooms day for all the developers around the world and if we go by them we will be job less soon. Well this threat is not new, many IDEs and code generator plugins, although not using AI, have given us the scare a decade ago.</p><p>Code development for a project or a product is not only about writing code. Modularity, reuse, good architecture and design are few of the many aspects that a developer takes into consideration. Looking at a few chatGPT prompts on social media for auto code or unit test generation I am fairly confident that for those aspects you still need to hire a human developer (although not sure how long).</p><p>Nevertheless to satisfy my itchy curiosity I wanted to try out few things on my own. I wanted to see how chatGPT absorbs context over a few continuous back to back chats on a single prompt. Then if I try to get some tangible result out of it, how good is at that.</p><p>I decided to use an already existing, very popular code base — <a href="https://github.com/spring-projects/spring-petclinic">Spring Pet Clinic Sample Application</a>. Overview for the sample app can be found <a href="https://speakerdeck.com/michaelisvy/spring-petclinic-sample-application">here</a>.</p><p>Lets use gitpod to download, build and deploy the Spring Pet Clinic code on the fly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B6oXuOVni1anj5yzl2Ow0Q.png" /><figcaption>Open gitpod button</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXmZjmiGYt6ygKmtVoS2NA.png" /><figcaption>Gitpod Cloud Workspace</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*zVqHgshAdJKu7B8T-shmaw.png" /><figcaption>Run the Spring application</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqVjI3-jwBc_CDcek2GNlw.png" /><figcaption>Gitpod provided runtime URL to access the Spring application</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aYzprWmwD66eUnDNUYPTNw.png" /><figcaption>Access the Spring Pet Clinic app from local browser</figcaption></figure><p>Now that I have the Spring Pet Clinic up and running in less than 5 minutes lets focus on curating the chatGPT prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHM1PQBbgiU8E_TwtJWkpg.png" /><figcaption>It knows!</figcaption></figure><p>Lets get to the point!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*j8FrNGpQP0EPU2DOvTXb4Q.png" /><figcaption>It suggests general steps for writing Selenium test</figcaption></figure><p>Hey show me the code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*Hsvg_s4JwSrlnbpWLYErQA.png" /><figcaption>Generates Add Owner test and asking for more details</figcaption></figure><p>Now although it said earlier that it knows about the Spring Petclinic Sample application it is reluctant to do its magic and asks for more details. Nevertheless the Add Owner test case it wrote (below) is fair enough.</p><pre>import org.junit.After;<br>import org.junit.Before;<br>import org.junit.Test;<br>import org.openqa.selenium.By;<br>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.chrome.ChromeDriver;<br><br>public class PetClinicTest {<br>  private WebDriver driver;<br><br>  @Before<br>  public void setUp() {<br>    // setup the chrome driver<br>    System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;path/to/chromedriver&quot;);<br>    driver = new ChromeDriver();<br>  }<br><br>  @Test<br>  public void testAddNewOwner() {<br>    // navigate to the add new owner page<br>    driver.get(&quot;http://localhost:8080/owners/new&quot;);<br><br>    // fill in the form<br>    driver.findElement(By.id(&quot;firstName&quot;)).sendKeys(&quot;John&quot;);<br>    driver.findElement(By.id(&quot;lastName&quot;)).sendKeys(&quot;Doe&quot;);<br>    driver.findElement(By.id(&quot;address&quot;)).sendKeys(&quot;123 Main St&quot;);<br>    driver.findElement(By.id(&quot;city&quot;)).sendKeys(&quot;Anytown&quot;);<br>    driver.findElement(By.id(&quot;telephone&quot;)).sendKeys(&quot;123-456-7890&quot;);<br><br>    // submit the form<br>    driver.findElement(By.cssSelector(&quot;button[type=&#39;submit&#39;]&quot;)).click();<br><br>    // assert that the owner was added successfully<br>    assertTrue(driver.getPageSource().contains(&quot;Owner added successfully&quot;));<br>  }<br><br>  @After<br>  public void tearDown() {<br>    driver.quit();<br>  }<br>}</pre><p>Lets give some more context and to the point test cases.</p><pre>Generate Selenium code for testing the following test cases on Spring Petclinic sample application<br><br>1. Test Home page. Open the Spring Petclinic sample application at https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/.<br>2. Test available menu links on Home page. Validate on the home page following menus are available - Home, Find Owners, Veterinarians, Error.<br>3. Test Find Owners. From Home Page click on Find Owners menu link. Validate Last Name input box, Find Owner button and Add Owner button is available.<br>4. Test Add Owner 1. In the Find Owners page, click on Add Owner button. It should open a page with input for First Name, Last Name, Address, City, Telephone. It should also have the Add Owner button.<br>5. Test Add Owner 2. On the Add Owner page, fill up First Name as Indranil, Last Name as Majumder, Address as India, Telephone as 9999999999. Click on Add Owner button. Validate that on adding the owner the Owner Information is displayed on a table. Also Edit Owner and Add New Pet button is displayed.<br>6. Test Veterinarians list. From Home Page click Veterinarians menu link. Validate a table of Veterinarians are displayed.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*ZGCyLK8_1zPLkWxyUzVj7w.png" /><figcaption>Bingo!</figcaption></figure><p>It starts of generating the code…</p><pre>import org.junit.After;<br>import org.junit.Before;<br>import org.junit.Test;<br>import org.openqa.selenium.By;<br>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.chrome.ChromeDriver;<br>import static org.junit.Assert.assertTrue;<br><br>public class PetClinicTest {<br>  private WebDriver driver;<br><br>  @Before<br>  public void setUp() {<br>    // setup the chrome driver<br>    System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;path/to/chromedriver&quot;);<br>    driver = new ChromeDriver();<br>  }<br><br>  @Test<br>  public void testHomePage() {<br>    // navigate to the home page<br>    driver.get(&quot;https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/&quot;);<br><br>    // assert that the page title is correct<br>    assertTrue(driver.getTitle().equals(&quot;PetClinic :: a Spring Framework demonstration&quot;));<br>  }<br><br>  @Test<br>  public void testMenuLinks() {<br>    // navigate to the home page<br>    driver.get(&quot;https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/&quot;);<br><br>    // assert that the Home, Find Owners, Veterinarians, and Error links are available<br>    assertTrue(driver.findElement(By.linkText(&quot;Home&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.linkText(&quot;Find Owners&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.linkText(&quot;Veterinarians&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.linkText(&quot;Error&quot;)).isDisplayed());<br>  }<br><br>  @Test<br>  public void testFindOwners() {<br>    // navigate to the home page<br>    driver.get(&quot;https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/&quot;);<br><br>    // click on the Find Owners link<br>    driver.findElement(By.linkText(&quot;Find Owners&quot;)).click();<br><br>    // assert that the Last Name input box, Find Owner button, and Add Owner button are available<br>    assertTrue(driver.findElement(By.id(&quot;lastName&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.cssSelector(&quot;button[type=&#39;submit&#39;]&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.linkText(&quot;Add Owner&quot;)).isDisplayed());<br>  }<br><br>  @Test<br>  public void testAddOwner1() {<br>    // navigate to the find owners page<br>    driver.get(&quot;https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/owners/find&quot;);<br><br>    // click on the Add Owner button<br>    driver.findElement(By.linkText(&quot;Add Owner&quot;)).click();<br><br>    // assert that the First Name, Last Name, Address, City, Telephone input boxes and Add Owner button are available<br>    assertTrue(driver.findElement(By.id(&quot;firstName&quot;)).isDisplayed());</pre><p>Notice the code is incomplete, it seems that the OpenAI servers is having too many network timeouts for overuse. Hence it is better to submit the test cases one by one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*suIS4bYILcrgfE8No4woIg.png" /><figcaption>Add Owner</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*i84V9W7xJhgucKAyKoaxQA.png" /><figcaption>Good note with the assumptions from chatGPT</figcaption></figure><p>Full code….</p><pre>import org.junit.After;<br>import org.junit.Before;<br>import org.junit.Test;<br>import org.openqa.selenium.By;<br>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.chrome.ChromeDriver;<br>import static org.junit.Assert.assertTrue;<br><br>public class PetClinicTest {<br>  private WebDriver driver;<br><br>  @Before<br>  public void setUp() {<br>    // setup the chrome driver<br>    System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;path/to/chromedriver&quot;);<br>    driver = new ChromeDriver();<br>  }<br><br>  @Test<br>  public void testHomePage() {<br>    // navigate to the home page<br>    driver.get(&quot;https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/&quot;);<br><br>    // assert that the page title is correct<br>    assertTrue(driver.getTitle().equals(&quot;PetClinic :: a Spring Framework demonstration&quot;));<br>  }<br><br>  @Test<br>  public void testAddOwner1() {<br>    // navigate to the find owners page<br>    driver.get(&quot;https://8080-springproje-springpetcl-n727riuuaja.ws-us82.gitpod.io/owners/find&quot;);<br><br>    // click on the Add Owner button<br>    driver.findElement(By.linkText(&quot;Add Owner&quot;)).click();<br><br>    // assert that the First Name, Last Name, Address, City, Telephone input boxes and Add Owner button are available<br>    assertTrue(driver.findElement(By.id(&quot;firstName&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.id(&quot;lastName&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.id(&quot;address&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.id(&quot;city&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.id(&quot;telephone&quot;)).isDisplayed());<br>    assertTrue(driver.findElement(By.cssSelector(&quot;button[type=&#39;submit&#39;]&quot;)).isDisplayed());<br>  }<br><br>  @After<br>  public void tearDown() {<br>    driver.quit();<br>  }<br>}</pre><p>Lets run the auto generated code to test its authenticity…</p><p>Head over to <a href="https://www.browserstack.com/docs/automate/selenium/getting-started/java">Browserstack</a> and follow all the instructions there to test the code.</p><p><a href="https://github.com/indranil32/testng-browserstack/blob/local-master/src/test/java/com/browserstack/ChatGPTTest.java">testng-browserstack/ChatGPTTest.java at local-master · indranil32/testng-browserstack</a></p><p><em>Note: Considerable amount of work is required in terms of configuration, dependency management and tweaking the code to make the code run. But it eventually runs.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSMIWpUIugVw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSMIWpUIugVw&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a193a82bca76edf3be788ab2027438a4/href">https://medium.com/media/a193a82bca76edf3be788ab2027438a4/href</a></iframe><p>Definitely there is a lot of scope for improvement in terms of how we chat with chatGPT to provide better context setting, be more specific about what we want it to help us with. Like this <a href="https://www.linkedin.com/posts/generative-artificial-intelligence_chatgpt-activity-7020010121044840448-PqGF?utm_source=share&amp;utm_medium=member_desktop">post</a>. Follow the posts <a href="https://www.linkedin.com/company/generative-artificial-intelligence/">there</a> to know more.</p><p>But one thing is clear, its indeed revolutionary and the fact that this can be achieved while chatting in natural spoken language and not some abstruse coding jargon is a big departure from previous similar efforts.</p><p><em>Note: Remember we already have frameworks like </em><a href="https://cucumber.io/docs/guides/overview/"><em>Cucumber</em></a><em> which executes specifications written in plain text.</em></p><p>For sure the future version of this is going to give all Developers and QAs, worth their salt, a good run for their money.</p><p>All hail #chatGPT. All hail #openAI.</p><p><em>Few things I observed :-</em></p><ol><li><em>Right now it is very chatty.</em></li><li><em>It doesn’t like very open ended queries.</em></li><li><em>It asks for specific details, which is a good thing.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=873137bf1293" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provision a static website on AWS S3 and Cloudfront using terraform]]></title>
            <link>https://towardsaws.com/provision-a-static-website-on-aws-s3-and-cloudfront-using-terraform-d8004a8f629a?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8004a8f629a</guid>
            <category><![CDATA[jenkins-pipeline]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Thu, 01 Jul 2021 14:55:11 GMT</pubDate>
            <atom:updated>2021-07-01T16:09:44.380Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous <a href="https://towardsaws.com/making-oauth2-work-on-cdn-ea57de227ddf">article</a>, I demonstrated how we can use AWS S3 and Cloudfront to host a static website with OAUTH2 login.</p><p>This article is a step forward to automate the AWS provisioning using Terraform and Jenkins pipeline.</p><p>Below is a working example of a Terraform script:-</p><ol><li>Creates an S3 bucket, if not present</li><li>Sets the S3 bucket’s ACL, policy, and static website hosting configurations</li><li>Uploads various type of files like html/image/js/css/json etc. to the S3 bucket</li><li>Creates a Cloudfront distribution with origin set to the above-created bucket</li><li>Sets up various Cloudfront configurations like cache/restrictions etc.</li><li>Updates the S3 bucket policy to have access via the above created Cloudfront distribution</li><li>Prints the Cloudfront domain name to be used to access the static website</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b95ac29fa3cef58eec033fa28128f066/href">https://medium.com/media/b95ac29fa3cef58eec033fa28128f066/href</a></iframe><p>Further to allow automated provisioning we can add the terraform script to an existing web project and use an existing Jenkins pipeline with the below stage and steps.</p><p>If testing the website has been automated it can be added after the “AWS-Terraform” stage, and once the testing is done, add a terraform destroy stage to clean up the AWS footprint.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3860c7d2df9a742ff862dc9be31b210e/href">https://medium.com/media/3860c7d2df9a742ff862dc9be31b210e/href</a></iframe><p>Let&#39;s catch up next time to see an automated ECS anywhere provisioning using docker hub private/public images.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8004a8f629a" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/provision-a-static-website-on-aws-s3-and-cloudfront-using-terraform-d8004a8f629a">Provision a static website on AWS S3 and Cloudfront using terraform</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with hyperledger-fabric]]></title>
            <link>https://indranilmajumder.medium.com/getting-started-with-hyperledger-fabric-1cd99045c77d?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cd99045c77d</guid>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[hyperledger-explorer]]></category>
            <category><![CDATA[enterprise-blockchain]]></category>
            <category><![CDATA[hyperledger-fabric]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Thu, 24 Jun 2021 11:35:58 GMT</pubDate>
            <atom:updated>2021-06-24T11:35:58.069Z</atom:updated>
            <content:encoded><![CDATA[<p>My current domain, Supply Chain &amp; Container Logistics, is buzzing with various Blockchain use cases, pilots, and even production-grade deployments.</p><p>Enterprise Blockchain (not cryptocurrency) I believe has finally bloomed out of its academic thesis/research papers cocoon to its crucial commercial acceptance form. Every now and then we are coming across new articles, blogs, whitepapers on how Enterprise blockchain is adding value to use cases in finance, supply chain, and other domains.</p><p>With that in mind and a spoiling amount of choices, I figured hyperledger-fabric to the best bet for beginners. Few points in its favors:-</p><ol><li>Completely dockerized. Runs seamlessly in Windows Docker Desktop</li><li><a href="https://github.com/hyperledger/fabric-samples"><em>fabric-samples</em></a> is so easy to use and understand</li><li>Bringing up the <a href="https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html"><em>test-network</em></a> is child’s play</li><li>Using the existing SmartContracts and Applications is straightforward</li><li><strong>The abundance of language support. That is something else.</strong></li></ol><h3>Steps</h3><p>To get the latest and greatest run this on Git bash (<a href="https://hyperledger-fabric.readthedocs.io/en/release-2.2/prereqs.html">prereqs</a>)</p><blockquote>curl -sSL <a href="https://bit.ly/2ysbOFE">https://bit.ly/2ysbOFE</a> | bash -s</blockquote><p>This will download latest -</p><ol><li><a href="https://github.com/hyperledger/fabric-samples">fabric-samples</a> code base</li><li><a href="https://hyperledger.jfrog.io/artifactory/fabric-binaries/hyperledger-fabric-windows-amd64-2.2-stable.tar.gz">fabric binaries</a></li><li><a href="https://hub.docker.com/r/hyperledger">fabric docker images</a> — <a href="https://hub.docker.com/r/hyperledger/fabric-peer">peer</a>, <a href="https://hub.docker.com/r/hyperledger/fabric-ca">ca</a>, <a href="https://hub.docker.com/r/hyperledger/fabric-tools">tools</a>, <a href="https://hub.docker.com/r/hyperledger/fabric-orderer">orderer</a></li></ol><p>Change directory to fabric-samples/test-network folder</p><p>Use this profiles script for CLI -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02bfe1dfa0f816c33c7df16e763bd099/href">https://medium.com/media/02bfe1dfa0f816c33c7df16e763bd099/href</a></iframe><blockquote>source local.profiles.env 1</blockquote><p>Bring up the network by-</p><blockquote>./network.sh up -ca</blockquote><p>Create the default channel (mychannel)-</p><blockquote>./network.sh creteChannel</blockquote><p>Deploy a sample chaincode(Smart Contract)</p><blockquote>./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript</blockquote><p>Run the corresponding application</p><blockquote>cd ../asset-transfer-basic/application-javascript</blockquote><blockquote>npm install</blockquote><blockquote>node app.js</blockquote><p>For bringing down the test network-</p><blockquote>./network.sh down</blockquote><p>Use the below script for deep cleanup-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7265b23c8ea8e3b1a7a42cfe0ca6a8f/href">https://medium.com/media/f7265b23c8ea8e3b1a7a42cfe0ca6a8f/href</a></iframe><blockquote>./fullCleanupPostTestNetworkDown.sh</blockquote><h3>What just happened ?</h3><p>The above commands installed required binaries, docker images, scripts to get started with Hyperledger-fabric Blockchain. Then the “network.sh” script allowed us to create conveniently a couple of organizations, their cryto(ca) materials and initiated the docker images for running a test blockchain network (all under the hoods). Further using the same script a channel (DLT) between two organizations and a sample chaincode(Smart Contract) to transfer a digital asset from one owner to another was successfully installed and demoed.</p><p>In this test-network you can go ahead and even add another organization — <a href="https://github.com/hyperledger/fabric-samples/tree/main/test-network/addOrg3#adding-org3-to-the-test-network"><strong>Org3MSP </strong></a>using the scripts under <em>addOrg3 </em>folder in f<em>abric-samples/test-network/addOrg3</em></p><h3>Blockchain Explorer</h3><p>To have a more viusal confirmation on what just happened <a href="https://github.com/hyperledger/blockchain-explorer">explorer</a> is a great simple easy to use tool.</p><p>Create a explorer folder parallel to fabric-samples folder.</p><p>Download the files as mentioned in this <a href="https://github.com/hyperledger/blockchain-explorer/tree/v1.1.6#configure">configuration </a>step-</p><pre>$ wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/examples/net1/config.json<br>$ wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/examples/net1/connection-profile/test-network.json -P connection-profile<br>$ wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/docker-compose.yaml</pre><p>Edit network name in docker-compose.yaml from <strong><em>net_test </em></strong>to <strong><em>fabric_test </em></strong>to match the fabric test network.</p><p>Edit the name of admin certificate and secret key in <em>test-network.json</em> to match the one under -</p><blockquote>../fabric-samples/test-network/peerOrganizations/org1.example.com/users/ Admin@org1.example.com/msp/keystore/<strong>*_sk</strong></blockquote><blockquote>../fabric-samples/test-network/peerOrganizations/org1.example.com/users/ Admin@org1.example.com/msp/cacerts/<strong>*cert.pem</strong></blockquote><p>Bring up the docker containers for explorer-</p><blockquote>docker-compose -f docker-compose.yaml up -d</blockquote><p>To check logs ( if required)</p><blockquote>docker-compose -f docker-compose.yaml logs</blockquote><p>To login to the docker container ( if required)</p><blockquote>winpty docker exec -it explorer.mynetwork.com //bin//sh #for windows</blockquote><p>Once explorer is up go to — <a href="http://localhost:8080/#/">http://localhost:8080/#/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*K6DaVIIalOszC3S94nK_3Q.png" /><figcaption>Default username/password — exploreradmin/exploreradminpw</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Omk9k9ummdArbP4u4EfEdg.png" /><figcaption>Overview of the fabric-samples’ test network setp</figcaption></figure><p>Lets connect back latter where we do more complex and customized things on hyperledger fabric.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cd99045c77d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Oauth2 work on CDN]]></title>
            <link>https://towardsaws.com/making-oauth2-work-on-cdn-ea57de227ddf?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea57de227ddf</guid>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[auth0]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 09:57:27 GMT</pubDate>
            <atom:updated>2021-06-14T13:05:01.472Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently came across a requirement to host a website, written in vue.js and using Oauth2 login on the cloud(AWS).</p><p>The website is lightweight and decoupled from the backend. Hence I didn’t want to use a web server (like Nginx or Apache httpd).</p><p>I did a quick Poof of Concept to make sure before I propose the solution, everything works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*ugq0Dhy2cX1AvASu26GoFg.png" /></figure><p>For Oauth2 I used Auth0 — <a href="https://auth0.com/">https://auth0.com/</a> as it provides a free account and is very easy to set up.</p><p>The Dashboard and the default app setup are intuitive.</p><p>Plus its quickstarts are extremely useful for proof of concepts — <a href="https://auth0.com/docs/quickstart/spa/vanillajs">https://auth0.com/docs/quickstart/spa/vanillajs</a>.</p><p>Downloaded this vanilla js single page app so that I can upload it to AWS S3</p><p>For AWS create a free tier account — <a href="https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?refid=em_127222">https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?refid=em_127222</a></p><h3><a href="https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html">Create an Amazon S3 bucket</a> with the following settings:</h3><ol><li>Sign in to the AWS Management Console and open the Amazon S3 console.</li><li>Choose Create bucket to start the Create bucket wizard.</li><li>In Bucket name, enter a DNS-compliant name for your bucket. You will use this in a later step to replace the YOURS3BUCKETNAME variable.</li><li>In Region, choose the AWS Region where you want the bucket to reside. <strong>Note</strong>: It’s recommended to create the Amazon S3 bucket in the same AWS Region as Amazon Cognito.</li><li>Look up the region code from the region table (for example, US-East [N. Virginia] has a region code of us-east-1). You will use the region code to replace the variable YOUR_REGION in a later step.</li><li>Choose Next.</li><li>Select the Versioning checkbox.</li><li>Choose Next.</li><li>Choose Next.</li><li>Choose Create bucket.</li><li>Select the bucket you just created from the Amazon S3 bucket list.</li><li>Select the Properties tab.</li><li>Choose Static website hosting.</li><li>Choose to Use this bucket to host a website.</li><li>For the index document, enter index.html and then choose Save.</li></ol><h3><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-working-with.html">Create a CloudFront distribution</a> (web distribution) with the following modified default settings:</h3><ol><li>Sign in to the AWS Management Console and open the <a href="https://console.aws.amazon.com/cloudfront/">CloudFront console</a>.</li><li>Choose to Create Distribution.</li><li>On the first page of the Create Distribution Wizard, in the Web section, choose to Get Started.</li><li>Choose the Origin Domain Name from the dropdown list. It will be <em>YOURS3BUCKETNAME</em>.s3.amazonaws.com.</li><li>For Restrict Bucket Access, select Yes.</li><li>For Origin Access Identity, select Create a New Identity.</li><li>For Grant Read Permission on Bucket, select Yes, Update Bucket Policy.</li><li>For the Viewer Protocol Policy, select Redirect HTTP to HTTPS.</li><li>For Cache Policy, select Managed-Caching Disabled.</li><li>Set the Default Root Object to index.html.(Optional) Add a comment. Comments are a good place to describe the purpose of your distribution, for example, “Amazon Cognito SPA.”</li><li>Select Create Distribution. The distribution will take a few minutes to create and update.</li><li>Copy the Domain Name. This is the CloudFront distribution domain name, which you will use in a later step as the <em>DOMAINNAME</em> value in the <em>YOUR_REDIRECT_URI</em> variable.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yV2797p7puy_jwm8XcSAiQ.png" /></figure><p>More details on the above AWS steps here — <a href="https://aws.amazon.com/blogs/security/how-to-add-authentication-single-page-web-application-with-amazon-cognito-oauth2-implementation/">https://aws.amazon.com/blogs/security/how-to-add-authentication-single-page-web-application-with-amazon-cognito-oauth2-implementation/</a></p><h3><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-working-with.html">Configure callback URL</a> with Auth0 app settings:</h3><p>Once the AWS setup is complete and running follow these steps in Auth0’s default app:</p><ol><li>Set the Allowed Callback URLs in the <a href="https://manage.auth0.com/#/applications/v4JdLBmFZ4oEUWLmiryZlm4GT7qYWTFe/settings">Application Settings</a> to</li></ol><pre><a href="https://d2nxhk5uf3rumj.cloudfront.net/">https://d2nxhk5uf3rumj.cloudfront.net/</a> ==&gt; from AWS Cloudfront</pre><p>2. Set Allowed Web Origins in the <a href="https://manage.auth0.com/#/applications/v4JdLBmFZ4oEUWLmiryZlm4GT7qYWTFe/settings">Application Settings</a> to</p><pre><a href="https://d2nxhk5uf3rumj.cloudfront.net/">https://d2nxhk5uf3rumj.cloudfront.net/</a> ==&gt; from AWS Cloudfront</pre><p>3. Set Allowed Logout URLs in the <a href="https://manage.auth0.com/#/applications/v4JdLBmFZ4oEUWLmiryZlm4GT7qYWTFe/settings">Application Settings</a> to</p><pre><a href="https://d2nxhk5uf3rumj.cloudfront.net/">https://d2nxhk5uf3rumj.cloudfront.net/</a> ==&gt; from AWS Cloudfront</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44jLq48iThXbll04lF0Exw.png" /></figure><h3><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-working-with.html">Upload web files to AWS S3 bucket</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXSXbT7qM9VOXoyNnbB9vQ.png" /></figure><p>Now you can access the static website — e.g — <a href="https://d2nxhk5uf3rumj.cloudfront.net/">https://d2nxhk5uf3rumj.cloudfront.net/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIqRjRkIllK7G_JXuM2zoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*kNzylYyNRE1XD0xAGahwBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmMvj1Z6n9zLqjf5EwT9gA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea57de227ddf" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/making-oauth2-work-on-cdn-ea57de227ddf">Making Oauth2 work on CDN</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hand pose detection using Tensorflow Js & React Native]]></title>
            <link>https://indranilmajumder.medium.com/hand-pose-detection-using-tensorflow-js-react-native-82e14fd3eaf9?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/82e14fd3eaf9</guid>
            <category><![CDATA[hand-pose]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[tensorflowjs]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[tensorflow-model]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Wed, 07 Apr 2021 17:47:22 GMT</pubDate>
            <atom:updated>2021-04-07T18:10:43.839Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtnbUcpD1fqc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtnbUcpD1fqc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtnbUcpD1fqc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3fc850f17fed2e2bc116abb6a5e29d0/href">https://medium.com/media/d3fc850f17fed2e2bc116abb6a5e29d0/href</a></iframe><p>Hand Pose detection like thumbs up (👍) or thumbs down (👎) can be very crucial in man machine interfacing and (semi) automation.</p><p>For example in hazardous areas or areas with a lot of network connectivity interferences a remote/drone camera with hand pose detection integrated with backend operational software can help in better coordination of work, thereby enhancing safety at work place.</p><p>With <a href="https://github.com/tensorflow/tfjs-models/tree/master/handpose"><em>Tensorflow’s handpose model</em></a> we can actually do this!</p><p>Initially I started developing with expo snack as below :-</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsnack.expo.io%2Fembedded%2F%40indranil32%2Ftensorflow-js-handpose&amp;display_name=Expo+Snack&amp;url=https%3A%2F%2Fsnack.expo.io%2F%40indranil32%2Ftensorflow-js-handpose&amp;image=https%3A%2F%2Fs3.amazonaws.com%2Fexp-brand-assets%2FSnackIcon_200.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=expo" width="700" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/d06d5d658295980125ee3320ef763b17/href">https://medium.com/media/d06d5d658295980125ee3320ef763b17/href</a></iframe><p>But making the tensorflow backend rn-webgl work in expo snack was running into various errors. So had to switch to cpu backend. Still it was slow and unreliable.</p><p>Therefore I started with fresh new react-native project :-</p><p>Step 1 &gt; Initialize via React Native CLI Quickstart</p><blockquote>npx react-native init tensorflowjshandpose --npm</blockquote><p>Step 2 &gt; In the new project add required dependencies :-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa6059f2c64ac611fa0b7601cddfc2a7/href">https://medium.com/media/aa6059f2c64ac611fa0b7601cddfc2a7/href</a></iframe><p>Step 2a &gt; Pay attention &amp; follow the installation of react-native-unimodules</p><p><a href="https://docs.expo.io/bare/installing-unimodules/">Installing react-native-unimodules - Expo Documentation</a></p><p>Step 2b &gt; Other expo dependencies like expo-camera</p><p><a href="https://www.npmjs.com/package/expo-camera">expo-camera</a></p><p>Step 2c &gt; expo-camerauses expo-gl-cpp which needs Android NDK. So install that too as mentioned below :-</p><p><a href="https://developer.android.com/studio/projects/install-ndk">https://developer.android.com/studio/projects/install-ndk</a></p><p><em>Note : Make sure to update the ndk version in gradle.build to the one installed above</em></p><p>Step 3 &gt; Add the actual pose detection code and test it on Android:-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4cee6df5cf46dbd54bcb4573b07972e/href">https://medium.com/media/f4cee6df5cf46dbd54bcb4573b07972e/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3731b512bf06119acd7c80f7041c4be9/href">https://medium.com/media/3731b512bf06119acd7c80f7041c4be9/href</a></iframe><p>Checkout the code <a href="https://github.com/indranil32/tensorflowjshandpose">here</a> in Github!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82e14fd3eaf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart Containers POC | RIOT + LORA + FIT/IoT-LAB + TTN + TAGO.IO + HYPERLEDGER FABRIC — Part 1]]></title>
            <link>https://indranilmajumder.medium.com/smart-containers-poc-riot-lora-fit-iot-lab-ttn-tago-io-hyperledger-fabric-part-1-146c9a96fc6c?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/146c9a96fc6c</guid>
            <category><![CDATA[container-shipping]]></category>
            <category><![CDATA[smart-container-market]]></category>
            <category><![CDATA[ttn]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Sat, 23 Jan 2021 20:04:14 GMT</pubDate>
            <atom:updated>2021-01-23T20:04:14.520Z</atom:updated>
            <content:encoded><![CDATA[<h3>Smart Containers POC | RIOT + LORA + FIT/IoT-LAB + TTN + TAGO.IO + HYPERLEDGER FABRIC — Part 1</h3><p>For some time now Smart Containers (physical containers used to ship goods across oceans) is in my range of interest.</p><p><strong>Smart Container</strong> = <em>Dumb container</em> + <em>IoT</em> + <em>Network</em> + <em>Cloud</em> (possibly <em>Blockchain</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*mSBP96sFxwJmVwEcSyTiwg.png" /><figcaption>Smart Container</figcaption></figure><p>So I did some reading ….</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d2ab5b35cee7f3fda7e91942b3603bf/href">https://medium.com/media/0d2ab5b35cee7f3fda7e91942b3603bf/href</a></iframe><p>And this is what I understood (current trend):-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppY2aoOaxdn_KKdydEmhwg.png" /></figure><p>It looks very exciting on paper but I needed more. I needed to satisfy my developer itch by figuring out what all needs to be put together to make this work!</p><p>I have little to no experience in IoT and do not own a single piece of IoT hardware/sensors and am currently trying out my hands on blockchain.</p><p>After reading few articles on IoT integration projects, I set out to explore..</p><p>Enter <a href="https://www.iot-lab.info/testbed">FIT/IoT-Lab</a>, <a href="https://console.thethingsnetwork.org/">TTN </a>&amp; <a href="https://admin.tago.io/">Tago.io</a></p><h3>FIT/IoT-Lab</h3><p>A very large scale IoT test bed. With ample docs and get started tutorials, it didn’t take much time to get my hands dirty on a few well-known boards(arch), OS and sensor data collection.</p><p><a href="https://www.iot-lab.info/docs/getting-started/introduction/">Introduction</a></p><h3>The Things Network</h3><p>In DCSA’s <a href="https://dcsa.org/standards/iot-data">IoT specs</a>, LoRaWAN has been identified as an important RF interface for both at Sea and on Land. The free tier of TTN and its easy integration with FIT/IoT-Lab, makes it very lucrative for beginners to try and build POCs on it.</p><p><a href="https://www.thethingsnetwork.org/docs/">The Things Network</a></p><h3>Tago.io</h3><p>The ultimate IoT data aggregator. Has out of the box device integration with TTN. A range of useful functionalities (data retention/custom data parsing/custom alerts/mobile app etc.) around the collected IoT data and further integration capabilities, along with its free tier, makes its useful for beginners.</p><p><a href="https://docs.tago.io/en/articles/1-getting-started">https://docs.tago.io/en/articles/1-getting-started</a></p><h3>Integration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRye8FV2voO4zLfm436E-g.png" /><figcaption>POC Block View</figcaption></figure><ol><li>Create a free FIT/IoT-Lab account</li><li>Create a free TTN account</li><li>Create a free tago.io account</li><li>Get SSH access to FIT/IoT-Lab — <a href="https://www.iot-lab.info/docs/getting-started/ssh-access/">https://www.iot-lab.info/docs/getting-started/ssh-access/</a></li><li>SSH to saclay site — ssh <a href="/service/mailto:majumder@grenoble.iot-lab.info">&lt;login&gt;@saclay.iot-lab.info</a></li><li>Clone RIOT OS — git clone git://github.com/RIOT-OS/RIOT.git -n 2020.04-branch</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6f5XbDGqSrV07J2Av9ckeQ.png" /><figcaption>FIT/IoT-Lab Testbed UI</figcaption></figure><p>7. Open TTN console and create a New Application</p><p>8. Register a device</p><p>9. Go to Payload formats and add this script for parsing raw sensor data from FIT/IoT-Lab to JSON —</p><pre>function Decoder(bytes, port) {<br>// Decode an uplink message from a buffer (array) of bytes to an //object of fields.<br>var message = &quot;&quot;;<br>for (var i=0; i&lt;bytes.length; i++){<br>  message += String.fromCharCode(bytes[i]);<br>}<br>var decoded = {};<br>var mex = JSON.parse(message);<br>mex.timestamp = new Date().getTime().toString(); // Add message //timestamp<br>decoded.message = mex;<br>return decoded;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*6BZC1EmfTQjOSFAbFAeM3Q.png" /><figcaption>TTN console</figcaption></figure><p>10. Go back to FIT/IoT-Lab SSH console and update <em>Makefile</em> and <em>main.c</em> under <em>/senslab/users/&lt;login&gt;/RIOT/examples/lorawan/ </em>to</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7677a8381ceb026b68442ca377eb9823/href">https://medium.com/media/7677a8381ceb026b68442ca377eb9823/href</a></iframe><p>and</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4cdd5ef2e2d7f62217fc277a208493fa/href">https://medium.com/media/4cdd5ef2e2d7f62217fc277a208493fa/href</a></iframe><p>11. Run <em>make all</em> under <em>/senslab/users/&lt;login&gt;/RIOT/examples/lorawan/</em></p><p>12. This should generate <strong>lorawan.elf</strong> at — <em>/senslab/users/&lt;login&gt;/RIOT/examples/lorawan/bin/b-l072z-lrwan1/lorawan.elf</em></p><p>13. Download the <strong>lorawan.elf</strong> to your local and head over to FIT/IoT-Lab testbed to run a new test with this as the firmware.</p><p>My Resources &gt; Firmwares &gt; New Firmware &gt; Upload <strong>lorawan.elf </strong>(OS-RIOT/Arch — st-lrwan1) &gt; Save</p><p>New Experiment &gt; Nodes &gt; Arch : st-lrwan1 (sx1276) &gt; Site: Saclay &gt; Qty:1 &gt; Add to Experiment &gt; Add firmware &gt; Select <strong>lorawan.elf </strong>&gt; Submit experiment</p><p>14. Go tago.io console — Devices &gt; Add New Device &gt; Select Network: LoRaWAN TTN &gt; Custom The Things Network &gt; Add <strong>Device EUI </strong>from TTN console &gt; Create Device</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoS5weZto54OPLPSGpPYaA.png" /><figcaption>Tago.io console</figcaption></figure><h3>To validate the data flow -</h3><p>On FIT/IoT-Lab ssh console — nc st-lrwan1–&lt;nodeid&gt; 20000</p><blockquote><em>majumder@saclay:~$ nc st-lrwan1–10 20000<br>main(): This is RIOT! (Version: 2020.04)<br>Starting join procedure<br>Join procedure succeeded<br>Sending data: {“temperature”: “23.7”, “humidity”: “31.7”}<br>Sending data: {“temperature”: “23.7”, “humidity”: “31.7”}…</em></blockquote><p>On TTN — Web console &gt; Data &gt; same data as above</p><p>On tago.io — Web console &gt; Devices &gt; your_device &gt; Live Inspector &gt; Play &gt; same data as above</p><p>Play around tago.io to figure out its other interesting features!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rapiba5OjYMUPeB3OqL3MA.png" /><figcaption>Mobile app Notifications</figcaption></figure><p>WIP — Simulate/real GPS changes(ETA/Geofencing), accelerometer/magnetometer changes(drop/damage), lumosity changes(door opening)/temperature/humidity changes(reefer)</p><p><strong>Next part</strong> — Blockchain integration</p><p><em>References —</em></p><ul><li><a href="https://www.hackster.io/lorella-landi/riot-os-application-connected-to-aws-iot-through-ttn-157726">RIOT-OS application connected to AWS IoT through TTN</a></li><li><a href="https://www.iot-lab.info/community/publications/">Publications</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=146c9a96fc6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CICD For Mobile App Development]]></title>
            <link>https://indranilmajumder.medium.com/cicd-for-mobile-app-development-83c983403457?source=rss-55f9cb968b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/83c983403457</guid>
            <category><![CDATA[bitrise]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Indranil Majumder]]></dc:creator>
            <pubDate>Thu, 23 Jan 2020 12:37:38 GMT</pubDate>
            <atom:updated>2020-02-15T09:51:57.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1enmdft-4LYJ4Ow9GhiRg.png" /><figcaption>A super generic block diagram</figcaption></figure><p>This article is fit for teams developing cross platform apps, may be using a common language like React Native/Flutter and wants to integrate their automation tests with appium into the CICD flow.</p><p>This also assumes the interest in having a CICD on cloud with apple hardware.</p><h3>General considerations</h3><p>If there is an existing Jenkins setup running on a Linux or Windows(on-prem/cloud) reuse it to build feature/bugfix/develop branches for React native npm tasks, Android Gradle tasks etc.</p><p>If Jenkins is running on Linux or Windows platform, IOS builds are not feasible. Developer Mac’s local build can work as a supplement. This article will heavily depend on services like <a href="http://bitrise.io/">Bitrise</a> for the end to end CICD setup.</p><p>Reuse existing Nexus to keep local builds for Android APK’s (plug the below stage to your existing Jenkins file and add the maven-publish plugin to your gradle build file) :-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af5bd6520e40a3472b07f264360ef9f6/href">https://medium.com/media/af5bd6520e40a3472b07f264360ef9f6/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9767d2716402d46cedd640f8f0af615e/href">https://medium.com/media/9767d2716402d46cedd640f8f0af615e/href</a></iframe><p>Nexus supports NPM format archiving too -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26863c79fba87836277b586044d6e041/href">https://medium.com/media/26863c79fba87836277b586044d6e041/href</a></iframe><p><strong>Note</strong> : You cannot run Android X86 or IOS emulators on AWS hosted CICD setup. You have to reply on aws-device-farm or sauce-labs</p><p>Bitrise gives you CICD as a service. It can run your CICD on managed apple hardware required for IOS builds.</p><p>It also allows you to run <a href="https://devcenter.bitrise.io/testing/testing-index/">UI tests</a> using Emulators.</p><p><strong>Note</strong> : IOS and Android X86 emulators work on Bitrise.</p><p>For raw hosted apple hardware you can go to <a href="https://www.macstadium.com/">MacStadium</a>.</p><p>You can connect your internal source code repo/nexus/backends to Bitrise via VPN. On start and completion of the build connect and disconnect the VPN correspondingly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e076c914cbafeaf60d9c8038919ef1f/href">https://medium.com/media/5e076c914cbafeaf60d9c8038919ef1f/href</a></iframe><p>More info here — <a href="https://devcenter.bitrise.io/jp/tutorials/vpn-configuration/">https://devcenter.bitrise.io/jp/tutorials/vpn-configuration/</a></p><p>For initial setup, just use a dummy GITHUB project to onboard an app into Bitrise. Once done add the VPN connection step in the workflow and change the app GIT URL/Name from the settings to point to your internal source code.</p><p>The reason for choosing Bitrise is it super easy setup and maintenance. Look at the below workflow setup. Just drag and drop!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*STVP83YsYxdI1S-J83vyPQ.png" /><figcaption>vpn step</figcaption></figure><p>Bitrise also allows to keep local build artifacts.</p><h3>Release management</h3><p>How your code reaches your CICD setup is very important on how effective your CICD can be. So let’s start with code release management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dN-SiS4dbozQwE05" /></figure><ol><li>Make sure all feature/bugfix are merged to develop</li><li>Create PR and merge changes from develop to master</li><li>Create a release branch from master</li><li>Create a tag from the release branch</li><li>Increment build number in master and develop according to <a href="https://semver.org/">SemVer</a></li><li>Beta push from tag build to play console/testflight.</li><li>QA on beta build from play console/testflight</li><li>Manual push to production (Play/App store)</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1da5de880ddcb08b38335d1bdc6e32d4/href">https://medium.com/media/1da5de880ddcb08b38335d1bdc6e32d4/href</a></iframe><p><strong>Note</strong>: Auto incrementing android version code is a challenge. A public repo with only the version code number in a file can be kept which the bitrise workflow needs to clone, read and update whenever a upload to play console/store is required.</p><h3>Fastlane</h3><p>Fastlane is an amazing too with extremely low learning curve. All it asks for is that you have a Apple Mac.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22a702cc551a17e0419c8bda6ab72c3f/href">https://medium.com/media/22a702cc551a17e0419c8bda6ab72c3f/href</a></iframe><p>Using fastlane match &amp; supply for release management should be part of a decent CICD setup</p><p>More details coming soon…</p><h3>Device UI Tests using Appium</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*WciMGn2cPGk7Aatv3Xfy6g.png" /></figure><p>More details coming soon…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83c983403457" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>