Example Typescript Node.js webserivce showcasing best practices in software development
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This is a standalone best practice web application developed for an engineering bootcamp for a lecture at the Technical University of Munich.
Please bear in mind that also this is not a perfect version of an application as one would imagine it running in production in a real world scenario. However, we tried to incorporate as many best practices as possible, but as few as needed to get students, who are on a beginner level, started. The goal is to have this is a toolbox for developing a state-of-the art Node.js Typescript business application.
Don't take everything we do in this application literally. It is important to also always think for yourself and consider which of the presented techniques and frameworks you actually need for your use case!
At the end, we hope that this helps you on your journey on becoming an amazing software developer and we hope you have fun exploring the universe of backend engineering :)
Disclaimer: A lot of the standard Node.js/Express code was to some parts inspired, to some copied over from PracticaJS. Please have a look at their work and examples as it gives you a great starting point and references when it comes to best practices with Node.js development. Also have a look at the Express Typescript Generator, which we also used to create the initial setup of our app.
In order to be able to start the service locally, follow these required steps.
Needed toolings and frameworks you should install before building the project:
-
Node.js (if not already installed)
-
Update npm
npm install npm@latest -g
-
Yarn
npm install yarn -g
-
Docker and Docker Compose (Rancher on Windows can be used)
-
GitHub CLI (optional)
brew install gh
-
Clone the repo
git clone https://github.com/netlight/my-hexagonal-pal.git
-
Install NPM packages
yarn install
To run/debug the service locally in dev mode, only the following is needed:
-
Start the
mongo
service of thedocker-compose
filedocker-compose up -d
-
Start the
my-finance-pal
service.yarn dev
The service now runs on port 3000 and listens to requests
-
Use the Swagger Editor for an overview and playground of the Endpoint Collection
docker pull swaggerapi/swagger-editor docker run -d -p 2000:8080 swaggerapi/swagger-editor