DEV Community

loading...

Boilerplate: NuxtJS + Express server + Jest, all in Typescript

svitekpavel profile image Pavel Svitek ・1 min read

Alt Text

I was searching for a starter project which would combine:

  • NuxtJS in Typescript (+best practises for components)
  • ExpressJS as backend in Typescript
  • in one repository
  • with configured Jest runners for backend and frontend
  • Dockerfile [bonus]

But I haven't found any.

So I created one:

https://github.com/svitekpavel/nuxtjs-express-typescript

Take a look at README.md but also at components/User.vue and components/User2.vue for sample usage in components.

I hope it helps.

Discussion (5)

pic
Editor guide
Collapse
madhusudanbabar profile image
Krypton

Can you share how can we create components in TypeScript but without using classes or decorators,
There's very litte documentation on how to do it with options API or using Vue.extend.

Collapse
svitekpavel profile image
Pavel Svitek Author

See my comments in README. I didn't want to use classes either, so I explored pros and cons. Read here
github.com/svitekpavel/nuxtjs-expr...

And see implementations here:
github.com/svitekpavel/nuxtjs-expr...

And class approach here:
github.com/svitekpavel/nuxtjs-expr...

I also like the first approach - Vue.extend() better, because it seems that class approach has too much boiler code around it.

Collapse
madhusudanbabar profile image
Krypton • Edited

Yeah, the classes API feels somewhat complicated and needs extra imports and all,
I was stuck at importing the components using options API,
But later i figured it out that it was just because that i also needed to add .vue extension while importing the components,
BTW thanks for the reply 😇.
And your repo is really great for understanding express in nuxt.

Thread Thread
svitekpavel profile image
Pavel Svitek Author

Great, I'm glad it helped. I'd appreciate if you share with more people.

Collapse
svitekpavel profile image
Pavel Svitek Author

Hi all, I just updated to NuxtJS 2.14.1 and updated all dependencies and fixed insecure dependencies.