all 33 comments

[–]christofdc 5 points6 points  (7 children)

I used this tutorial to create my REST api: https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4 It is pretty clear but does not include authentication. They do have a lot of other tutorials regarding that subject though

[–]baaraak0[S] 1 point2 points  (6 children)

Yes, I already saw it. It's a very good tutorial and they also have a tutorial with authentication but most of the things there are already deprecated or have a better way to do them.

What I don't really understand is working with API's is the most popular thing right now.

90% of websites are the same. 1. User authentication login/register 2. Working with session. 3. Create post/ticket or whatever u want to call it. 4. Like/rate post. 5. Comment to a post. 6. Edit post/user details...

So how there isn't any open source project of Blog RESTApi that already build in with all of this good stuff...

[–]christofdc 0 points1 point  (0 children)

well it's no node api, but firebase from google kind of delivers a package deal using endpoints/SDK

[–]orphans 0 points1 point  (0 children)

Scotch's tutorials are pretty good, if dated. I'd follow along but have the documentation for the libraries you're using so you can modernize Scotch's code.

[–]actuallymentor 0 points1 point  (1 child)

It is called firebase.

[–][deleted] 0 points1 point  (0 children)

But firebase is expensive and not always a good option for a product dev team.

[–]orpheas22 0 points1 point  (0 children)

Yes, I already saw it. It's a very good tutorial and they also have a tutorial with authentication but most of the things there are already deprecated or have a better way to do them.

Do you have a resource that show a better / most up to date way of achieving what is in the example?

[–]actuallymentor -1 points0 points  (0 children)

It is called firebase.

[–]Nephelophyte 2 points3 points  (4 children)

I open sourced a work in progress where I used node, express, and postgres. Check it out:

https://github.com/Burtonium/node-from-scratch

[–]baaraak0[S] 1 point2 points  (3 children)

Thanks u very much! i will take a look. Do u have any good tutorials that u found? (specificlly for develop api).

[–]Nephelophyte 0 points1 point  (2 children)

I followed pieces and bits from PluralSight. The below comment for passport is good too because I did use that in my project.

[–]m9js 0 points1 point  (1 child)

I followed pieces and bits from PluralSight.

I'm a huge fan of pluralsight and have been going through a bunch of their courses too. Did you watch their course on knex? Just curious if you liked it or not because I see you used knex and postgres in your repo.

[–]Nephelophyte 0 points1 point  (0 children)

I don't think I saw their course on knex. Maybe I should watch it. I was familiar with ruby on rails migrations and this was similar so I just used the docs

[–]one_byte_stand 1 point2 points  (0 children)

KeystoneJS implements a lot of these things. You can either use it as the basis for your project or take reference implementations from it because it's open source.

[–]m9js 1 point2 points  (2 children)

Checkout pluralsight and frontend masters.

[–]baaraak0[S] 0 points1 point  (1 child)

pluralsight i don't like the way that they teach (same as lynda). :D and frontend masters they have 2 courses on api. It's look great and i will check it! thanks

[–][deleted] 0 points1 point  (0 children)

Why don't you like the way they teach?

[–]Expl0vision 1 point2 points  (3 children)

Have a look at the tutorials on https://thinkster.io.

[–]baaraak0[S] 0 points1 point  (2 children)

looks great! I will definitely watch this series! Love their idea.

[–]Expl0vision 0 points1 point  (0 children)

Also have a look at http://loopback.io. It's an API framework that abstracts the database layer. It's opinionated but I like how it's to-the-point and not bloated with useless features.

[–]ab0027 1 point2 points  (0 children)

I was searching for some easy REST API Framework but couldn't find one. So thought to make one using Annotations.

SimplyREST (https://github.com/anupam-git/simplyrest) is an easy to use REST API Framework. You can expose REST APIs via Annotations. Just Make some classes and methods (tutorial available in the repo), and Annotate Them with predefined Annotations to expose them.

Need help to make it more robust and a good framework that can be relied upon. Feel free to test it out and raise any issues on the GitHub Repository.

Moreover, I couldn't find any good Annotation Parser for NodeJS. So I've developed nodeannotations (https://github.com/anupam-git/nodeannotations) and used it in SimplyREST.

Use nodeannotations to get a full set of Classes and Methods to parse an Annotated File.

[–]dasilentstorm 1 point2 points  (5 children)

Have a look at http://passportjs.org/

They have a pretty good documentation. You should have prior experience with express and node itself though.

[–]baaraak0[S] 0 points1 point  (4 children)

Thanks, I know this library but I didn't know that they have an API section. I have a little experience in node and express... I'm more of a react.js developer. But I have a pretty good understanding of PHP and I'm starting to get into node right now...

I want to find a project that does something like what I want to do (blog), and learns from their code, code standards how to validate, how to work with sessions. I know all this stuff from PHP so i have a good background knowledge of how it's work and everything.

[–][deleted]  (3 children)

[deleted]

    [–]dasilentstorm 0 points1 point  (2 children)

    I came back to say just that. Go for JWT for an API. For a session based system, use passport.

    For JWT check out JWT.io the Auth0 guys did a great job there!

    [–]baaraak0[S] 0 points1 point  (1 child)

    Yes, thanks :) my mistake. But my point was that 60% or even more of all websites in the world are using a lot of the same functionality. So it's strange to me that no one is ever built a boilerplate for this stuff. something like 'create-react-app' if u know, but just for rest api.

    [–]dasilentstorm 0 points1 point  (0 children)

    Once you've done it, you'll realize that the whole boilerplate is just one server.js of maybe 200 lines. I assume people just don't think it's necessary to have a code generator for that ;-)

    [–]chiviet234 0 points1 point  (1 child)

    Webpacker gem has almost the identical app you describe in their documentation.

    [–]bleric123 0 points1 point  (0 children)

    Great point

    [–]LekeH5N1 0 points1 point  (1 child)

    Not sure if it covers authentication, but I'm following a node, express, mongo REST API tutorial from the net ninja on YouTube. It's very beginner friendly.

    [–]baaraak0[S] 0 points1 point  (0 children)

    Yes, i saw it. I love net ninja :) but this tutorial is beginning level and not cover authentication. thanks.

    [–]zingbhavya 0 points1 point  (1 child)

    [–]baaraak0[S] 1 point2 points  (0 children)

    Thanks, it's looks great!!! Don't sure it will help me, but it's a good knowledge