<?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 Real Dev on Medium]]></title>
        <description><![CDATA[Stories by Real Dev on Medium]]></description>
        <link>https://medium.com/@real_dev?source=rss-6462ab8322fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*QtuuvdmdobfewY2h_z495w.png</url>
            <title>Stories by Real Dev on Medium</title>
            <link>https://medium.com/@real_dev?source=rss-6462ab8322fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:10:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@real_dev/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[Next + Nest: Working together]]></title>
            <link>https://medium.com/real-dev-engineering/next-nest-working-together-199bd45c1bcc?source=rss-6462ab8322fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/199bd45c1bcc</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Real Dev]]></dc:creator>
            <pubDate>Wed, 16 Oct 2019 19:55:01 GMT</pubDate>
            <atom:updated>2019-10-16T19:55:01.754Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is the first story of series <a href="https://medium.com/real-dev-engineering/show-how-real-dev-engineering-is-done-796af8e981ba">Real Dev Engineering (How Real Dev is built)</a>. In this story, we talk about NextJS and NestJS, what are they, how to integrate them together.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*ymfz_KKMuGJpIPyvdlGnHA.png" /></figure><h3>Say again. What is which?</h3><p>I know, it’s a bit confusing :) I’ll give a little bit context. If you know what they are, feel free to skip this part.</p><p><a href="https://nestjs.com/"><strong>NestJS</strong></a> is “a progressive Node.js framework to building efficient, reliable and scalable server-side applications”. Too abstract? It’s a framework for building backend, like Django for Python, or Spring Boot for Java.</p><p>You might ask, what about Express or Koa? Express is more like Flask in Python. It only handles the HTTP parts without giving you the “batteries”, like Authentication, ORM, Real “Middleware” (Express’s middleware is a different concept), Caching, so on and so forth. It doesn’t have a lot of best practice either.</p><p>NestJS, on the other hand, enforces a coding structure (inspired by Angular) and has best practice around all the above things. In fact, it uses Express as a backend, so everything is compatible. You can replace the backend with fastify if you want performance.</p><p><a href="https://nextjs.org/"><strong>NextJS</strong></a> is the “battery-included” version of React for the frontend. The framework handles the following things:</p><ul><li>Server-Side Rendering: Benefits SEO and initial loading time</li><li>Routing</li><li>Bundling your CSS, JS and loading them dynamically</li><li>CSS support is native (and will be <a href="https://github.com/zeit/next.js/issues/8626">builtin</a>)</li></ul><p>Both of these frameworks are open source and have full support for TypeScript. There are already tons of successful in-production use cases.</p><h3>Getting started</h3><p>Our codebase is like the following structure, a bit unusual, but it doesn’t affect how to set it up.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b98a1a6ce7d7262057a8101b29ce9f0/href">https://medium.com/media/8b98a1a6ce7d7262057a8101b29ce9f0/href</a></iframe><p>Typically with NextJS, you can use its embedded webserver as your backend (Express based), but it’s fairly limited. Most people use a hand written server (also mostly Express based 😆), and just use the Next “server” for its rendering purpose. Think of calling a render function. Our goal here is to replace that custom Express with NestJS.</p><p>In order to put Nest in the picture, we create a webserver using NestJS. It internally maintain an instance of Next server. Whenever a request like <a href="https://real.dev/task*">https://real.dev/task</a>s comes:</p><ul><li>NextJS server takes it, sees it as a non-API request, route it to NextController (see below)</li><li>NextController calls its internal render function</li><li>Render function looks for task.tsx in the pages folder</li><li>The default-exported React component from task.tsx is rendered, and returned as response</li></ul><h3>Next module in Nest</h3><p>NestJS organizes code into <a href="https://docs.nestjs.com/modules">modules</a> (like the task module above). We’ll create a dedicated module for interacting with the Next server.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/259effcd8173dc671bf0ccd36c5197f6/href">https://medium.com/media/259effcd8173dc671bf0ccd36c5197f6/href</a></iframe><p>We create a next server instance and provide it to the controllers to use.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41f4aa60381f43df7a57d52d758548dc/href">https://medium.com/media/41f4aa60381f43df7a57d52d758548dc/href</a></iframe><p>We have to use FactoryProvider since Next server needs to be prepare()ed before usage.</p><p>I’ll omit the definition of nextConfig since it’s a typical config object, except in our case, we wrote it in TypeScript with proper type annotation to ensure correctness. One caveat is about dir and distDir, which we’ll talk about later.</p><p>The controller is straightforward: just forward the request into the Next server.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/918c9361b05e74a11e1c9f8d0c4e91ef/href">https://medium.com/media/918c9361b05e74a11e1c9f8d0c4e91ef/href</a></iframe><p>Next up, we’ll go into two detailed issues we had with this approach.</p><h3>Next’s build config</h3><p>NextJS takes a config either from constructor or next.config.js. In there, two configs regards to directory in NextJS, which are not very well documented. If you have a standard setup, it probably “just works”. But it’s generally useful to know about them.</p><ul><li>dir: The source directory. You can simply think it’s the directory containing the pages folder. It defaults to .- the current folder. This is also used when you do next build &lt;dir&gt;. In our case, it’s packages/website</li><li>distDir: The <strong>relative</strong> path from the source folder to the build output. Defaults to .next. That’s why, by default, the built asset will go into ./.next. In our case, it should be set to something like path.relative(&#39;packages/website&#39;, &lt;BUILD_DIR&gt;). This is because we have a dedicated build directory, and they’re separate for development and production build.</li></ul><p>I learned this by looking at <a href="https://github.com/zeit/next.js/blob/07502ba2dd4e30246873254a9e22ca8011736f7b/packages/next/build/index.ts#L93">this code</a>. With the proper settings in next.config.ts, we should be able to spin up a server in development!</p><p>One more thing to be done. For prod build, we run next build packages/website. It’ll look for a file named next.config.js under the dir, and an config object in there. We don’t use this file for development because next server builds on the fly on development, and takes the config from our next.config.ts (not JS!). In order to share the config, we can easily do something like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84a5d548bd460a90545e9950e56c0462/href">https://medium.com/media/84a5d548bd460a90545e9950e56c0462/href</a></iframe><p>Here the required path points to the compiled JS output from TSC. It should be typical if the project is setup in a NPM publish-able way. (We’re actually not, but that’s going to be another story 😛)</p><h3>Hot reloading all the stuff</h3><p>Till now, we have a working integration of Next + NextJS. It works both on development and production. One more thing.</p><p><a href="https://docs.nestjs.com/techniques/hot-reload">NestJS documentation</a> has a nice little trick: Hot reload the server using webpack. I would recommend everyone trying it.</p><p>It basically means every change on your server code, takes a glance to reload, instead of waiting 5 seconds for the server to restart. It works in a non-intrusive way, meaning it doesn’t change anything existing. How awesome is that! Following the doc to set it up.</p><p>One issue after we have NextJS in the picture though: The provider will be reloaded when the app instance is closed. That means the Next server instance is re-created, hence the in-memory compile cache of pages and components are lost. Even though the backend server takes less than a second to reload, NextJS will recompile all the frontend stuff, which takes another 3–4 seconds. It shoots us back to square one!</p><p>The solution is actually pretty straightforward: Cache the server object in the provider.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4475ac6baad9810441d4c820066a6d62/href">https://medium.com/media/4475ac6baad9810441d4c820066a6d62/href</a></iframe><p>That’s it. We have a fully hot-reloading server, which reloads within one second, no matter it’s a backend or a frontend change.</p><h3>Conclusion</h3><p>These are all the things I’ve done to set up a backend+frontend project, with the following goodies:</p><ul><li>Nice coding structure</li><li>SSR support out of the box</li><li>Hot reloading any change</li></ul><p>This is by no means a perfect solution. There’s other ways of doing the integration, for example the <a href="https://github.com/kyle-mccarthy/nest-next">nest-next</a> in reference. If you see anything that can be better, please do let me know!</p><p>Hope you like it! Stay tuned for more stories.</p><p>P.S: I’m happy to talk about details or tech in general, reply here or drop me an email at <a href="/service/mailto:luke@real.dev">luke@real.dev</a>.</p><h3>About Us @ Real Dev</h3><p><a href="https://real.dev/">Real Dev</a> is a community of developers with practical engineering skills. We are committed to help developers to (im)prove themselves, and companies to hire talented developers.</p><p>You can showcase your skills by solving our tasks, and we help you find dev jobs looking for exact able developer like you! <a href="https://real.dev/">Try it out!</a></p><h3>References</h3><ul><li><a href="https://nestjs.com/">https://nestjs.com/</a></li><li><a href="https://github.com/nestjs/nest/issues/1122">https://github.com/nestjs/nest/issues/1122</a></li><li><a href="https://github.com/kyle-mccarthy/nest-next">https://github.com/kyle-mccarthy/nest-next</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=199bd45c1bcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/real-dev-engineering/next-nest-working-together-199bd45c1bcc">Next + Nest: Working together</a> was originally published in <a href="https://medium.com/real-dev-engineering">Real Dev Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Launching Metrics, with a new task!]]></title>
            <link>https://medium.com/@real_dev/launching-metrics-with-a-new-task-ba848b08c939?source=rss-6462ab8322fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba848b08c939</guid>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[new-features]]></category>
            <dc:creator><![CDATA[Real Dev]]></dc:creator>
            <pubDate>Sat, 05 Oct 2019 06:04:07 GMT</pubDate>
            <atom:updated>2019-10-17T01:50:12.049Z</atom:updated>
            <content:encoded><![CDATA[<p>Real Dev just got more fun — We’re happily announcing we added metric collection!</p><p>What does that mean? This picture should demonstrate it pretty well. The idea is straightforward. You might have heard of the famous <a href="https://benchmarksgame-team.pages.debian.net/benchmarksgame/index.html">benchmark game</a> and <a href="https://www.techempower.com/benchmarks/">web framework benchmark</a>. We developers love benchmarking, and optimizing. We want our code to be perfect and fastest in the world!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdI5DRoct4Pn1vWzSqw88g.png" /></figure><p>As you can see above</p><ul><li>Each task now can have more than one test suite</li><li>We collect some metric, such as timing, latency, and show them in the result, shows off how good your code is!</li><li>Now the leaderboard is ranked based on metrics! When two submission have the same score, the one with better metric will be ranked first!</li></ul><p>Since we have multiple test suites per task, it’s reflected in the task card. When only part of them is solved, it looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ajr8q83ujtcaT0QMjuePVw.png" /></figure><p>Lastly, as you probably see above, we are launching a new task: <a href="https://real.dev/task/trending-products"><strong>Trending Products</strong></a>. It comes from our real project experience. Write a script to handle some big data and deal with some statistics. It’s not hard, but hard to solve with good metrics! Challenge yourself!</p><p>Hope you enjoy it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba848b08c939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show how Real Dev Engineering is done!]]></title>
            <link>https://medium.com/real-dev-engineering/show-how-real-dev-engineering-is-done-796af8e981ba?source=rss-6462ab8322fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/796af8e981ba</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[real-dev]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Real Dev]]></dc:creator>
            <pubDate>Tue, 24 Sep 2019 04:42:56 GMT</pubDate>
            <atom:updated>2019-09-24T05:16:11.681Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a series of stories about how Real Dev is built. Sorry for the clickbait title 🤣.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7HaJGYJvWg3Lkyo4o5fW_g.jpeg" /><figcaption>What we’re doing</figcaption></figure><p>Real Dev is a platform for learning, assessing real world developer skills. As you might know (duh), Real Dev itself is built with standard web technologies. There are many interesting challenges. As our platform involves not only webpages and web servers, but also</p><ul><li>Asynchronous task execution</li><li>Containerization</li><li>Local app packaging and cross platform (our CLI!)</li><li>Dev tools and deployments</li></ul><p>To get started, here is a list of technologies we used, to only interest you!</p><h3>AWS</h3><p>We use many products: EKS, EC2, SQS, S3, CloudFront, RDS (PostgreSQL), ElastiCache (Redis), CodeBuild.</p><h3>Node all the way</h3><p>Our entire tech stack is based on NodeJS, including web frontend, web server, CLI. It’s a monorepo. We use Yarn, and its workspace.</p><h3>TypeScript</h3><p>I ❤️ TypeScript. This very philosophy of open development is borrowed from TypeScript. We want to let the world know what are we working on, how are they done. Even though we’re not exactly open sourced, but this is a start.</p><p>We use the latest TypeScript (3.6.3 as of writing).<a href="https://emojipedia.org/heavy-black-heart/">️</a> We set up TSLint. We use Prettier. Pretty standard, huh?</p><h3>Next Nest</h3><p>We use <a href="https://nextjs.org/">NextJS</a> for our web frontend, and <a href="http://nestjs.com/">NestJS</a> for backend. Isn’t it confusing :) I’ll show how they’re integrated in later posts.</p><h3>Kubernetes</h3><p>We use Kubernetes for our deployment. A friend recommended it to me, and I liked learning cool stuff. Learned it by adopting the Real Dev philosophy: Doing it on a real project, which is our platform.</p><p>Works very well, extensible, flexible. Only thing is we have to pay for EKS for its cluster. It ain’t cheap 😅.</p><p>The very fact that our core engine is built on top of containerization, makes Kubernetes very suitable for our use cases. We have a very cool feature: Deploying your submitted code live to show case what you’ve built. They’re deployed using k8s. Wanna know about it?</p><p>This is just a bird eye view of our technologies. If there’s anything specifically you’d be interested, let me know!</p><p>We always wanted Real Dev to be an open platform where everyone can come contribute and learn something out of our content, challenges, and community. Let’s help each other and make progress together!</p><p>Through a continuous stream of short/long stories, we’re going to show you how Real Dev itself is built, some of its interesting challenges and lessons, what hard problems did we encounter and how to solve them.</p><p>Also, we’re only a very small team, with limited industry experience. I’m sure we’ve done something very stupid, and hope you can point them out directly, so that we can learn as well!</p><p>Stay tuned for later posts! I’m excited to share about them, and see you all there!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=796af8e981ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/real-dev-engineering/show-how-real-dev-engineering-is-done-796af8e981ba">Show how Real Dev Engineering is done!</a> was originally published in <a href="https://medium.com/real-dev-engineering">Real Dev Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show the real developer you with tech skills!]]></title>
            <link>https://medium.com/@real_dev/show-the-real-developer-you-with-tech-skills-3d073003100b?source=rss-6462ab8322fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d073003100b</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Real Dev]]></dc:creator>
            <pubDate>Tue, 06 Aug 2019 14:01:02 GMT</pubDate>
            <atom:updated>2019-08-08T20:08:47.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>Show the world you’re the REAL developer!</h3><p>Have you found yourself in an interview and were thrown a puzzle question that you’ve, never, ever written in your daily coding life?</p><p>I’m sure you have. We had too.</p><p>Using algorithm puzzles for assessing a developer’s tech skills is plain wrong. I know. It exists for a reason. For many big companies, they don’t really care. But that doesn’t make it right.</p><p><strong>We developers, should be defined as what we build, not what puzzles we can solve.</strong></p><p>Tech has developed so much more since the past, far beyond some smart tricks that can cover in some whiteboarding. Many of the points are well written by the awesome folks here at <a href="http://they.whiteboarded.me/">they.whiteboarded.me</a>, so I’ll save some words.</p><p>Today, we’re launching <a href="https://real.dev/"><strong>real.dev</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEKqhcxCwZk6hy8iCnSgzw.png" /></figure><p>Real Dev is a platform for developers to challenge themselves with, <strong>real-life coding challenges</strong>.</p><p>No algorithmic puzzles that bends our mind, no Aha questions that tests your preparation. Real ones.</p><p>Here’s how it works.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNCoV4wqVfJ0%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNCoV4wqVfJ0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNCoV4wqVfJ0%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/080e63f397213fd18392c0c34919aa09/href">https://medium.com/media/080e63f397213fd18392c0c34919aa09/href</a></iframe><p>This is a place where you can</p><ul><li>Challenge yourself</li><li>Learn new cool tech</li><li>Enjoy building real (but small) project</li></ul><p>We really believe real-life coding skill is what really matters. And we would really appreciate your feedback and help!</p><p>If you share the same philosophy, you can help by either spreading the words, or just talk to us. Share your unique developing experience, and we can make them part of our challenges!</p><p>If you’re a company that values these skills, talk to us, we can help! Let’s try moving the industry towards a more realistic direction!</p><p>Thanks for your time. You can find us at</p><ul><li>Website: <a href="https://real.dev/">https://real.dev</a></li><li>Post in <a href="https://www.reddit.com/r/RealDev">/r/RealDev</a>: a place for discussing feedbacks and our challenges</li><li>Support us on <a href="https://www.producthunt.com/posts/real-dev">ProductHunt</a></li><li>DM us on <a href="https://twitter.com/RealRealDev">Twitter</a></li><li>Email us at <a href="/service/mailto:contact@real.dev">contact@real.dev</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d073003100b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>