<?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 Bruno Pérez on Medium]]></title>
        <description><![CDATA[Stories by Bruno Pérez on Medium]]></description>
        <link>https://medium.com/@bd_perez?source=rss-f5405545500c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zja3DACDRq_DC3IYmkUuRA.png</url>
            <title>Stories by Bruno Pérez on Medium</title>
            <link>https://medium.com/@bd_perez?source=rss-f5405545500c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:32:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bd_perez/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[10 Ways To Reduce Your LLM API Costs]]></title>
            <link>https://medium.com/@bd_perez/10-ways-to-reduce-your-llm-api-costs-a3ea14a6e85c?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3ea14a6e85c</guid>
            <category><![CDATA[money]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[llm-inference]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Tue, 19 May 2026 00:00:41 GMT</pubDate>
            <atom:updated>2026-05-20T16:11:34.261Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9kYdlHAqGIOf7QcO3o-AdQ.jpeg" /></figure><p>So you made it, you have your AI app on prod, you are onboarding your users and they like what you’ve done, cheers! Now comes the hard-to-swallow part, the AI bill.</p><p>Serving those users consumes AI inference and <strong>it’s literally eating all your margins</strong>. Let’s see 10 ways to reduce that AI bill of yours.</p><h3>Table of contents</h3><ol><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#1-choose-a-well-fitted-ai-model">Choose a well-fitted AI model</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#2-use-your-pro-subscriptions">Use your Pro subscriptions</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#3-reduce-output-tokens-to-cut-your-llm-bill">Reduce output tokens to cut your LLM bill</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#4-use-prompt-caching-when-you-can">Use prompt caching when you can</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#5-use-batch-api-for-nightly-workflows">Use Batch API for nightly workflows</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#6-be-flex-ible-and-accept-slow-tiers">Be FLEX-ible and accept slow tiers</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#7-dont-use-ai">Don’t use AI</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#8-use-free-models-and-free-tiers">Use free models and free tiers</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#9-dont-miss-those-cloud-provider-credits">Don’t miss those Cloud provider credits</a></li><li><a href="https://manifest.build/blog/reduce-ai-inference-costs/#10-observe-your-ai-costs-and-take-back-control">Observe your AI costs and take back control</a></li></ol><h3>1. Choose a well-fitted AI model</h3><p>Choosing the perfectly fitted model is not that easy. While realizing that your model is not “smart enough” for your requirements is the easy part, the other side is trickier: <strong>you may use an overkill model and you are overspending without noticing it</strong>.</p><p>Potential reductions are huge here, for example switching from GPT-5.5 to GPT-5.4 reduces costs by 50%. Use GPT-5.4 Mini instead? That’s 85% cheaper.</p><p>However nothing is magical here: the cheaper models produce lower-quality outputs. Spending time to benchmark models on your particular use cases is the key to evaluate the impact of the quality loss. The closer you are to real production data, the better. Here are some ideas to put you on the right track:</p><ul><li>Downshift within your model’s family: flagship -&gt; mini -&gt; nano</li><li>Look for other providers’ models: For example Chinese providers tend to be cheaper for an equivalent quality</li><li>Go for the previous generation: Opus 4.7 -&gt; Opus 4.6 -&gt; Opus 4.5</li></ul><p>In some cases, the query is variable and you can’t anticipate it. Using <a href="https://manifest.build/blog/what-is-an-llm-router/">LLM routers</a> that evaluate your query on-the-fly can be a good choice.</p><h3>2. Use your Pro subscriptions</h3><p>Are you paying for a ChatGPT, MiniMax or other pro subscription? Make the most of it and plug it into your app. With <a href="https://manifest.build/">Manifest</a>, you can plug several pro subscriptions into your apps, while keeping your code and favorite SDK as it is. As of today Manifest allows you to plug Anthropic, GitHub Copilot, MiniMax, Ollama Cloud, OpenAI, OpenCode Go and Z.ai pro subscription directly into your AI app. Make sure it’s ok with the terms of service of your providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*ZCvNxdRx0tlzUbmc.png" /></figure><p>The thing to watch here is the rate limit. <strong>Those subscriptions are often way cheaper than their API key alternative</strong>, but they are limited in usage. You need to set up a <a href="https://manifest.build/docs/fallback">fallback model</a> in case you hit the API rate limit. See how <a href="https://manifest.build/blog/mytrainer-manifest-routing/">MyTrainer did exactly this in production</a>.</p><h3>3. Reduce output tokens to cut your LLM bill</h3><p>Did you notice that you don’t actually pay directly for the inference of the model you call? You pay for what goes in and for what comes out of it, not the “amount of thinking” itself. What if we can tweak the system to produce the same value with less?</p><p><strong>The output tokens cost on average 5 times more than the input tokens.</strong> It’s totally worth it to spend more on the input tokens to reduce the output ones.</p><p>The easiest way is to simply tell the LLM explicitly to “be concise” and even specify the format that you are expecting. Ask for structured JSON or CSV instead of prose. Prose tends to be long and adds verbosity to the outputs. If you need prose, <a href="https://github.com/juliusbrussee/caveman">Caveman</a> (60k+ GH stars) reduces output tokens by 75% by… speaking like a caveman. <em>Caveman tool real. Make agent talk short.</em> 🪨</p><p>By the way most providers allow a “max_tokens” that truncate outputs. While this doesn’t make the model concise — it just truncates — it can still prevent long outputs.</p><h3>4. Use prompt caching when you can</h3><p>Caching has been used for decades to reduce compute and thus latency. For example when a website shows you a list of items, like the latest news for example, it will load from the database only for the first user, and then store it somewhere. Next users will receive that list from the cache directly, and have it served almost instantaneously.</p><p>It works the same with LLM prompts: Models do heavy work on every token you send to them. If part of it doesn’t change between requests, they do less work and you pay less. Generally cached input costs between 50% and 90% less.</p><p>The #1 rule here is that <strong>your static content (the one that doesn’t change) should come before the dynamic content (the volatile one)</strong>. The first changed character and you’re paying full price for following tokens. Structure your call correctly so that system prompts and knowledge bases come first:</p><pre>messages = [ {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: SYSTEM_PROMPT + KNOWLEDGE_BASE}, {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: f&quot;{user_question}&quot;}, ] resp = client.chat.completions.create( model=&quot;gpt-5.4-mini&quot;, messages=messages, )</pre><h3>5. Use Batch API for nightly workflows</h3><p><strong>Batch API is a straight 50% discount on inference if you accept to receive the response within 24 hours.</strong></p><p>You’re not going to implement that on a chat or on any actions that need real-time answers, however any background process is a good candidate. It requires a bit of change in your code but it’s totally worth it if you have a significant amount of inference in scheduled tasks, nightly workflows or routines.</p><p>Here is the link to the providers’ docs that support batch API:</p><h3>6. Be FLEX-ible and accept slow tiers</h3><p>Some providers even have a “flex” tier: a synchronous tier explicitly slower than the standard. Unlike Batch API, here you do get the real-time response, but it is significantly slower. However <strong>the discount is usually the same: 50% off</strong>.</p><p>Now it’s up to you to decide if you can afford that extra latency on some calls. Here is a list of providers that offer that trade-off:</p><h3>7. Don’t use AI</h3><p>This one can sound a bit provocative but the cheapest inference will always be the one you don’t use. Are those AI features genuinely needed? Or are they just decorative nice-to-haves?</p><p><strong>Limiting LLM calls and using algorithms (aka good old software) when possible is the biggest win on this list.</strong> Of course it’s easier said than done, but many operations can be done programmatically: validation, regex, rules, heuristics…</p><p><em>Pro tip:</em> go hybrid. Sometimes algorithms cannot handle all cases, but work well on some of them. Use conditions in your code to use them when possible, and fall back on LLMs.</p><h3>8. Use free models and free tiers</h3><p>If you are just hacking around, <strong>maybe you don’t need to pay at all!</strong> Some providers offer inference for free on some models. Of course the rate limit is quite low but if your app has a low AI inference consumption, it may work. If it doesn’t, you can still use <a href="https://manifest.build/docs/fallback">model fallback</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bmpjs20qEObvsVRl.png" /></figure><p>And you know what? We prepared a very cool list of <a href="https://github.com/mnfst/free-llm-apis">Awesome Free LLM APIs</a> just for you 😎</p><h3>9. Don’t miss those Cloud provider credits</h3><p>Building a startup? <strong>All major cloud providers can give you up to $300k in cloud credits</strong>, most of them can be used in inference. The terms vary from one provider to another, and you probably need to fill applications and even meet them.</p><p>The concept here is that the faster you can burn those tokens, the more they’ll offer you. It makes sense as they are looking for new potential big customers that will stick with their models.</p><p>You’ll probably never get the $300k on the first shot, it goes incrementally. One important thing: incubators, accelerators and startup programs tend to have agreements on credit packages with providers. Reach out to your program manager if you’re into one of those!</p><h3>10. Observe your AI costs and take back control</h3><p>Last but not least, <strong>you can’t optimize what you can’t see</strong>. Maybe one single recurrent LLM call is burning all your budget and you haven’t identified it yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0krntQ8E4DC37aTB.png" /></figure><p>There are many tools (open source or proprietary) like Manifest that let you visualize your costs, analyse them, and even set some budget limits. Some of them are simple and easy to understand, others more complicated and let you go into details. Up to you to find your fit!</p><h3>Conclusion</h3><p><strong>Reducing cloud AI inference costs is key for an app’s profitability.</strong> Consider the few lines of each point in this post as a starting point, an idea to dig into. Not all of them are necessarily applicable in your case, but they are worth knowing and understanding.</p><p>At Manifest, we think that AI is an incredible technology, and that it deserves to be affordable. Our platform is open source and gives total control to our users. Check out <a href="https://manifest.build/">our website</a> and give us a <a href="https://github.com/mnfst/manifest">star on GitHub</a> to support us! Or simply share this post, as it helps others pay less for AI.</p><p>Happy hacking!</p><p><em>Originally published at </em><a href="https://manifest.build/blog/reduce-ai-inference-costs/"><em>https://manifest.build</em></a><em> on May 19, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3ea14a6e85c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supabase alternative for AI Code editors (Cursor, Bolt, Lovable…)]]></title>
            <link>https://medium.com/@bd_perez/supabase-alternative-for-ai-code-editors-cursor-bolt-lovable-bc2e0de6605c?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc2e0de6605c</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[supabase]]></category>
            <category><![CDATA[ai-code]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 11:05:11 GMT</pubDate>
            <atom:updated>2025-06-20T11:05:11.566Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post I compare existing solutions for <strong>the backend of AI generated apps</strong> and share our journey building <a href="https://manifest.build/">Manifest</a>, a minimalistic open source backend for AI-assisted coding.</p><p>As of today, AI code editors already work very smoothly with frontend generation. Even a non coder is able to create nice UIs and websites with a bit of motivation. However vibe coding the backend side is still a bit laborious.</p><h3>The bootstrap approach to backend (local tools)</h3><p><strong>Local AI code editors</strong> like <a href="https://www.cursor.com/">Cursor</a>, <a href="http://windsurf.com/">Windsurf</a> and <a href="https://code.visualstudio.com/docs/copilot/overview">VS Code with Copilot</a> are made for people already familiar with IDEs, matching high requirements like a strong version control or working with existing/legacy codebases.</p><p>If you ask any of those editor to create a backend, chances are that you will get something made with FastAPI or Django in Python, Laravel in PHP, Ruby on rails, NestJS and so on.</p><p>All of those frameworks have proven to be exceptional products, robust and highly customizable. They have been used by developers for years support top tier platforms.</p><p>However, in the context of AI-assisted programming, they have some drawbacks:</p><ul><li>A backend with those frameworks consists necessarily in a huge amount of files which makes it nearly impossible to be humanly validated and cost a lot in computing (tokens)</li><li>Each feature is mostly developed in the spot for you and may contain security flaws for unknown reasons</li><li>The developer must still have solid knowledge with the framework to understand it</li></ul><h3>The Supabase approach to backend (online tools)</h3><p>Then you have the <strong>online vibe coding tools</strong> like <a href="https://bolt.new/">Bolt.new</a>, <a href="https://lovable.dev/">Lovable</a>, <a href="https://www.co.dev/">co.dev</a> and so on. Those tools are addressing a large audience and require little knowledge to get started. They are amazing to quickly ship a project from scratch.</p><p>What do they have in common regarding the backend ? They all have the “connect to Supabase” button. It actually makes a lot of sense as it is so much simpler to rely on a cloud backend rather than creating a consistent environment for different backend stacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*pZ1iNCVzK9ib4HmF.png" /></figure><p><a href="https://supabase.com/">Supabase</a> is a well-know BaaS (Backend as a Service) based on PostgreSQL and giving built-in features like auth or storage. Nevertheless, even if Supabase is an amazing product on its own, linking your AI-generated frontend to a Supabase backend can be tricky for many reasons:</p><ul><li>Having to deal with 2 projects creates a poor DX, making you going back and forth between 2 dashboards and the LLM not always understanding what is on the other side</li><li>Branching, versionning and environment management becomes suddenly way more complex</li><li>You may not be familiar with PostgreSQL</li></ul><p>Even if Supabase is building a strong MCP to connect the service, it will always be 2 connected services at the end of the day.</p><h3>Manifest: finding the sweet spot</h3><p>When we first built <a href="https://github.com/mnfst/manifest">Manifest</a>, as an internal tool, we did not think right away about making it fit in the context of AI coding. However, we strongly focused on simplicity of use and reducing the development time. Those characteristics are now 100x enhanced by AI code tools that we use today which makes a perfect fit for Manifest as a backend for AI editors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*DEIv1dhTVucJcwNg.png" /></figure><p>Manifest is a complete backend that fits into 1 simple YAML file, that makes it so easy for LLMs to generate that content, and for humans to validate. Relying on pre-made components like auth or upload modules is also a way of ensuring the developer that there is no breaches in security or privacy.</p><p>We also wanted Manifest to be not only open source but also 100% portable, it’s just an <a href="https://npmjs.com/package/manifest">npm package</a> that you can add to any codebase with a package.json in it. Manifest uses SQLite by default, a file-based DB that works even in browser environments like <a href="https://manifest.new/">Stackblitz</a>.</p><h3>Where we go next</h3><p>Manifest is still on BETA but already used on multiple projects. If you think Manifest could be a good fit for you, give it a try ! You can share some love by <a href="https://github.com/mnfst/manifest">giving Manifest a star on GitHub</a> and we’ll be happy to hear your feedback on our <a href="https://discord.gg/FepAked3W7">Discord server</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc2e0de6605c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From DEV to CTO: Embracing technical Debt]]></title>
            <link>https://medium.com/@bd_perez/from-dev-to-cto-embracing-technical-debt-674f6f31a79a?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/674f6f31a79a</guid>
            <category><![CDATA[cto]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[technical-debt]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Wed, 04 Dec 2024 09:33:21 GMT</pubDate>
            <atom:updated>2024-12-04T09:33:21.983Z</atom:updated>
            <content:encoded><![CDATA[<h3>How can I have a debt if I didn’t borrow any money ?</h3><p>This is the first question that technical debt brings to mind.</p><p>But let’s approach technical dept with an example: Bob had to paint his flat, he spent all Saturday doing it. He was invited to <strong>a really cool party</strong> on the evening. By nightfall, Bob had just finished painting but still needed to clean the brushes and put things away. He said “you know what ? f*** it”, stuffed roughly all the paint pots and brushes in the closet and went to that party.</p><p>What do you think about Bob’s attitude ? Is he a pragmatic man ? Or a low-life and immature person ?</p><p>There are 2 key things to understand in this story:</p><ul><li>Bob could not have been to that party if he had to clean and put tools away after painting</li><li>Bob ca no longer use his closet normally because his clothes are blocked by paint pots</li></ul><p>Understanding Bob’s story is <strong>understanding technical debt</strong> — there is nothing more to it. The next paragraphs are about helping you choose when to clean you brushes and when to go to the party.</p><h3>Doing the right thing: a practical example</h3><p>Let’s take a technical example: You have a component that needs to fetch data from an API. As a good developer, you know that the right thing to do is to create a service/store/hook/function (or whatever your framework calls it) to put all the API logic and inject it in your component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*EUmu7BvqA8Lvef1a.jpg" /></figure><p>However, <strong>software development is about delivering things that work</strong>. And the fastest way to do it is to skip the service thing and make that HTTP call directly from your component.</p><p>Is it bad code ? Yes. Does it work ? Yes.</p><p>There are obvious reasons why you should not do that: poor readability, it’s hard to maintain, there is no separation of concerns and this will inevitably lead to WET code if that call is repeated elsewhere.</p><p>However.</p><p>If that code will never be touched again in the future (not likely) or, if you do not care about how this code will be changed in the future (more likely), <strong>bad code can be your best option</strong>. End of chapter 1.</p><h3>Time capsule: doing it again</h3><p>Let’s imagine that the you from the future opens that stinky codebase from chapter 1. You have to create a new component that calls the same API. See where we are going ?</p><p>Once again we have two choices:</p><ul><li>Clear that technical debt once for all and to that damn service, and implement it in both components</li><li>increase the technical debt by ruthlessly copy-pasting your code in the new component</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*XNXLvRpTqOHTowgC.jpg" /></figure><p>Does the trade-off change ? No. It is exactly the same situation as above, you have to choose based on the situation. Be quick or be solid.</p><h3>The outcome: mastering technical debt</h3><p>From a developers’ perspective, it is clear: bad code is bad code, it is evil. Every book and tutorial will tell you exactly that you should never write bad code.</p><p>Yet, from a different perspective, the reality is not that simple. Bad code is never 100% bad and neither is good code 100% good. There are also deadlines to respect, profitability to ensure, new contributors to integrate among many other factors.</p><p>Does it mean that you have to make concessions and give up on good practices ? Not at all ! Bad code will definitely come back at you soon or late and you will pay it slowing development, weakening your app and annoy developers because no one likes to work on a stinky codebase.</p><p>The point is finding the sweet spot: nothing is absolute, everything varies from situations. Sometimes you have to deliver quickly, sometimes you need to consolidate.</p><p>It is when you start evaluating and embracing the technical debt, knowing what you get in exchange for it that you pass from developer to CTO.</p><h3>Ship fast without trading off your standards with Manifest</h3><p>If you understand that mastering technical debt is key, you will love <a href="https://manifest.build/">Manifest</a> ! It is an open source 1-file backend that allows you to create complete backends quickly while keeping your coding conventions and standards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Rak-2iJ78AHZ_m5X.png" /></figure><p>Star the <a href="https://github.com/mnfst/manifest">Manifest project</a> if you want to see Manifest grow ❤️.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=674f6f31a79a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Svelte + Manifest = Giving Svelte a proper backend with 7 lines of code ]]></title>
            <link>https://medium.com/@bd_perez/svelte-manifest-giving-svelte-a-proper-backend-with-7-lines-of-code-e2c3faad7746?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c3faad7746</guid>
            <category><![CDATA[fullstack-development]]></category>
            <category><![CDATA[svelte]]></category>
            <category><![CDATA[to-do-list-app]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Tue, 08 Oct 2024 07:21:18 GMT</pubDate>
            <atom:updated>2024-10-08T07:21:18.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YcxEBZs1OZ8RPyc8yFmeQ.png" /></figure><p><strong>TL;DR: Using Manifest as backend for Svelte turns it into a full stack application with minimal coding. Check the </strong><a href="https://github.com/brunobuddy/backend-svelte-todo-manifest"><strong>source code on github</strong></a></p><pre># manifest/backend.yml<br>name: My TODO App ✅<br>entities:<br>  Todo:<br>    seedCount: 10<br>    properties:<br>      - title<br>      - { name: completed, type: boolean }</pre><p><a href="https://svelte.dev/">Svelte</a> is an amazing framework with a very simple and elegant syntax.</p><p>However, a frontend is rarely enough to make a functional app: we often need a backend with some logic, a database and and a couple of API endpoints. This can often be time consuming and cumbersome.</p><p>In this post I will show what I think is <strong>the fastest and easiest way of giving a backend for Svelte</strong>: <a href="https://manifest.build/">Manifest</a>. It consists in a single <em>YAML</em> file (yes, YAML !) that generates a full backend.</p><p>We will create a <strong>todolist app</strong> with the following features:</p><ul><li>Adding a new <em>todo</em> stores it in the database with the completed property set to false</li><li>Clicking on the <em>todo</em> checkbox marks it at complete or uncomplete</li><li>Clicking on the “remove” button deletes the <em>todo</em></li></ul><p>This is what we are building:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*L2L_yBUEOASGZ-DY.png" /></figure><h3>Create the Svelte app</h3><p>Svelte has a nice installation script:</p><pre>npm create svelte@latest my-app</pre><p>In this example I choose the Skeleton project, in <em>TypeScript</em> and <em>without any additional options</em>.</p><p>We can now run the Svelte frontend with:</p><pre>npm run dev</pre><h3>Add the backend</h3><p>We can directly add the Manifet backend from the root of our Svelte app:</p><pre>npx add-manifest</pre><p>This will create a manifest folder with a backend.yml on it. Replace the dummy content with this one.</p><pre># manifest/backend.yml</pre><pre>name: My TODO App ✅<br>entities:<br>  Todo:<br>    seedCount: 10<br>    properties:<br>      - title<br>      - { name: completed, type: boolean }</pre><p>We can now run our backend server:</p><pre>npm run manifest</pre><p>You can now connect to your <strong>admin panel</strong> and see your <strong>OpenAPI documentation</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*QdHO7z4vRJr-Y_Y8.png" /></figure><h3>Connect the client and the server</h3><p>Now we need to add the app logic and get the data from our backend. First of all intall the Manifest SDK:</p><pre>npm i @mnfst/sdk</pre><p>To make it short we will put all the logic in the src/routes/+page.svelte file. On bigger projects it is recommended to have a better <strong>separation of concerns</strong></p><p>We will create our 3 functions:</p><ul><li>getTodos: fetch all the todos</li><li>addTodo: Adds an uncomplete todo to the DB,</li><li>removeTodo: Removes a todo from the DB</li><li>ToggleTodoCompletion: Toggles the completion status of an existing todo</li></ul><p>Lets start by defining what a Todos is:</p><pre>// Define the Todo type.<br>type Todo = { id: number; title: string; completed: boolean };<br>let todos: Todo[] = [];</pre><p>And now we can create our functions:</p><pre>import Manifest from &quot;@mnfst/sdk&quot;;<br><br>// Initialize the Manifest SDK.<br>const manifest = new Manifest();<br>// Fetch all todos from the database.<br>async function getTodos() {<br>  todos = (await manifest.from(&quot;todos&quot;).find()).data as Todo[];<br>}<br><br>// Add a new todo to the database.<br>async function addTodo() {<br>  await manifest.from(&quot;todos&quot;).create({ title: newTodo, completed: false });<br>  // Fetch all todos again to update the list<br>  getTodos();<br>}<br><br>// Remove a todo from the database.<br>async function removeTodo(id: number) {<br>  await manifest.from(&quot;todos&quot;).delete(id);<br>  todos = todos.filter((todo) =&gt; todo.id !== id);<br>}<br><br>// Toggle the completion status of a todo.<br>async function toggleTodoCompletion(todo: Todo) {<br>  // Update the todo in the database.<br>  const updatedTodo = { ...todo, completed: !todo.completed };<br>  todo = await manifest.from(&quot;todos&quot;).update(todo.id, todo);<br>  // Reassign the array to trigger update in the UI.<br>todos = todos.map((t) =&gt; (t.id === updatedTodo.id ? updatedTodo : t));<br>}</pre><h3>Putting everything together</h3><p>Checkout the <a href="https://github.com/brunobuddy/backend-svelte-todo-manifest/blob/master/src/routes/%2Bpage.svelte">+page.svelte file</a> on the demo repository to see the style and UI implementation. We managed to add simply a backend for this Svelte demo app ! Let me know your thoughts about this implementation ! What backend stack do you use for your backends usually ?</p><p>If you liked using Manifest, <a href="https://github.com/mnfst/manifest">give us a ⭐ on Github</a> to follow to projects and help us improving it. We also have some <a href="https://github.com/mnfst/manifest/issues?q=is%3Aissue+is%3Aopen+label%3Ahacktoberfest">hacktoberfest issues 🎃</a> for contributors among you !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c3faad7746" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CASE v1 is out  Instant CRUD apps]]></title>
            <link>https://medium.com/@bd_perez/case-v1-is-out-instant-crud-apps-eb9186ef1e8f?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb9186ef1e8f</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[crud]]></category>
            <category><![CDATA[web-app-development]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 12:42:59 GMT</pubDate>
            <atom:updated>2023-04-04T12:42:59.553Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Full stack framework for CRUD apps.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-NJMe-pkyc6wcw3t9-K6A.png" /><figcaption>CASE Dashboard UI generated with only few command lines.</figcaption></figure><p>As a developer, <strong>creating a custom web app</strong> for a customer requires a lot of time. That time can be spitted in 2 parts:</p><ul><li><strong>75% of the work is the repetitive,</strong> painful but methodical work that will become the spine of the app: database, typing, seeders, routes, forms, etc.</li><li><strong>25% is the skilled</strong>, custom labor that really makes the difference: the business logic of your customer</li></ul><p><a href="https://case.app/">CASE</a> purpose is to <strong>take care of that 75% of work</strong> to let developers <strong>express their talent </strong>🎨.</p><p>CASE is a <strong>TypeScript Framework made to create CRUD apps</strong> (dashboards, ERPs, CRMs, admins…) really fast.</p><h3>How can we make CRUD app development faster ?</h3><p>We based our framework on 2 existing frameworks that work well together: <a href="https://angular.io/">Angular</a> (client) and <a href="https://nestjs.com/">NestJS</a> (server). Both frameworks are written in <strong>TypeScript </strong>and share a common file structure.</p><p>On top of that <strong>monorepo</strong> structure, we builta <strong>CLI</strong> that can create resources and properties very fast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*8b5BFNQE7d-M4v270nckBQ.png" /><figcaption>CASE TypeScript monorepo structure</figcaption></figure><h4>CLI command to generate a CRUD resource</h4><p>With that power in your hands, resources and properties are created directly in the CLI:</p><pre>cs generate resource product --props=name,price:currency,photo:image</pre><p>In that example you can see that we are creating a <strong>product</strong> resource that comes with different properties. Some of them are even typed, like “<em>price:currency</em>”. It means that <strong>CASE</strong> will consider that value to be a <strong>currency</strong>. Typing properties globally will allow to save a lot of time. Tying a property as “<em>currency</em>” or “<em>image</em>” will create the adapted elements:</p><ul><li>DB column type</li><li>Typescript type</li><li><a href="https://docs.case.app/#/create-edit/fields">HTML Input</a></li><li><a href="https://docs.case.app/#/list/yields">List yield</a></li><li>Seed function</li><li>DTO validator</li></ul><h4>CLI command to generate a CRUD property</h4><p>The same philosophy applies for properties of existing resources ?</p><pre>cs g prop bio:text --resource=user<br>cs g prop size:number --resource=shoe</pre><p>Easy right ?</p><h3>Next steps for CASE framework 🦸‍♀️</h3><p>CASE is still on its early days and we have still a lot of work to do to make app development faster and more enjoyable.</p><p>We are currently looking for <strong>BETA testers</strong>, we want to hear from you ! 💗</p><p>Go to our <a href="https://github.com/casejs/case">Github profile to create your CASE application</a> and give us your toughts on <a href="https://discord.com/invite/FepAked3W7">Discord</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_kU5IWODkUHT0HpEJv0hw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb9186ef1e8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mettre les Cookies de Google Analytics en Conformité avec le RGPD]]></title>
            <link>https://medium.com/les-forgerons/mettre-les-cookies-de-google-analytics-en-conformit%C3%A9-avec-le-rgpd-21b6bcf7b5c9?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/21b6bcf7b5c9</guid>
            <category><![CDATA[rgpd]]></category>
            <category><![CDATA[google-tag-manager]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[gdpr]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Fri, 03 May 2019 09:00:07 GMT</pubDate>
            <atom:updated>2019-05-03T09:01:08.308Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*ZKCh64R-xu7CNm17qpSa2Q.png" /><figcaption>Le visiteur n’a pas la possibilité de refuser les cookies sur cet exemple.</figcaption></figure><p>Le <strong>RGPD (ou GDPR) </strong>réglemente l’utilisation des données personnelles dans l’ère du digital. Si vous avez<strong> un site web avec Google Analytics</strong>, vous êtes concernés. En effet, Analytics envoie <strong>des cookies</strong> et conserve <strong>des données considérées comme personnelles</strong> (les adresses IP).</p><p>Nous allons donc réaliser 2 actions pour mettre Google Analytics en conformité avec le RGPD :</p><ul><li>Rendre les adresses IP anonymes (rapide)</li><li>N’installer des cookies que chez les visiteurs qui les acceptent (long)</li></ul><p>On voit souvent des <strong>bandeaux cookie </strong>qui indiquent simplement que le site web utilise des cookies, comme sur l’image ci-dessus. <strong>Ceci n’est pas suffisant</strong> car on installe instantanément des cookies sur le navigateur du visiteur alors qu’il n’a pas encore lu le bandeau.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*xrO_ajrtJfNsiZMTA6jehw.jpeg" /></figure><p>Avouons-le: le RGPD est long à comprendre et à mettre en place<em>.</em> C’est un grand pas avant pour la privacité et les utilisateurs, mais il oblige les petites et moyennes organisations a prendre des mesures souvent chères et pénibles pour leur taille. Je vous conseille vivement de <a href="https://www.economie.gouv.fr/entreprises/reglement-general-sur-protection-des-donnees-rgpd">comprendre le sens général du RGPD</a> et <a href="https://www.cnil.fr/fr/site-web-cookies-et-autres-traceurs">son application sur les cookies</a> avant d’aller plus loin.</p><h3>Le déroulement</h3><p>Nous allons mettre en place le processus suivant :</p><blockquote>On demande au visiteur s’il accepte les cookies, puis on lui envoie s’il accepte. S’il avait déjà accepté auparavant, on ne lui demande plus.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*cy3MB4EGoUx8YfF8gaT8XQ.png" /></figure><p>Nota Bene : L’utilisateur ne peut pas refuser “une fois pour toutes” de recevoir des cookies pour les sessions suivantes. En effet, dans ce cas il faudrait lui envoyer un cookie pour garder en mémoire le fait qu’il refuse les cookies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*banrIKxflsbXqcKh.jpg" /></figure><p>Voici donc les ingrédients de la recette :</p><ul><li><a href="https://marketingplatform.google.com/about/analytics/">Google Analytics</a> (bien sûr)</li><li><a href="https://www.google.com/intl/fr_fr/tagmanager/">Google Tag Manager</a></li><li>Du Javascript (sous n’importe quelle forme)</li></ul><p><em>Si vous ne pouvez pas effectuer ces opérations, </em><a href="https://buddyweb.fr/"><em>l’agence Buddyweb</em></a><em> réalise des mises en conformités RGPD.</em></p><h3>1 . Configuration de Google Tag Manager</h3><p><a href="https://tagmanager.google.com/">Google Tag Manager</a> (ou GTM) est un outil qui permet de gérer les balises tierces sur votre site web. Aujourd’hui, il y a une balise pour tout : <em>Facebook, Twitter, LinkedIn, Google Analytics, Adwords, Hotjar…</em> Au début ça va, on ajoute le script dans le code source, mais cela peut s’entasser au bout d’un moment. De plus, chaque configuration impose de modifier ce code et peut entrainer un nouveau déploiement.</p><p>GTM dispose d’une interface de type CMS qui permet de configurer chaque balise, ses paramètres et quand et comment elle se déclenche. Lançons-nous dans l’aventure !</p><h4>A) Créer la variable accept_cookies</h4><p>Une fois votre compte créé (copiez les 2 snippets de code GTM pour plus tard), commençons par créer directement une variable <strong>accept_cookies</strong> (en snake_case comme il est convention pour les cookies) à partir de l’onglet “variables”. Ceci permettra à GTM de lire le cookie <strong>accept_cookies</strong> sur le navigateur de l’utilisateur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tlt4JviLpobY-Jg2htl1sQ.png" /></figure><h4>B) Créer le déclencheur “Accept Cookies Button Click”</h4><p>Etant donné que nous allons lancer (ou re-lancer) Analytics à l’acceptation des cookies, nous allons créer <strong>un déclencheur customisé</strong>. Il sera relié au bouton “J’accepte les cookies” sur notre site web et exécutera le code des balises au clic sur ce bouton. On peut créer un déclencheur directement dans l’onglet “Déclencheurs”. Pour la propriété “Click ID”, choisissez “accept-cookies”, ce sera l’ID de notre bouton HTML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUIOvOzVhn8kiXB_-dBdmg.png" /></figure><h4>C) Créer la balise qui active/désactive le tracking Google Analytics</h4><p>Nous allons créer un script qui va aller voir si le cookie <strong>accept_cookies</strong> est présent chez l’utilisateur et faire un <a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/user-opt-out">User Opt-Out</a> si ce n’est pas le cas.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b59c7391ba2152b203cf5df32e05741/href">https://medium.com/media/4b59c7391ba2152b203cf5df32e05741/href</a></iframe><p>Cette balise sera reliée à 2 déclencheurs :</p><ul><li><strong>All pages :</strong> Se déclenche à l’arrivée sur une page</li><li><strong>Accept Cookies Button Click :</strong> Prendre en compte l’acceptation de cookies au click sur le bouton “j’accepte les cookies”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H2fCFoRHUc6uj9C5G-UzXg.png" /><figcaption>Image de création de la balise HTML avec le script d’activation de Google Analytics en fonction du cookie “accept_cookies”</figcaption></figure><h4>D) Créer la balise Google Analytics et configurer son déclenchement</h4><p>La 2ème balise que nous allons créer est celle de <strong>Google Analytics</strong>. Pour cela sélectionnez “Google Analytics — Universal Analytics” comme <em>Type de balise</em> et ajoutez votre ID de suivi (<em>UA-XXXXXXXX-XX</em>) après avoir coché la case <em>Autoriser le remplacement des paramètres dans cette balise</em>.</p><p>Reliez-la aux 2 mêmes déclencheurs et réglez le séquençage de la balise pour qu’elle se déclenche <strong>APRES</strong> l’autre balise (très important). En effet, nous voulons que GA se lance après que la balise précédente ait activé le tracking lors du click sur le bouton “accepter les cookies”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMJsRxRUJAAavFLYtOlc0Q.png" /><figcaption>Vue d’ensemble de la configuration de Google Analytics sur Google Tag Manager</figcaption></figure><p>Profitez-en pour définir le champ <strong>anonymizeIp</strong> <strong>à true </strong>comme sur l’image ci-dessous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*pgnNMFOGvMlqw6xn5fkh2A.png" /><figcaption>AnonymizeIp doit être à “true” pour être RGPD-compliant car de ce fait, les informations stockées ne sont pas reliées à un IP identifiable</figcaption></figure><h3>2 . Configuration du front-end (site web)</h3><p>Une fois notre gestion de balises réalisée, place au travail sur le site web. Nous devons le connecter avec GTM et demander aux utilisateurs s’ils acceptent les cookies avec un<strong> bandeau cookie RGPD</strong>.</p><h4>A) Ajouter le script GTM</h4><p>Il y a 2 scripts en réalité : un dans le &lt;head&gt; et l’autre dans le &lt;body&gt;. On peut les retrouver dans <em>Admin &gt; Installer Google Tag Manager</em>. Les 2 scripts doivent être accessibles depuis toutes les pages.</p><h4>B) Créer un bandeau cookie (ou cookie modal)</h4><p>A partir d’ici, la méthode diffère en fonction du framework ou de la technologie utilisée. Ceci-dit, la logique reste la même :</p><ul><li>A l’arrivée sur le site : vérifier si l’utilisateur a le cookie <strong>accept_cookies</strong>. Si ce n’est pas le cas, on affiche notre bandeau RGPD.</li><li>Dans notre bandeau, un bouton “accept-cookies” déclenche une fonction qui ajoutera le cookie accept_cookies et qui fermera le bandeau.</li></ul><p>Pour ma part j’utilise <strong>Angular</strong> et <a href="https://www.npmjs.com/package/ngx-cookie-service">ngx-cookie-service</a>, mais vous pouvez faire de même avec <strong>React, Vue, jQuery </strong>ou d’autres. Voici la template de la modal ainsi que le composant :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14322562a1d4c8bd89bea91697acda39/href">https://medium.com/media/14322562a1d4c8bd89bea91697acda39/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44d3727144acd7a73817396ff87387df/href">https://medium.com/media/44d3727144acd7a73817396ff87387df/href</a></iframe><h3>3 . Tester avec la prévisualisation de Tag Manager</h3><p>Google Tag Manager offre la possibilité de prévisualiser les modifications avant de les publier. Pour cela je vous conseille d’utiliser Google Chrome et d’ouvrir un nouvel onglet dans la même fenêtre avec votre site web. Vous pourrez ensuite tester le fonctionnement et valider le comportement suivant:</p><h4>A la 1ère arrivée sur le site :</h4><ul><li>Aucun cookie ne s’enregistre sur le navigateur</li><li>La cookie modal s’affiche</li></ul><h4>Au click sur “accepter les cookies”</h4><ul><li>Le cookie “accept_cookies” et les cookies de Google Analytics s’enregistrent sur el navigateur</li><li>La cookie modal disparaît</li></ul><h4>Lors d’une suivante visite après acceptation (recharger la page)</h4><ul><li>Les cookies sont toujours là</li><li>La cookie modal n’apparait pas</li></ul><h4>Lors d’une suivante visite SANS acceptation des cookies</h4><ul><li>Pareil qu’à la 1ère arrivée sur le site</li></ul><p><em>Attention ! Pensez à effacer vos cookies avant de commencer et d’actualiser les cookies à chaque changement (bouton “refresh” en haut de la liste du devTools).</em></p><p>Si les tests sont concluants, vous n’avez qu’à <strong>publier vos modifications sur GTM </strong>et sur votre front-end pour passer en production. Si l’appel de <em>gtm.js</em> renvoie une erreur 404, c’est que les modifications n’ont pas été correctement publiées.</p><h3>Conclusion : Une utilisation de cookies Google Analytics conformes au RGPD</h3><p>Grâce à cette méthode nous avons réussi à <strong>envoyer des cookies uniquement aux visiteurs qui les ont acceptés</strong>. La différence avec un bandeau strictement informatif “<em>ce site utilise des cookies</em>” est importante car le visiteur a le choix de les accepter ou non.</p><p>De plus, l’IP du visiteur ne sera pas conservé en tant que tel, mais transformé pour devenir anonyme. En effet, l’adresse IP “en clair” permet l’identification d‘une personne et relève donc des données personnelles. Le RGPD vous obligerait donc à prendre en compte tout un tas de trucs supplémentaires.</p><p>Et voilà pour la plupart ! Par contre si vous envoyez à Google Analytics des données personnelles (identifiants, valeurs de formulaires, etc.), il vous faudra bien évidemment vous mettre en accord avec le RGPD sur ce point là aussi.</p><p>Bon courage !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21b6bcf7b5c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/les-forgerons/mettre-les-cookies-de-google-analytics-en-conformit%C3%A9-avec-le-rgpd-21b6bcf7b5c9">Mettre les Cookies de Google Analytics en Conformité avec le RGPD</a> was originally published in <a href="https://medium.com/les-forgerons">Blog Buddyweb - Agence Digitale à Paris</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutoriel : Créer une application basique avec Angular]]></title>
            <link>https://medium.com/les-forgerons/tutoriel-cr%C3%A9er-une-application-basique-avec-angular-81eb816bbe5d?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/81eb816bbe5d</guid>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 15:23:29 GMT</pubDate>
            <atom:updated>2019-05-10T15:03:26.322Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tutoriel : Créer une app basique avec Angular</h3><p>Dans ce tutoriel nous allons créer une application concrète de A à Z avec Angular. La<a href="https://angular.io/docs"> documentation officielle</a> est bien faite, mais on a souvent besoin de voir des examples concrets pour avancer.</p><p>Nous allons donc <strong>partir de zéro</strong> pour créer une application pragmatique qui va afficher des résultats de matchs de foot (c’est un exemple, la même méthode peut nous aider à récupérer n’importe quelle donnée). Nous irons chercher ces résultats sur une API externe et les afficherons dans notre app. Voici donc les différentes étapes:</p><ol><li>Installer Angular</li><li>Configuration SCSS</li><li>Installation kit UI</li><li>Création des composants</li><li>Routing</li><li>Création des services</li><li>Interfaces</li><li>Appels HTTP</li><li>Affichage des variables dans les templates</li></ol><p><em>Info: </em><a href="https://github.com/brunobuddy/angular-basic-app"><em>Le code source de l’application est disponible ici</em></a><em>. Cet article est le résumé des 2 vidéos suivantes :</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcNAchoTqzDg%3Fstart%3D1%26feature%3Doembed%26start%3D1&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcNAchoTqzDg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcNAchoTqzDg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a5e49f9f807871a7e326760858153a4/href">https://medium.com/media/5a5e49f9f807871a7e326760858153a4/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FzdqrR17f30U%3Fstart%3D275%26feature%3Doembed%26start%3D275&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzdqrR17f30U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzdqrR17f30U%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/e8d86e751f7a2c184933f1bbf39b07c0/href">https://medium.com/media/e8d86e751f7a2c184933f1bbf39b07c0/href</a></iframe><h3>Installer Angular</h3><p>Pour créer un nouveau projet Angular, vous avez besoin de la <a href="https://cli.angular.io/">CLI d’Angular</a> et de <a href="https://nodejs.org/en/">NodeJS</a>.<strong> CLI</strong> signifie Command Line Interface, c’est un outil qui vous permettra de taper des commandes commençant par <em>“ng”</em> sur votre terminal.</p><p>Une fois ces dépendances téléchargées, tapez dans votre terminal :</p><pre>ng new angular-tutorial</pre><p>Ce qui va créer un nouveau dossier à votre emplacement actuel et installer un projet Angular dedans. Cela va prendre quelque temps à s’installer, puis vous pouvez vérifier en servant l’app :</p><pre>cd angular-tutorial<br>ng serve</pre><p>Et en allant sur <a href="http://localhost:4200.">http://localhost:4200</a> avec votre navigateur. Vous devriez maintenant voir un gros logo Angular. Tout va bien pour l’instant.</p><h3>Configuration SCSS sur Angular</h3><p>Par défaut les fiches de style sont en <em>.css</em> sur Angular. Si on veut passer à <a href="https://sass-lang.com/">SASS</a> par défaut (je vous le recommande), il faut modifier les paramètres du fichier <a href="https://github.com/brunobuddy/angular-basic-app/blob/master/angular.json"><em>angular.json</em></a><em> :</em></p><pre>&quot;schematics&quot;: {        <br>  &quot;@schematics/angular:component&quot;: {          <br>    &quot;styleext&quot;: &quot;scss&quot;        <br>  }<br>}</pre><p>A partir de maintenant, lorsque vous allez créer un composant, sa fiche de style sera par défaut en SCSS. Il me semble que la même configuration permet de faire la même chose pour du <a href="http://lesscss.org/">LESS</a>.</p><h3>Installer un kit UI (framework CSS) sur Angular</h3><p>Dans notre example nous allons utiliser un kit UI très puissant et très simple qui s’appelle <a href="https://bulma.io/">Bulma</a>. Installons le avec une commande NPM. Dans le terminal à la racine du projet faites :</p><pre>npm i bulma --save</pre><p>Angular prône <a href="https://medium.com/@simonb90/comprendre-la-viewencapsulation-dans-un-component-angular-83decae8f092">une philosophie d’encapsulation de ses composants</a>, y compris pour le style. Ce principe permet d’éviter que vos déclarations “débordent” des composants, par exemple vous pouvez appeler un élément “title” sur chacun de vos composants et lui donner des propriétés différentes sans qu’elles se superposent. Chaque composant contient sont “title” et ses définitions qui se limitent à lui-même. Chacun chez soi, tout le monde est content.</p><p>Ceci est très bien et très utile, surtout sur les grosses apps, mais nous voulons faire une seule exception à la règle pour que notre kit impacte tous les composants avec un style par défaut. Chaque composant pourra ensuite ajouter ou surcharger ces propriétés avec des déclarations spécifiques et limitées à lui-même.</p><p>Nous allons donc retirer l’encapsulation du <a href="https://github.com/brunobuddy/angular-basic-app/blob/master/src/app/app.component.ts">composant principal</a> et de faire un lien vers une nouvelle feuille de style qui importe notre kit :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pmwgwmR8JMUFeRV6100IMQ.png" /><figcaption>Utilisation de la propriété “encapsulation” du décorateur @Composant</figcaption></figure><p>Dans cet example, on a crée un fichier main.scss dans /assets/styles. Ce fichier ne comprend qu’une ligne qui importe notre kit Bulma :</p><pre>@import &#39;../../../node_modules/bulma/bulma&#39;;</pre><p>Et voilà, en retournant sur notre page d’accueil on doit déjà voir que le style à légèrement changé (typo plus ronde et couleur plus grisées). On avance !</p><h3>Création de composants</h3><p>Créons un composant pour le header afin de diviser nos templates :</p><pre>ng g c partials/header</pre><p>La commande “generate component” (abrégée “g c”) va créer un composant header que nous allons pouvoir appeler dans app.component.html avec la balise app-header.</p><pre>&lt;app-header&gt;&lt;/app-header&gt;</pre><p>Il est possible d’en faire de même pour le footer ou d’autres éléments de l’app. Il vaut mieux beaucoup de petits fichiers qu’un seul gros fichier.</p><h3>Routes et URLs dans Angular</h3><p>Maintenant nous allons créer 2 vues différentes : MatchList et MatchDetail pour afficher respectivement la liste des matches et le détail d’un match</p><pre>ng g c resources/matches/match-detail<br>ng g c resources/matches/match-list</pre><p>Et nous allons créer un nouveau fichier <a href="https://github.com/brunobuddy/angular-basic-app/blob/master/src/app/app.routes.ts">app.routes</a> dans /app avec le contenu suivant :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAh-93-ZCnSY99FmOI0Qpw.png" /><figcaption>app.routes.ts</figcaption></figure><p>Puis l’importer dans app.module.ts avec appRoutes en paramètre de forRoot :</p><pre>imports: [BrowserModule, RouterModule.forRoot(appRoutes)]</pre><p>Pour finir, il nous faut ajouter une balise dans le HTML (app.component.html) qui va nous indiquer ce qui va changer en changeant de route :</p><pre>&lt;app-header&gt;&lt;/app-header&gt; <br>&lt;router-outlet&gt;&lt;/router-outlet&gt; <br>&lt;p&gt;FOOTER&lt;/p&gt;</pre><p>Dans cet example, le header et le &lt;p&gt; footer vont rester là tandis que le contenu de &lt;router-outlet&gt; sera remplacé par le contenu de nos composants si la route change.</p><h3>Créer des services HTTP dans Angular</h3><p>Pour cette étape nous allons utiliser <a href="https://bridge.buddyweb.fr/">un outil gratuit nommé Bridge</a>, qui va nous permettre de créer des APIs en JSON depuis un tableau CSV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4wWMNlujX9xz99b437P-A.png" /><figcaption>Vision de Postman</figcaption></figure><p>L’API est ouverte est accessible à l’URL :<br>- <a href="https://bridge.buddyweb.fr/api/tutorials/matches">https://bridge.buddyweb.fr/api/tutorials/matches</a> pour la liste des matchs<br>- <a href="https://bridge.buddyweb.fr/api/tutorials/matches">https://bridge.buddyweb.fr/api/tutorials/matches</a>/1 pour le détail</p><p>Nous allons donc créer un service qui va récupérer ces données là.</p><pre>ng g s common/services/match</pre><p>Et nous voilà avec un MatchService.</p><h3>Interfaces</h3><p>Les interfaces sont <a href="https://www.typescriptlang.org/docs/handbook/interfaces.html">une fonctionnalité de TypeScript</a> qui va nous permettre de définir précisément ce qu’on va recevoir, en l’occurrence un “match”. Qu’est ce qu’un match ? Pour notre application nous allons définir ce concept en créant une interface Match dans un fichier <a href="https://github.com/brunobuddy/angular-basic-app/blob/master/src/app/common/interfaces/match.ts">match.ts</a> :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2s9OKLovTg8OzsXD9rlHQ.png" /><figcaption>L’interface Match détaille les différentes propriétés d’un Match.</figcaption></figure><h3>Appels HTTP depuis les services Angular</h3><p>Maintenant que nous savons quel type de données nous allons recevoir et l’URL à laquelle nous allons les recevoir, il ne manque plus qu’à passer l’appel. Commençons par doter notre service de 2 fonctions, une pour récupérer la liste de matchs (sans paramètres), et l’autre qui va récupérer un seul match en fonction de son ID.</p><p>Tout d’abord nous avons besoin d’ajouter le HttpClientModule dans app.module.ts, nous avions déjà touché cette ligne pour ajouter les routes :</p><pre>imports: [BrowserModule, RouterModule.forRoot(appRoutes), HttpClientModule],</pre><p>Voici le service avec nos 2 fonctions :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWOsaH7Nv_-9ndlGZvLybw.png" /><figcaption>La fonction list() retourne un Observable qui se résout en array de Match tandis que la fonction show(id) renvoie un Observable qui se résout par un Match unique.</figcaption></figure><p>Les outils sont prêts, il ne reste plus qu’à s’en servir. Utilisons la fonction <em>ngOnInit()</em> pour lancer notre requête HTTP instantanément en arrivant sur la MatchList :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_yJFHsrYCy1IyzYWAO5szQ.png" /><figcaption>NgOnInit() nous permet de charger la liste des Matchs et de la stocker dans la propriété matches de MatchListComponent.</figcaption></figure><p><a href="https://github.com/brunobuddy/angular-basic-app/blob/master/src/app/resources/matches/match-detail/match-detail.component.ts">Même combat pour la MatchDetail</a>, avec cette fois-ci une différence: le paramètre “id” sera récupéré directement depuis l’URL grâce à ActivatedRoute.</p><p>Pour tester les 2 réponses, il suffit de se rendre sur l’url <a href="http://localhost:4200/">http://localhost:4200</a> et sur <a href="http://localhost:4200/matches/1">http://localhost:4200/matches/1</a> par exemple. Ensuite regarder si l’appel HTML a bien été réalisé dans la console/DevTools de votre navigateur.</p><h3>Afficher les variables dans les templates</h3><p>Et le plus facile pour la fin ! Une fois les matches disponibles, il suffit de les appeler en utilisant la double accolade, ainsi que <a href="https://angular.io/guide/displaying-data">les directives Angular nécessaires comme *ngFor ou *ngIf</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryirO2tJnSuUG42R6--a1g.png" /><figcaption>match-list-component.html</figcaption></figure><p>Je vous laisse faire de même (ou mieux que moi) pour le <a href="https://github.com/brunobuddy/angular-basic-app/blob/master/src/app/resources/matches/match-detail/match-detail.component.html">match-detail-comonent.html</a></p><h3>Conclusion</h3><p>Nous avons parcouru beaucoup de chemin depuis l’installation de Angular ! Ces fonctionnalités sont basiques et utilisées dans la plupart des projets Angular.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81eb816bbe5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/les-forgerons/tutoriel-cr%C3%A9er-une-application-basique-avec-angular-81eb816bbe5d">Tutoriel : Créer une application basique avec Angular</a> was originally published in <a href="https://medium.com/les-forgerons">Blog Buddyweb - Agence Digitale à Paris</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Human Developer is Better Than a Wizard]]></title>
            <link>https://medium.com/les-forgerons/a-human-developer-is-better-than-a-wizard-565bef09e391?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/565bef09e391</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[digital-project-manager]]></category>
            <category><![CDATA[webmaster]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[developer-relations]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Tue, 19 Feb 2019 08:55:31 GMT</pubDate>
            <atom:updated>2019-02-19T08:55:31.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*rkhUk69PoyQ7nDJJAHcTvg.png" /></figure><p>Like many of you, I grew up watching hackers in movies. I was really thrilled to see those hacking scenes in the late-90’s and 2000s movies. The hackers were some kind of modern-era super heroes. This image shaped the way people perceived the job of developers. It actually made people believe that that those movie-hackers had the requirements to be good developers.</p><p>Nowadays, to build a website or a platform, we have plenty of diverse profiles, skills and sensitivities collaborating together. But before the digital labour got divided, there was a single person doing everything such as server monitoring, UX design and even comment moderation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OtodkA6X85Qe1x8yAJurbg.gif" /></figure><p>That “<a href="https://en.wikipedia.org/wiki/Webmaster">webmaster</a>” had indeed <strong>a lot of responsabilities</strong> back then. Even more than you think, as most people didn’t get anything about computers at that time. They needed someone to do what seemed magic for them: They needed a wizard, and in response to that, developers acted like wizards.</p><h3>You don’t need to be a wizard anymore</h3><p>Many things changed <a href="https://www.warnerbros.com/archive/spacejam/movie/jam.htm">since that era</a>, one thing in particular : <strong>developers are not alone anymore</strong>. They came out of the cave to sit on nice office chairs. They became a valuable and acknowledge part of a workforce, and their non-technical pairs can now understand most of their concepts because they are daily IT users too. <strong>Magic became craft</strong>, and it’s a good thing.</p><p>The most important change is that a large part of the developers work in team. Working in a team <strong>means a lot of things</strong>. First of all, you cannot be an a**hole anymore. You owe respect to all of your teammates and you must develop a new set of skills : Discipline, communication, empathy and pedagogy. None of those are tech-related skills.</p><p>In my 10-year developer experience, I met and worked with many of those so-called wizards or geniuses. Speaking loudly technical terms, making you feel bad if you don’t know this or that technology. In my junior years, I was really impressed by them. I often felt ashamed, because, as a developer, I thought I should have understood them but I didn’t get a word of their jargon.</p><p>But you know what ? That’s bullshit. Our job is to make complex things easy, not the opposite. I say that for junior developers like I was at that time, and for anyone impressed by their speeches.</p><h3>Let’s make it easy instead !</h3><p>Ok, let’s face it : Our job is not that difficult. <strong>Very few developers</strong> are working on really hard-to-grab concepts. Most of us, including myself, are basically <strong>sending, receiving and manipulating data</strong>. I am not saying this in a bad way, the point is that those concepts are mainly understandable. Don’t you think we should be able to talk about them simply with non-tech savvy people ?</p><p>There was a time where computing was not for everybody. The tools were rudimentary (if they even existed), there was a lot of calculation involved and you needed a lot of will to make anything work as you wanted. But right now ? Day-to-day there is not that much to invent or to hack. We need people who think clearly.</p><p>In order to remove that sticky wizard-hacker prejudice, we need to change the perception of our job. It starts with changing ourselves : <strong>to communicate inclusively and understand that we are now part of a production chain</strong>.</p><p>Code katas for example (coding exercices) or coding contests are overrated in my opinion. Of course it’s a good way to learn code and have fun, but companies should not overlook that point : A developer that understand the business value and respects the job frame is way more profitable than a developer that can find all prime numbers in one (illegible) line of code.</p><h3>Or… let’s be a part-time wizard</h3><p>If you are a developer and reading this post, you are wandering since when developing became that boring, I can tell you : Since it pays good.</p><p>Coding as a job is not an adventure in the wild, it’s full of methodology, meetings, explaining yourself, testing and many more boring stuff. But it is still super fun to do. And in addition to that, you still can be a wizard in your free time and have a lot of experimental side-projects in obscure languages !</p><p>That’s it ! What do you think about the evolution of the job of a developer ? What are the qualities that you think a developer should have or not have ? I would be glad to see your opinion (for devs AND non-devs) in the comments :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=565bef09e391" width="1" height="1" alt=""><hr><p><a href="https://medium.com/les-forgerons/a-human-developer-is-better-than-a-wizard-565bef09e391">A Human Developer is Better Than a Wizard</a> was originally published in <a href="https://medium.com/les-forgerons">Blog Buddyweb - Agence Digitale à Paris</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Easiest NodeJS Scraper — with Instant Facebook Notification]]></title>
            <link>https://medium.com/les-forgerons/the-easiest-nodejs-scraper-with-instant-facebook-notification-b1213205ba68?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1213205ba68</guid>
            <category><![CDATA[scraper]]></category>
            <category><![CDATA[puppeteer]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[scraping]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Mon, 17 Sep 2018 08:33:25 GMT</pubDate>
            <atom:updated>2018-09-17T12:49:59.101Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hc_Z8jIsiBo9_CxUhqn1nw.jpeg" /></figure><p>Just 67 lines of code to get notified instantaneously on each change for cheap flights, hot deals, new products, or any list of items.</p><h3>Intro</h3><p>In this tutorial, we are going build a script that visits a webpage every 5 minutes and sends a Facebook message if there is a new item. Nice, isn’t it ? In our example, <a href="https://www.voyagespirates.fr/tag/erreur-de-pri">the page we are scrapping</a> displays super-cheap flights with a “price mistake” : Those deals disappear very quickly, that’s why we want to know it right away ! NB: The page is in French, but there is no need to read it.</p><p>If you are busy, just get the <a href="https://github.com/brunobuddy/cheap-flights-scrapper">Github repo of the cheap flights scraper</a>. For everybody else, let’s go together on this journey step by step :</p><pre>mkdir my-scrapper<br>cd my-scrapper</pre><p>Nice ! We just created a folder and <em>cd</em> into it.</p><h3>Scrap</h3><p>Let’s start with the main feature : <strong>scrap a website with NodeJs</strong>. We will use <a href="https://github.com/GoogleChrome/puppeteer">Puppeteer</a>, let’s say that it’s a version of Google Chrome without the window to view it. As we don’t need to <em>see</em> the website but just to extract data from it, it fits perfectly for our scraper.</p><pre>npm init // Creates a package.json file<br>npm i puppeteer --save // &quot;i&quot; stands for install</pre><p>Puppeteer is super easy to use. Let’s create a file called <em>main.js</em> and start working. <a href="https://blog.buddyweb.fr/my-way-from-webstorm-to-vs-code-and-other-things-in-a-developers-life-fe71f0d07c59">I am using VS Code</a>, but you can use any editor you want. That code below takes a screenshot of our page and stores it as <em>example.png </em>in the root folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyY0YlEfPIG4j-I3TcMaDg.png" /></figure><p>Let’s execute it :</p><pre> node main.js</pre><p>Ok, this one was easy, but make sure that the image was generated. What we want to do now is to find a <strong>list of items</strong> in this page. We are using <a href="https://www.w3schools.com/cssref/css_selectors.asp">selectors</a> to fetch this list. Let get only the item titles, there is no need to get images and texts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHGe_vYKnotdVcwJJiL9ZQ.png" /><figcaption>Extract of the source code of the page. Notice the structure : &lt;h2&gt; tag directly followed by a &lt;a&gt; tag, that is what we want !</figcaption></figure><p>The selector to get all the titles is <strong><em>h2 &gt; a</em></strong> that means <em>“all the &lt;a&gt; tags that have an &lt;h2&gt; tag as direct parent”</em>. Let’s try to <em>console.log</em> it to check if you have the right content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UslMXETj06LenKPQ109yEg.png" /><figcaption>In line 9 we are using innerText instead of innerHTML because we don’t want to be disturbed by HTML symbols</figcaption></figure><p>If you execute the file again (<em>node main.js</em>), you should receive an output in your terminal that lists all the items. Before going further, be sure that this output corresponds only to the items of the list, and that it’s the text you want. You may need to add a class selector like “<em>a.item-title</em>” to make it work</p><h3>Compare and store</h3><p>Once we have that data, we need to compare it with a previous extract. If the data changed, we send a message.</p><p>So how are we going to store the data : SQLite ? MongoDB ? MySQL ? No, This is not the fanciest NodeJs scraper, it’s the easiest NodeJs scraper ! Let’s be cheap and play for time, we are going to store it in a JSON file :)</p><p>One more thing, we don’t need to get all the items, but only the last one published, witch is actually the first one to appear in the page (on a feed-like system).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aigTmNkmy1lwhW-EG4L0MA.png" /></figure><p>Let’s add “fs” to read and write files. Don’t forget to “require” it on top of the file.</p><pre>npm i fs --save</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89puExdIfPP40OhGPadEUg.png" /></figure><p>Ok, things are going a bit faster here. First we read a file called “previous-deal.json”. If the text in it is similar to the last deal from the website, we do nothing and stop the script.</p><p>If it’s empty or different, we update the JSON and we follow the script. Notice that we are using a try/catch structure because an error is thrown if the file does not exist, and we don’t want the program to stop.</p><p>You can try to execute the script again several times, eventually changing the content of the JSON file to trick the script and let it believe that the data changed.</p><h3>Send Facebook Messenger notification</h3><p>Now that we know if things changed, we need to send a notification to the recipients. We are using Facebook for that : it’s instantaneous, free, and easy to implement.</p><p>Once again, we will take a shortcut and we will NOT create a chatbot and manage tons of ids, authorizations and tokens. Instead, we will use an <a href="https://github.com/Schmavery/facebook-chat-api">unofficial small library</a> that allows to send messages as someone for whom you have the credentials. In order to keep our credentials and personal data safe, we will use <a href="https://github.com/motdotla/dotenv">dotenv</a> too.</p><pre>npm i facebook-chat-api dotenv --save</pre><p>Let’s create a “.env” file with our sensitive data. This file remains private and will not be added to the version control system (git). You cannot send a message to yourself on Facebook so we need a sender account with login credentials (SENDER_USERNAME and SENDER_PASSWORD) and recipient accounts (Facebook IDs only)</p><p>Each Facebook account has an ID that you can find easily with <a href="https://findmyfbid.com/">this website</a>. You will need to get the ID of each one of the recipients and add them in the double-quote string in the RECIPIENTS environment variable (see code below, replace the “recipientX” by the ID).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLWC5zygc734fqKT74pM0g.png" /><figcaption>Create a .env file and add your data. Recipient Facebook IDs should be coma separated because we are going to <a href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/String/split">split()</a> that string later</figcaption></figure><p>For the sender account, if you are a hacker you probably have that old account that you made some time ago. If not, just create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knHeHLyav1pvZsl26GAe3Q.png" /></figure><h3>Repeat every 5 minutes</h3><p>We will use a CRON job to run the script regularly :</p><pre>npm i node-cron express --save</pre><p>We use <a href="https://www.npmjs.com/package/node-cron">node-cron</a> to schedule tasks and expressjs to keep listening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*GRLqjSlfMuugSHRAQKN8qw.png" /><figcaption>The code in line 3 will be executed every 5 minutes</figcaption></figure><p>You just need to replace the <em>console.log</em> in line 13 by your code. Have a look at the <a href="https://github.com/brunobuddy/cheap-flights-scrapper/blob/master/main.js">final version here</a>.</p><h3>Deploy</h3><p>Now that your Node js scraper is ready, you need to deploy it on a server that will always be available. I will not enter too much in detail as this part will be different based on your solution, whereas you use <a href="https://www.heroku.com/">Heroku</a>, <a href="https://zeit.co/now">Now</a>, or another cloud service.</p><p>I use personally <a href="https://www.digitalocean.com/">Digital Ocean</a> servers with Ubuntu and had to install some libraries in order to run Puppeteer :(</p><p>That’s it ! Please let me know how it worked out for you. Let me know too if you know how we can make this scraper even simpler.</p><p><a href="https://github.com/brunobuddy/cheap-flights-scrapper">brunobuddy/cheap-flights-scrapper</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1213205ba68" width="1" height="1" alt=""><hr><p><a href="https://medium.com/les-forgerons/the-easiest-nodejs-scraper-with-instant-facebook-notification-b1213205ba68">The Easiest NodeJS Scraper — with Instant Facebook Notification</a> was originally published in <a href="https://medium.com/les-forgerons">Blog Buddyweb - Agence Digitale à Paris</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My way from WebStorm to VS Code and other things in a developer’s life]]></title>
            <link>https://medium.com/les-forgerons/my-way-from-webstorm-to-vs-code-and-other-things-in-a-developers-life-fe71f0d07c59?source=rss-f5405545500c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe71f0d07c59</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webstorm]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[ide]]></category>
            <dc:creator><![CDATA[Bruno Pérez]]></dc:creator>
            <pubDate>Fri, 06 Jul 2018 11:44:22 GMT</pubDate>
            <atom:updated>2018-07-06T11:44:22.502Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*e2bFJqGpZ8s3kRA5IFG7Ag.png" /></figure><p>For developers, IDE/Text-editor choice has passed beyond rational debate long time ago : it’s something personal. For that reason, I don’t want to create another <em>VSCode VS WebStorm</em> post, but instead relate how and why I came to switch from JetBrains WebStorm to Microsoft VS Code.</p><h4>Why change from one to another ?</h4><p>First of all, let me say that both softwares are really good.</p><p>I have been working for 4 years on IntelliJ IDEA (IntelliJ, WebStorm, PHPStorm, PyCharm are basically “flavors” of the same product). I loved my experience and I even wrote <a href="https://blog.buddyweb.fr/why-i-stopped-using-sublimetext-to-use-phpstorm-dbd927263a11">a post about it</a> at that time.</p><p>Both WebStorm and Microsoft Visual Studio Code are VERY similar, so why loose time to learn something new ? All started with performance. As my MacBook Pro started its third year of existence, it became a bit slow (thanks planned obsolescence), an its 8gb of RAM are not that much when WebStorm only itself often uses 2gb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*LDCBZYgIB2VWWz4a7Chrqg.png" /></figure><p>I heard that VS Code was more lightweight and I decided to take the opportunity to try the thing that everybody is talking about. When I say everybody, I mean the louder ones, the JS and NodeJS developers :)</p><p>Actually, I’m one of them without being one of them. I’ve started with PHP and did many <a href="https://laravel.com/">Laravel</a> projects, then started with AngularJS when it came out and evolved to <a href="https://angular.io/">Angular</a>. I fell in love with TypeScript and I’m still learning to do some server-side programming with a Node.js/TypeScript framework called <a href="https://nestjs.com/">Nest</a>.</p><p>Ok, let’s go back to performance. Using VS Code did a huge change in overall performance and my Mac seems young again. One point for VS Code !</p><h4>Starting with VS Code</h4><p>To reduce the learning curve, you can start by installing some plugins : <a href="https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings">IntelliJ IDEA Keybindings</a>, <a href="https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker">Code Spell Checker</a>, <a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier</a>, <a href="https://marketplace.visualstudio.com/items?itemName=krizzdewizz.goto-last-edit-location">goto-last-edit-location</a>, <a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag">Auto Rename Tag</a>, <a href="https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight">TODO Highlight</a>. Those features are available out-of-the-box on WebStorm but we have to download them as plugins in VS Code. There is huge difference in their philospohy : As WebStorm comes with key-packages included from start, Microsoft VS Code comes half-naked and you have to dress it (like a PHP project in comparison to a NodeJS project). It’s neither good or bad, but the approach is different.</p><p>Settings are easy to change, JSON-style make it easy to search and to make the difference between the default ones and the ones you specifically changed.</p><p>Global UI is cleaner than WebStorm. For minimalist-lovers like me, you can use Zen Mode to focus even more.</p><h4>Day-to-day work on VS Code</h4><p>After few days, I’m still adapting but I am quite happy with my new editor. Code’s Source Control is so much nicer that WebStorm. I use the <a href="https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack">Git Extension Pack</a> and everything is smooth. I actually don’t really know which features are native or from the plugin, it’s probably a good thing.</p><p>Regarding the terminal,I found out that VS Code is more convinient. With your keyboard you can <em>Create New Integrated Terminal</em>, split panes and navigate between them just with shortcuts. Maybe that shortcut exists on IntelliJ but I couldn’t find out.</p><h4>Angular on VS Code</h4><p>Let me introduce you to <a href="https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme">Material Icon Theme</a>. I’m actually not a huge fan of material design, but the point of this theme is that file icons represent not only their extension but their roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*7yo2pwg21o9XlSG8TAc39Q.png" /><figcaption>Components, pipes, and services have different colors to distinguish them.</figcaption></figure><p>Another good thing for Angular developers : VS Code doesn’t save the file on highlighting other applications. That means that your browser will not reload unexpectedly. If you know what I’m talking about, you know it’s bothering.</p><h4>TypeScript on VS Code</h4><p>Did I already told you that I love TypeScript ? TypeScript is great because it’s a fail-fast language that solidifies your apps. And there is a greater benefit, TypeScript helps IDEs to understand your code, and IDEs rewards you by providing you a better code completion and highlight errors. Unless you are still in the samouraï era and use emacs or vim, TypeScript will save you a lot of time and prevent mistakes.</p><p>VS Code was made by Microsoft that created TypeScript too. I had great expectations on that point. But WebStorm is already excellent on understanding TypeScript… Unless one tiny point : WebStorm doesn’t get <a href="https://developers.google.com/web/updates/2015/01/ES6-Template-Strings">ES6 Template strings</a>, VSC does. Anyway, both IDEs manage very well this language. Maybe VS Code will have a better / quicker implementation of future versions ?</p><h4>PHP on VS Code</h4><p>On the other hand, PHP support is way better on IJ. If you work exclusively in PHP, stop reading here and keep IntelliJ.</p><h4>The future</h4><p>Before investing your precious time into something, it’s important to ensure that this thing will not die tomorrow. When I decided to learn <a href="https://laravel.com/">Laravel</a> (42k stars on Github today), around 4 years ago, it was way less used than Symphony (17k) , CakePHP (7k) or Yii (5k). But they where clues : overall quality was really good and acknowledged by thrusted developers, Github repo was well maintained and even the website design was nice and clean.</p><p>IDE choice is less community-dependent than an open-source framework but still it’s important to check if people are still going to use it in the future. Digging around the web, I found that VS Code seems having more and more enthusiasts whereas the other one is stagnating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VWzyNzVN4nnuduTXGwB0Dw.png" /><figcaption>Seems like VS Code is having more and more interest.</figcaption></figure><p>Did you heard about Solidity ? It’s a quite new language to create decentralized apps on the <a href="https://www.ethereum.org/">Ethereum blockchain</a>. Let’s say that it’s the new BIG thing alright ? So, witch editor do you think has more Solidity support ? Again, VS Code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*-kbrUriadRXRsMMF2V5W7A.png" /><figcaption>Solidity plugins for VS Code.</figcaption></figure><h4>Conclusion</h4><p>If you don’t have a good reason to change from one to another, you’re not missing much by not doing it. Those are both really good software. If you have to choose between both, I would say that PHP and Java devs should go IntelliJ and JS/TS devs with VSCode. For myself, I’ll keep VS Code. And you ?</p><p><strong>VS Code pros</strong></p><ul><li>Open Source</li><li>Lightweight : less RAM and CPU usage</li><li>Bigger community : plugins, tutorials, etc.</li><li>A bit better with JavaScript and TypeScript</li><li>More “future-proof”</li></ul><p><strong>WebStorm pros</strong></p><ul><li>Better PHP / Java support</li><li>Less Intrusive</li><li>More configurable</li><li>More stable</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe71f0d07c59" width="1" height="1" alt=""><hr><p><a href="https://medium.com/les-forgerons/my-way-from-webstorm-to-vs-code-and-other-things-in-a-developers-life-fe71f0d07c59">My way from WebStorm to VS Code and other things in a developer’s life</a> was originally published in <a href="https://medium.com/les-forgerons">Blog Buddyweb - Agence Digitale à Paris</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>