hagopj13 / node-express-boilerplate

A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
MIT License
6.99k stars 2.05k forks source link

PR - TypeScript Conversion #136

Open dominick-more opened 3 years ago

dominick-more commented 3 years ago

I set for myself the goal to make a "mini" app project, in order to showcase my skills and thought about what the basic functionality of backend server required, so that I can execute async calls from my client code, and add records in a db, so I saw the work that you did and think it's really quite well thought through, but I also want to demonstrate my typescript abilities. I wanted to use your work for a basis and did a complete typescript overhaul of all src and tests js files. All existing package.json scripts are running as before with noted changes (I will point these out in a pr).

Scope of changes:

Code: All function parameters and return types defined (where practical) Best effort to keep the original function signtatures unchanged.

Build-Configuration: Due to inclusion of TypeScript, have modified executable dev dependencies 'ts-node' for 'dev' script, babel-jest for 'test' script and 'babel-ci' for the 'server' script transpilation to 'dist' out directory.

Eslint: Have replaced extends "airbnb-base" with "airbnb-typescript" (and other typescript contraints).

Docker: Reordered DockerFile 'USER node' to first execution position and creating the checkout working directory /home/user/nope-app.

dominick-more commented 3 years ago

Please advise if you are interested in seeing the changes in this PR.

trasherdk commented 3 years ago

Sounds interesting. Can you put it up in a repository? I would like to take a look.

dominick-more commented 3 years ago

I have added the code to https://github.com/dominick-more/node-express-typescript-boilerplate/tree/pr/typescript-conversion

trasherdk commented 3 years ago

@dominick-more Thanks..

markvital commented 2 years ago

Any update on this? It would be cool to have a Typescript version of this boilerplate.

trasherdk commented 2 years ago

@markvital https://github.com/dominick-more/node-express-typescript-boilerplate/tree/pr/typescript-conversion