Friday Picks 068

Read more →

Friday Picks 064

Here are some resources for you: Testing React Apps: a guide for testing React applications with the Jest framework How to Code in Go: free ebook for learning Go How to get started with the 11ty (Eleventy) Blog Starter: a tutorial on using Eleventy and Sanity.io (a content management system) Your First Tailwind Website: a YouTube video on using TailWind CSS Node Auth Tutorial (JWT): a video series on authentication with Node.
Read more →

Friday Picks 057

Read more →

Friday Picks 055

Read more →

Friday Picks 052

Read more →

Run Locally Installed NPM Packages Without Global Install

There are a lot of tools in the npm ecosystem that you need to run in your project. For example, firebase-tools or heroku. If you read the documentation, those tools require you to install them globally: npm install -g firebase-tools Now you can execute the binary from everywhere, for example: firebase init. But it’s recommended to install packages locally instead of globally 1. Updating a global package would make all your projects use the new release, and as you can imagine this might cause nightmares in terms of maintenance, as some packages might break compatibility with further dependencies, and so on.
Read more →

Friday Picks 049

Here are some links for this Friday: Architecture Patterns with Python: Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices Paperback - learn Domain-Driven Design with Python, free HTML version Performance Best Practices: Running and Monitoring Express.js in Production - insightful article, although it boasts some ads for the service the blog belongs to How To Build An Amazing LinkedIn Profile [15+ proven tips] - a guide on getting the most out of your LinkedIn profile Nonsense!
Read more →

Currently Working on Clean Nodejs With Mongodb and Graphql API

At the moment, I’m into architecture, clean code, building APIs. I’ve watched the video Using Clean Architecture for Microservice APIs in Node.js with MongoDB and Express by Bill Sourour. I’m trying to build something similar, but using the Fastify framework and GraphQL. Bill works a lot with dependency injection, and I’m having trouble with translating the code from using http endpoints and requests to using GraphQL. Further Reading Example Microservice API by Bill Sourour Using Clean Architecture for Microservice APIs in Node.
Read more →

Resources for Learning Nest.js

Here are some resources for learning Nest.js, the TypeScript Node.js framework with Angular-like architecture. Recommended resources are bold. Awesome Nestjs: a massive list of NestJS resources API with NestJS - a tutorial series in blog format Learn NestJS - Full Course for Beginners: YouTube/Udemy by Dawid Dominiak Learn Nest.js from Scratch by building an API by Maximilian Schwarzmüller Nest.js with MongoDB - Complete Example by Maximilan Schwarzmüller NestJS Crash Course by Brad Traversy Build a GraphQL Server with NestJS and MongoDB by Ben Awad NestJS Zero to Hero - Modern TypeScript Back-end Development by Ariel Weinberger (paid course) Creating your first Node.
Read more →

Test-Driven Node Postgres Knex Dockerized

Three days ago I started a short tutorial on how to write a test-driven Node.js web API with PostgreSQL database. The excellent blog post is from 2016, but it’s still useful. I used Docker to build the application. If you want to see the example application as a dockerized Node.js/Express.js program, you can take a look at my GitLab repository. The repository also uses GitLab CI to build the container and run the tests with Mocha.
Read more →

Docker Postgres Knex Setup

Project Structure Here’s the project structure for my application. Adjust to your needs. I used the Express application generator to scaffold the program. . ├── docker-compose.yml ├── Dockerfile ├── healthcheck.js ├── LICENSE ├── node_app │ ├── app.js │ ├── bin │ │ └── www │ ├── db │ │ ├── Dockerfile │ │ ├── knex.js │ │ ├── migrations │ │ └── seeds │ ├── knexfile.js │ ├── node_modules │ ├── package.
Read more →

More Learning Resources During COVID-19-Outbreak

Here are some more resources for learning new things during self-isolation: Education Links: a collection of links to help you and your kids Amazing Educational Resources: a list of resources with free or discounted offers OpenLearn (free learning platform from the Open University) Scholarships for Students on Codecademy: 10,000 free accounts for high-schoolers and college students around the world Shawn Wildermuth’s Courses: free courses on Bootstrap 4, Vue, SignalR during the crisis Free JavaScript/Node/CSS books 365 Data Science: Free Access Till April 15th: learn mathematics, statistics, SQL, Python, machine learning 50% discount on Wes Bos’s courses: Wes Bos is a respected JavaScript teacher 50% discount on dataquest.
Read more →

Free Learning Resources During COVID-19-Outbreak

Read more →

Friday Picks 036

Read more →

Learning About Nodejs Graphql Microservices

I’m currently working on a few micro-services with Docker. The architecture looks promising to me, and I like to play with Docker containers. Lately I’ve been watching a few videos about Node.js/GraphQL Microservices by Better Coding Academy. The tutorial series assumes a lot of knowledge (JavaScript, Express, GraphQL, Docker). I would have liked more detailed explanations. But the videos are still useful for showing the architecture of an Express/GraphQL setup with micro-services.
Read more →

Learning About Best Practices for Docker and Node

Today I’ve tried to update one of my Docker apps that uses React, Enzyme, and Jest. This lead me on a wild goose chase about react-test-renderer and best practices for Docker builds for Node.js. I’m still not sure where the problem is (Enzyme, maybe?). But I found three useful resources for Docker and Node.js: Docker and Node.js Best Practices Node + Docker Hello World, for Showing Good Defaults for Using Node.
Read more →

Friday Picks 022

Read more →

Delete All node_modules Folders Recursively

Read more →

Tool: pnpm - Fast And Lean Package Manager for Node.js

A few days ago, I switched to fnm as my version manager for Node.js. Before, I installed the default nodejs package that came with Arch Linux. But sometimes I would update my operating system, and thus getting a new Node.js version, and my system would break. With fnm, I have fine-grained control over which version of Node.js I’m running. Now, let’s talk about package managers. Node.js ships with npm as the default package manager.
Read more →

Fast Node Management With fnm

fnm offers a speedy alternative to the Node.js manager NVM. Built with native ReasonML, it’s significantly faster than NVM. fnm Setup Here’s how I set it up on an Arch-based Linux system that uses the Fish shell as an interactive shell. Use the installation script from fnm: $ curl -fsSL https://github.com/Schniz/fnm/raw/master/.ci/install.sh | bash The command downloads fnm, installs it and adds a loader to bash. The installation script above adds the following lines to .
Read more →

Friday Picks 020

Read more →

Friday Picks 019

Here are some useful links for your pleasure: Stand Up a Node.js Server with NestJS including TypeScript and GraphQL - a tutorial by Aryan J. Robot, a new JavaScript library for finite state machines - a simpler and smaller alternative to x-state 253 of the very best tools and resources for web designers, developers and makers – in a nutshell. You can now generate self-hostable static blogs right from your DEV content via Stackbit - this blog runs on Gatsby.
Read more →

Permission Denied When Installing NPM Packages With Docker

I have the following Dockerfile for a React app:

base image FROM node:11.12.0-alpine ## set working directory WORKDIR /usr/src/app ## add /usr/src/app/node_modules/.bin to $PATH ENV PATH /usr/src/app/node_modules/.bin:$PATH ## install and cache app dependencies COPY package.json /usr/src/app/package.json COPY package-lock.json /usr/src/app/package-lock.json RUN npm install react-scripts@3.0.1 -g –silent RUN chown -R node:node . USER node RUN npm ci ## start app CMD ["npm", "start"] After setting up the work directory I copy the package.

Read more →

Friday Picks 012

Here are some things I’ve found useful this week or that I enjoyed: The Architecture of Open Source Applications - some free books on architecture! Use Svelte with SASS/SCSS in VSCode - add SASS to your Svelte project An Introduction to Domain-Driven Design - DDD w/ TypeScript - provides a good overview on DDD How to make your NodeJS application or API secure - some beginner-friendly advice on how to tackle security Mastering Phoenix Framework - free online version of a guide to Phoenix with TDD Building a JSON API in Elixir with Phoenix 1.
Read more →

Friday Picks 010

Here are some things I’ve found useful this week or that I enjoyed: As a senior developer, how do I better mentor an intermediate developer who is struggling? - Reddit thread about mentoring (might be useful to self-reflect on your own gaps) Digital Minimalism Review: Gazing Into the Abyss - an insightful review of “Digital Minimalism” by Cal Newport NestJS Tutorial für Einsteiger - (German) - I reviewed some of the content (it will be published in English next week) A complete guide to the Node.
Read more →

Friday Picks 009

Here are some things I’ve found useful this week or that I enjoyed: Boilerplate Code - Starter projects in React, Vue, Python, Full-Stack - some useful boilerplates As a self taught developer, i feel like i missed out on a lot of CS theory/basics. Good curriculums to catch up with ? - some advice for self-taught devs New Node.js 12 features will see it disrupt AI, IoT and more surprising areas - the future of Node.
Read more →

React.js & Node.js App Deployment with Heroku

Read more →

Friday Picks 008

Here are some things I’ve found useful this week or that I enjoyed: TypeScript Weekly - a newsletter for TypeScript How YOU can use Nest to build a GraphQL API - a tutorial that walks you through building a GraphQL endpoint with CRUD functionality Forget about component lifecycles and start thinking in effects - about React Hooks Build a Todo App in React Using Hooks - simple tutorial for beginners One simple trick to optimize React re-renders - without using React.
Read more →

Weekly Progress Report 26 2019

Nest.js I’m still smitten with Nest.js, a Node.js framework with TypeScript support. Here are some resources to get started with Nest.js. Vim vs. VS Code I’m giving VS Code another chance. So far, I’m not amused. I’m already too accustomed to my VIM workflow , and it’s a hassle to set up all my preferred key mappings. Some plugins offer excellent language support out of the box (e.
Read more →

Learn NestJS

Currently, I’m working through the excellent Udemy Course: NestJS - Zero to Hero by Ariel Weinberger. There are still some coupons to get a discount for this course. I’m still excited about NestJS as it seems to be an excellent way to develop a Node.js/Express.js application with TypeScript and Domain-Driven Design. The learning curve is steep if you are new to TypeScript and SOLID principles. But the author does a good job holding your hand and guiding you through coding the application.
Read more →

NestJS Is Fun

I’m learning about TypeScript and NestJS right now. There’s an excellent course on Udemy by Ariel Weinberger. It shows how to develop a CRUD API. If you want to get a sense on how NestJS looks like, take a peek at this article: Creating your first Node.js REST API with Nest and Typescript. NestJS seems quite opinionated, but in a good way. I like how it forces me to use a certain architecture.
Read more →

Blown Away by NestJS

I just finished a Serverless React with AWS Amplify - The Complete Guide by Reed Barger today. I learned a lot about AWS and serverless functions. But now it’s time for something different! What about NestJS? Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with and fully supports TypeScript (yet still enables developers to code in pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
Read more →

Node.js Architecture

Two days ago I learned about Clean Architecture with Node.js. I still find it hard to create a well-designed program without polluting my business logic with implementation details. Today I found another read-worthy article that might help: Bulletproof node.js project architecture. It also uses SOLID principles and different layers (controller, service layer, data access layer). Interestingly, the author of the blog post explains in a different article that Node.js is not designed to serve static assets, or your front end.
Read more →

Connect TypeScript Node.js and Mongoose With Environment Variables

In your existing project, add mongoose, dotenv, and @types/mongoose: yarn add mongoose dotenv yarn add @types/mongoose –dev Set up your database, for example with MongoDB Atlas or on your local machine. Create a new file called .env and add your MongoDB connection string. MONGO_URI=mongodb+srv://<your-user-name>:<your-password>@whatever.mongodb.net/test?retryWrites=true Now you can connect mongoose with Node.js inside server.ts. import mongoose from "mongoose"; import "dotenv/config"; mongoose.connect(${process.env.MONGO_URI}, { useNewUrlParser: true }); Please note, you have to use a template string and interpolate the environment variable.
Read more →

JavaScript Development: Run Concurrently

With the npm package concurrently you can run more than one command inside the same terminal. This comes handy when you simultaneously develop your front end and your back end in one project. Let’s see an example with a Node.js back end and a React front end. Here is the folder structure: server/ .gitignore index.js package.json …etc client/ public/ src/ … <- all the other React code First, install concurrently.
Read more →

Express.js: Send Responses

At some point, you have to send data from your back end (Node.js/Express.js) over the wire to your front end. Express makes it easy for you. Let’s say you have a GET request to a resource on the backend. app.get('/book/:id', async (req, res) => { // fetch the data from the database, for example from MongoDB try { const book = await Book.findbyId(req.user.id}) // then send the data with a HTTP code res.
Read more →

Express.js Security Best Practices

Read more →

Heroku Deployment Pitfall: Bind to $PORT

Read more →

Heroku Deployment Pitfall: Nodemon and Other Dependencies

Heroku doesn’t deploy your dev dependencies. This sounds like a good thing. But when you develop Node.js with Nodemon and your package.json uses nodemon as a start script, things can go haywire with Heroku. Easy fix: change your entry in package.json back from nodemon to node. … "scripts": { "start": "node server.js" // instead of: "nodemon server.js" }, … Also, check your other dependencies. Sometimes you might switch other packages from dev to normal dependencies, too.
Read more →