outmoded / discuss

The "mailing list"
99 stars 9 forks source link

Hapi.js boilerplate #191

Closed Sogl closed 5 years ago

Sogl commented 9 years ago

Hi!

Where I can find good boilerplate based on new Hapi.js version? Especially with MySQL/PostgreSQL user auth. Also interested in the folder structure and the module organization.

I found some: https://github.com/poeticninja/hapi-ninja https://github.com/smaxwellstewart/hapi-dash

But they are based on old Hapi versions (from 6 to 8) and has no changes more than six month.

jedireza commented 9 years ago

http://hapijs.com/resources#Boilerplates

Frame has been updated semi-recently but uses mongodb. Maybe it could be a source of inspiration.

poeticninja commented 9 years ago

@sogl the hapi-ninja boilerplate is pretty much the same with the most recent version of hapi. I believe the only thing you would have to do is add the inert plugin based on http://hapijs.com/tutorials/serving-files. I wouldn't worry too much about the hapi version being out of date. The upgrade path is really easy with the different major hapi versions. Don't let that scare you.

For an auth example you can see https://github.com/poeticninja/hapi-authentication-and-authorization.

I don't believe there is any one perfect boilerplate but many great examples. Take those pieces and build something from them that fits your thought pattern. If you have a question let us know because we are more than happy to point you in the right direction or let you know what has worked for us! :smile:

thebinarypenguin commented 8 years ago

I've created some example apps that explore how authentication schemes and strategies work. Each is very small (roughly 200 lines) and all the code is in one file for easy reading. They might be of interest to you.

Jiropole commented 8 years ago

This post really helped me too – thanks to all. @jedireza Do you take questions on the frame boilerplate example, and if so where is the best place? I'm struggling to understand a couple things.

jedireza commented 8 years ago

@Jiropole sure thing. You can open issues and ask questions over here: https://github.com/jedireza/frame/

Jiropole commented 8 years ago

I figured it what I was missing, in the interim, thank you! Your example has been very helpful in understanding a good API design in Hapi.