Easing Your Way Into Back-end Development with Node.js

Projects you can work on to start your back-end journey

Fernando Doglio
Bits and Pieces
Published in
9 min readMay 3, 2022

--

Original Photo by Kelly Sikkema on Unsplash, edits by Author

Getting into back-end development is not easy if you’re coming from a different area within the software industry. Arguably, it’s potentially easier to get started directly on the back-end than having done something else first, and then moving here. Why? Because you’ll have the bias from your previous experience contradicting or even clashing against some of the processes that happen in the back-end.

That said, learning a new skill is not only always possible, but beneficial for you. So let’s take a quick look at what would be a potential path for you to get started in back-end development with Node.js through some practical and easy-to-do projects.

After all, we all know that the best way of learning is by doing.

Let’s start on the terminal

Many developers assume that “back-end” stands for some kind of API, but that’s not necessarily the case. The term usually encompasses anything that has no UI. That means it can be an API, yes, or any other type of program that does something when you execute it.

And I think that’s a great place to start, because you don’t have the added topics such as understanding HTTP, what a request is, the different types of requests there are and so on. Let’s just focus on understanding how the language works with a simple, yet useful, project and we’ll move on from there.

The first project I would recommend then, is for you to work on a CLI tool. Anything simple will do. As long as you can then call it by writing node index.js you’re done. Bonus points if you’re able to create a binary for your OS.

What will this CLI tool do? Anything you like. If you’re lacking ideas, try to reproduce one of the common terminal commands, such as mkdir or touch or even ls . Node.js has more than enough libraries for you to reproduce all of them, so don’t worry about that part.

What will you learn here?

The point of getting started with such a project is to ease you into the language. Even if you’re already coming from JavaScript, you’ll need to pick up on the peculiarities of Node.js and understand how to structure projects with it and how it works.

It’s not the same to use Node through webpack as to use it as your main runtime. Trust me.

Other than that, you’ll also pick up on details such as:

  • Reading command line arguments.
  • Interacting with the filesystem.

A RESTful API

Yes, eventually you’ll also have to deal with microservices and API, so it’s a good moment to get started.

Now, APIs can be as big and as complex as you want, so my recommendation would be to do several different ones, or at least start small and gradually add on top of it.

The development of an API will give you the basics for many of the classical back-end topics. We’re talking about things like HTTP and client-server communication. Those are core topics that you’ll need to grasp. I’m not saying go all deep into it, but at least understand things like:

  • How do clients communicate to servers?
  • What are the different verbs available in HTTP and what are they usually used for?
  • What are headers and what do you use them for?
  • How can I return a JSON response that my front-end can understand?

You could even go a bit further and use a database to store the information you’ll deal with, which will be the perfect opportunity to learn about them if you haven’t already. Just try to keep the data model as simple as you can, especially if this is your first time.

Go with a classic, like a user management system, you’ll only have a single model, and you can implement the basic CRUD (Create, Retrieve, Update and Delete) operations.

You can use something like ExpressJS for this, which will keep the boilerplate to a minimum and it’ll help you see how things work without making it too complex.

This project will take some time and it’ll keep you entertained for a while, but once you’re done with it, you’ll want to move on.

Add AUTH to your API

Any real-world API will require some kind of authentication mechanism to protect it and its data. So what better time to implement such a feature than now?

Sadly, there are many different methods you can implement, all growing in complexity, so let’s first aim for a simple one.

Assuming you’re implementing this on top of the previously implemented API, I would suggest first getting started with JWT (JSON Web Token). It’s a very popular method of authentication for RESTful APIs and it’ll give you a chance to learn a few extra concepts while you’re at it.

You can read this article about JWT and best practices around it, then go back to your project and try to implement it.

If you’ve found JWT easy to implement, I would recommend moving up into OAuth, for example, it’ll require a lot more work and probably for you to develop some basic UI for your API, but it’ll also be an interesting challenge.

What will you learn here?

This project might not look like much, but you’re going to be learning about:

  • API security, different Auth methods and how they work
  • If you’re using Express as I suggested in the previous project, then you’ll learn more about the Request object and what kind of information you’ll find there.
  • You’ll also learn about middlewares and the middleware pattern.
  • You’ll get some 1:1 time with some interesting response codes, like the 3XX when working with redirections and some 4XX when dealing with incorrect credentials.

All in all, this project, coupled with the previous one, will give you all the basic tools you’ll need to implement your next API. Because even if you’re faced with another framework, you’ll be re-using all the concepts you’ve learned up to this point (things like HTTP, requests, response, verbs, auth, redirects and a lot more).

Hangman-type game

Alright, it’s time to start making things more complicated.

The point now is to work on complex logic, so my first suggestion would be to go back to the terminal for this one. If, by any chance, you’re coming from front-end development and you feel comfortable working on the UI for this, then by all means. Otherwise, avoid the headache, concentrate on the logic and spill some basic text output to the terminal.

With that said, the point of this project is to create a hangman game, you know, the one where you try to guess the word and with every failure, the stick figure of the person being hanged keeps getting drawn until you lose.

Image taken from the Internet as a simple example

Now, again, don’t worry about the visual representation, worry about the actual game logic. If you’re going with a terminal-based game, you’ll have to:

  • Learn how to read input from the user
  • Display some kind of minimal information
  • Build the game logic

That said, you can make this as complex as you want. If you wanted, for example, to take this to the next level, you could implement the game logic inside a separate API project and have your terminal program act as a client of that application. That way, you’ll also practice how to send requests from Node.js and how to parse the response from a service.

And in the process, you’ll build something fun, which will help keep you motivated when things don’t work out as expected.

Alternatively, and since the game Wordle is so popular these days, you might consider implementing a version of that game. It’ll definitely take the difficulty up a notch, but with a bigger challenge you’ll be able to learn more. You could take a similar approach and keep the logic out inside a separate API and have your client application be a terminal app (or a web UI if you’re comfortable with that).

The focus here shouldn’t be terminal, but instead the more complex logic. If you’ve been following along, so far you’ve been learning many different concepts but you haven’t really tackled a mid-complexity logic, it’s been CRUDs and requests. And that was intentional, keeping the logic simple allowed you to learn the new concepts without too much difficulty, now it’s time to put everything you’ve learned into practice.

If you liked what you’ve read so far, consider subscribing to my FREE newsletter “The rambling of an old developer” and get regular advice about the IT industry directly in your inbox.

A chat server-client as a final project

While HTTP is a huge part of back-end development, it’s not the only relevant part. Not even the terminal completes the combo, you’ll have to go through sockets at some point, so why not now?

The point of sockets is that they allow for the creation of an open channel between two (or more) parties that stays open, and anyone can send messages to be read by the rest.

Depending on what you’re trying to achieve, this is a very efficient way of communication. But of course, it’s not as straighforward as HTTP is, even with libraries like socket.io.

That said, the final project should be a chat service, with clients included.

You can pick if you do this with Web clients or terminal clients. I’ve implemented both in the past, and each one has its own difficulties, so they’ll both do.

As for the server, make sure you allow multiple users connected to the same room, and ideally, allow for the creation of multiple parallel rooms. This should make things quite interesting.

If you’re going with a terminal-based client, consider using Ink for your UI, it’ll help you keep things organized.

What will you learn from this project?

This is an interesting one, because while you’ll be using the same language, almost everything else will be different.

You’ll learn about:

  • Sockets, and why they’re so cool.
  • Events, you’ll pick up a thing or two about events with sockets, which you can expand on by looking at the EventEmitter object from Node.js.

While that might not seem like a lot, you’ll have your hands full for a while.

And while this is definitely not the end of the road, if you’ve completed this roadmap, you’ve tackled most of the common problems you’ll find in your daily tasks as a back-end developer.

It’s time to keep going and keep an open mind to new problems and new solutions, this is just the start of a never-ending journey!

Bit: Feel the power of component-driven dev

Say hey to Bit. It’s the #1 tool for component-driven app development.

With Bit, you can create any part of your app as a “component” that’s composable and reusable. You and your team can share a toolbox of components to build more apps faster and consistently together.

  • Create and compose “app building blocks”: UI elements, full features, pages, applications, serverless, or micro-services. With any JS stack.
  • Easily share, and reuse components as a team.
  • Quickly update components across projects.
  • Make hard things simple: Monorepos, design systems & micro-frontends.

Try Bit open-source and free→

--

--

I write about technology, freelancing and more. Check out my FREE newsletter if you’re into Software Development: https://fernandodoglio.substack.com/