Node boilerplate in Typescript with basic functionality

Tl;dr? check for the repo link at the end of the article.

A while ago I started using Node.js as a backend for my projects, for no other reason aside from that fact that it’s Javascript and I don’t need to keep up with learning a different programming language for the back end.

Before that I was using PHP, but as I had to work on both frontend and backend, the learning curve was much more gentle as my resources were split between two programming languages. Now, it got much steeper and it needs to be if I want to be able to keep up with the new developments and speed at which the Javascript and TypeScript environment is evolving.

Bonus side effect of using Node for your app’s backend is that setting up the development environment gets much easier and faster, compared to other languages like PHP, Java, .Net and so on.

I’m not sure that I would’ve migrated to Javascript full time if it wouldn’t have been for TypeScript, but it was, so here we are. ❤️

The contents of the “box”

So, on this positive note, I decided to write a Node + Express + JWT + TypeORM (MySQL) boilerplate in TypeScript, with the following functionalities working right out of the box:

  • Registration, authentication & authorization endpoints: register, login, forgot password, reset password, confirm password
  • Profile endpoints: get profile, update profile
  • Generic CRUD endpoints: get all, get one, create, update, delete one, delete all

Is that it?

The reason I’m doing this is because in my endeavours I couldn’t find a suitable boilerplate that would offer all the generic functionality out of the box, and that takes a while when you’re doing it from scratch.

I’ll continue updating the boilerplate with what I consider to be generic functionality as I go.

If you think of functions and functionalities that could be considered generic and/or are often needed in Node projects you can leave a comment below or do it in GitHub.

Any documentation?

For the moment there is no documentation included in this article or in the repository, aside from the comments in the code, but if this gets any traction I’ll start writing up some explanatory articles and leave the links below.

A share and a star, follow, fork to the GitHub repo would help speed things up.

I almost forgot. In working with the boilerplate I built, you might find useful, the following links:

Additionally, you can ask me anything and I’ll explain it.

You want to contribute?

That would be really cool and highly appreciated. Thank you! 

Write up your contribution on GitHub and create a Pull Request to merge your updates to the project. I’ll review it with priority.

You can contribute even if you’re not writing code. I’ll do the work, just let me know what you need.

All I ask for my work is that you follow me, or the project on Github, and if you also share my blog I would be eternally grateful.

What’s the repo?

Leave a Reply

%d bloggers like this: